summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyangWu <xgreenlandforwyy@gmail.com>2022-02-21 20:30:44 +0800
committerBenda Xu <heroxbd@gentoo.org>2022-03-22 12:09:45 +0800
commit60a357de6bf51b8445d9ef3ea60ba62498fc9054 (patch)
tree1c75812ab03882d419cbbd7e8cc66401e06905c0 /dev-util
parentdev-util/rocminfo: bump version to 5.0.2 (diff)
downloadgentoo-60a357de6bf51b8445d9ef3ea60ba62498fc9054.tar.gz
gentoo-60a357de6bf51b8445d9ef3ea60ba62498fc9054.tar.bz2
gentoo-60a357de6bf51b8445d9ef3ea60ba62498fc9054.zip
dev-util/hip: bump version to 5.0.2
1. According to INSTALL.md, bundle rocclr at build time (like rocm-opencl-runtime which drop rocclr dependency). 2. Bundle roctracer headers which resolve circular dep with roctracer 3. Upstream moves to hipamd.git, while the perl scripts is in original HIP.git, with .pl suffix. Future hipcc will be a binary. 4. Move prefix from /usr/lib/hip to /usr 5. Avoid build error when USE=profile (Not sure if it's the right way) 6. Delete unused /usr/lib/.hipInfo and /usr/bin/.hipVersion Closes: https://github.com/gentoo/gentoo/pull/24681 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/hip/Manifest6
-rw-r--r--dev-util/hip/files/hip-5.0.1-DisableTest.patch32
-rw-r--r--dev-util/hip/files/hip-5.0.1-hip_vector_types.patch11
-rw-r--r--dev-util/hip/hip-5.0.2.ebuild119
4 files changed, 168 insertions, 0 deletions
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index a8db3b5914b4..a5655c73e1a8 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,5 +1,11 @@
+DIST 5.0.2-update-header.patch.gz 5136 BLAKE2B 290b9e250e3004a1147ad28606d7d205078affbd809c6a429744767ebabf35bd8df6395dc135984d345ae2f23fa457dcb2524bcbf31c5bf16903d3ee2007bf5d SHA512 41b1025c403e874026a712ec6f6571c873203b08ddadf68848f6d1f63924c21b206677b330f79edad2c4b85e2ba5053b1d33f70c7c09ff9c17bc5905b849da0c
+DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73
DIST rocm-hip-4.0.0.tar.gz 1012154 BLAKE2B 02343239a5b27c42dafd241f2c9b6f5195c50f78bfd717ae72bcb16d384bd6cf97ff6f2b86bfcf323aaaf022d6897f46d0987826c80d6f6279be4cb4792e15be SHA512 cf840dbe28a9a15e3be14351bfa22d3c81e1654813a7aee55f53e71b2ee183f8dd0de14a79791617fabb5b357cadbf2ce2f476f78884b2843d30f206d65088f6
DIST rocm-hip-4.1.0.tar.gz 954215 BLAKE2B c4b75ab2158e6921be1c34820ab5d1a5e2eb36112834b0143c50023caa27de384e0497f4837947cc7fe05554c6c95201340b1979eb916b31ebb4ffec8c923735 SHA512 420ffd7b79e2b4506873cbfc56e96395f8ed9d9375ce28df51626601199d4d8dca6920528e255d39a48ad66ee11f4b653f3b9f659df489d32b21886fb86c64b5
DIST rocm-hip-4.2.0.tar.gz 918281 BLAKE2B 45c28289c8ff9e600bfd9daff8af162c897fcfdf41ce65d91d1761d58253d87a6385fd4a15e818619ca39d3413479bf043ab2758fead349a243105e979b64f7c SHA512 e620507321c949ded2eab6159099eef0eab267eb686b6ee0ed86022fffaa51fb8714a7f344b79acf76c876c55919360905d1bb3a7c00a87f40174774d6682ce8
DIST rocm-hip-4.3.0.tar.gz 967550 BLAKE2B 263e8bbaa86198d3cb6a29f5597b56a3fe1e9338a8c485935070e6253816ccdba9671f33d8142c260aa3c36f43a71de7f2c1b7a15e1227f97aaf03ed10ce10dd SHA512 bc2d9597200405397387cc8f626f0cc734ee450c462bd7c7a0c655e3dfe2d1e09780328cbfa1c0d1e0db836e561fc450c5d514a6ad1a5828cb913c4c3c535ef1
+DIST rocm-hip-5.0.2.tar.gz 958496 BLAKE2B 9c8bb1eacd982203e3bd6c24560672c4a9aaf5606608635d7da5a60f613d9be50998f990c1ea3e0e6f5581e0efcba09af736a77bbc9469b2898e0974d063e8d6 SHA512 4a99e86a4594c15509a1bbfec0678cd05469eb14dcf35ce650e1eb7c2415f57f59071b1b8add2f8566ccf06242bead77abd275987fe79fe6031dea90d5693805
+DIST rocm-hipamd-5.0.2.tar.gz 319973 BLAKE2B ca19938eeca66f0d2614ff933e1d0e75b6b8dbc8d996fd4369e5649897b9948271ac88f2a66f0a40ef586d6185b30d01132decac95d1615c1ee419996050ed07 SHA512 056acab082b5073e81f9e5de00ae12c85021d1c297cdcfc45b85f191dcc68603f64fe5d0e75f9523120657947eb125beaa9c3ce26234968c43b200e638f9afa3
DIST rocm-opencl-runtime-4.3.0.tar.gz 1006792 BLAKE2B 29fd5843bb0153c7d3fe5250898f0fbdd089db6304122698c9ec9a5436e3a6845916f241f1a1e79a614e369f000297ac12413620edec0660d859ccddaa978d07 SHA512 a514d626700350f2c663db468427479eaa9e39dd912266ac2db6830d712351ffbc18737b208fd37f7ab5afdc2c9f6412d8d765973d6c72759bf51f864fc6bf1d
+DIST rocm-opencl-runtime-5.0.2.tar.gz 1004855 BLAKE2B e2c2beb987053204fbe8fda562ae65d6c1a58447e9e88bf1081aabeee6c9a10738fd8562114b564b647682438fdbd2c535db1008ac6e1cc4eb9a915998eeb3c7 SHA512 fa01d1fafc890181b9e67070353ee7c9100619494b7509cae1a3659f24ef1d00f650024cb24bdb0e6e7eacfdec1115e4683ec6f320228a19f41ae83321780780
+DIST rocm-tracer-5.0.2.tar.gz 474669 BLAKE2B b350111590140e1282338e4f134caf6228677c49361ceb9bc7ba0da8709346daa4fd014644c04adff0e903dba6014a84edd2eb3a5c132a8f91b479e4d5b085e5 SHA512 3fc1449cc9c9bf83e5233a7a0e83c0e3fa9da225d5ee4427b7d6fa15e3580497e1b9fbcd63892e4a99df01582aecd3ccfd66d2a19af2d8c25949ee705894ea44
diff --git a/dev-util/hip/files/hip-5.0.1-DisableTest.patch b/dev-util/hip/files/hip-5.0.1-DisableTest.patch
new file mode 100644
index 000000000000..d41b06efc8c9
--- /dev/null
+++ b/dev-util/hip/files/hip-5.0.1-DisableTest.patch
@@ -0,0 +1,32 @@
+Index: hipamd-rocm-5.0.1/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.0.1.orig/CMakeLists.txt
++++ hipamd-rocm-5.0.1/CMakeLists.txt
+@@ -503,27 +503,6 @@ endif()
+ if(NOT WIN32)
+ set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+-if(HIP_PLATFORM STREQUAL "nvidia")
+- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${HIP_ROOT_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-endif()
+-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_INCLUDE_DIR}/hip/" "${HIP_ROOT_DIR}/include/hip/" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_DIR}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-if(${RUN_HIT} EQUAL 0)
+- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_BIN_DIR}" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-endif()
+-if(HIP_CATCH_TEST EQUAL "1")
+- enable_testing()
+- set(HIP_PATH ${HIP_ROOT_DIR})
+- add_subdirectory(${HIP_COMMON_DIR}/tests/catch ${PROJECT_BINARY_DIR}/catch)
+-else()
+- if(${RUN_HIT} EQUAL 0)
+- set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
+- include(${HIP_COMMON_DIR}/tests/hit/HIT.cmake)
+- include(${HIP_COMMON_DIR}/tests/Tests.cmake)
+- else()
+- message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
+- endif()
+-endif()
+ endif()
+
+ #############################
diff --git a/dev-util/hip/files/hip-5.0.1-hip_vector_types.patch b/dev-util/hip/files/hip-5.0.1-hip_vector_types.patch
new file mode 100644
index 000000000000..7a1a79b2a936
--- /dev/null
+++ b/dev-util/hip/files/hip-5.0.1-hip_vector_types.patch
@@ -0,0 +1,11 @@
+mitigate compilation error
+--- a/include/hip/amd_detail/amd_hip_vector_types.h
++++ b/include/hip/amd_detail/amd_hip_vector_types.h
+@@ -45,6 +45,7 @@ THE SOFTWARE.
+
+ #if defined(__cplusplus)
+ #if !defined(__HIPCC_RTC__)
++ #include <new>
+ #include <array>
+ #include <iosfwd>
+ #include <type_traits>
diff --git a/dev-util/hip/hip-5.0.2.ebuild b/dev-util/hip/hip-5.0.2.ebuild
new file mode 100644
index 000000000000..a545153b1f54
--- /dev/null
+++ b/dev-util/hip/hip-5.0.2.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit cmake prefix
+
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
+SRC_URI="https://github.com/ROCm-Developer-Tools/hipamd/archive/rocm-${PV}.tar.gz -> rocm-hipamd-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz
+ https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz
+ profile? ( https://github.com/ROCm-Developer-Tools/roctracer/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/hipamd/files/8311148/hip_prof_str_diff.gz -> ${PV}-update-header.patch.gz
+ )"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug profile"
+
+DEPEND="
+ dev-util/rocminfo:${SLOT}
+ =sys-devel/llvm-roc-${PV}*[runtime]
+"
+RDEPEND="${DEPEND}
+ dev-perl/URI-Encode
+ dev-libs/roct-thunk-interface:${SLOT}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
+ "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
+ "${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
+ "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
+)
+
+S="${WORKDIR}/hipamd-rocm-${PV}"
+HIP_S="${WORKDIR}"/HIP-rocm-${PV}
+OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
+CLR_S="${WORKDIR}"/ROCclr-rocm-${PV}
+RTC_S="${WORKDIR}"/roctracer-rocm-${PV}
+
+src_prepare() {
+ cmake_src_prepare
+ use profile && eapply "${WORKDIR}/${PV}-update-header.patch"
+
+ eapply_user
+
+ # Use Gentoo slot number, otherwise git hash is attempted in vain.
+ sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
+
+ # disable PCH, because it results in a build error in ROCm 4.0.0
+ sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
+
+ # correctly find HIP_CLANG_INCLUDE_PATH using cmake
+ sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
+
+ # correct libs and cmake install dir
+ sed -e "/LIB_INSTALL_DIR/s:PREFIX}/lib:PREFIX}/$(get_libdir):" \
+ -e "/${HIP_COMMON_DIR}\/cmake DESTINATION/s: .): $(get_libdir)):" -i CMakeLists.txt || die
+ sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die
+
+ cd ${HIP_S} || die
+ # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
+ # which makes "stdlib.h" not found when using "#include_next" in header files;
+ sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+ -e "/rpath/s,--rpath=[^ ]*,," \
+ -i bin/hipcc.pl || die
+
+ # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
+ -i "${S}/hip-config.cmake.in" || die
+
+ einfo "prefixing hipcc and its utils..."
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${HIP_S}")
+
+ cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
+ sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
+ -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
+}
+
+src_configure() {
+ use debug && CMAKE_BUILD_TYPE="Debug"
+
+ # TODO: Currently a GENTOO configuration is build,
+ # this is also used in the cmake configuration files
+ # which will be installed to find HIP;
+ # Other ROCm packages expect a "RELEASE" configuration,
+ # see "hipBLAS"
+ local mycmakeargs=(
+ -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
+ -DCMAKE_BUILD_TYPE=${buildtype}
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DBUILD_HIPIFY_CLANG=OFF
+ -DHIP_PLATFORM=amd
+ -DHIP_COMPILER=clang
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API=$(usex profile 1 0)
+ -DPROF_API_HEADER_PATH="${RTC_S}"/inc/ext
+ -DROCCLR_PATH=${CLR_S}
+ -DHIP_COMMON_DIR=${HIP_S}
+ -DAMD_OPENCL_PATH=${OCL_S}
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+
+ cmake_src_install
+
+ rm "${ED}/usr/include/hip/hcc_detail" || die
+
+ # Don't install .hipInfo and .hipVersion to bin/lib
+ rm "${ED}/usr/lib/.hipInfo" "${ED}/usr/bin/.hipVersion" || die
+}