summaryrefslogtreecommitdiff
path: root/dev-util/hip
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-08-14 10:30:13 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-08-14 10:30:13 +0100
commit616579b5d773c50af31ee56f00105d96ce641ca2 (patch)
tree2ad4d3ba1429bd93a36ab99a2f5ec3490412115e /dev-util/hip
parent068424b26532f3551a81421a9be67ed206e5c11a (diff)
gentoo resync : 14.08.2021
Diffstat (limited to 'dev-util/hip')
-rw-r--r--dev-util/hip/Manifest8
-rw-r--r--dev-util/hip/files/hip-4.2.0-cancel-hcc-header-removal.patch18
-rw-r--r--dev-util/hip/files/hip-4.2.0-config-cmake-in.patch15
-rw-r--r--dev-util/hip/files/hipvars.pm7
-rw-r--r--dev-util/hip/hip-4.1.0-r1.ebuild2
-rw-r--r--dev-util/hip/hip-4.2.0.ebuild108
6 files changed, 153 insertions, 5 deletions
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 92533db71750..45f189f8a40a 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -5,11 +5,15 @@ AUX hip-3.9.0-DisableTest.patch 4560 BLAKE2B ef1bf5fcd19d8c1db722206afaf5bf8197e
AUX hip-3.9.0-add-include-directories.patch 468 BLAKE2B 4c787a6ffe0beada2ab431b2262edc51b814e57d599f783b884da84a6f1b919ceeab561ee09eccd54338ae55118e2d45133b248fd20b5163eba548d49f79d1ca SHA512 1fe35858c526c891e5efd9ecf7a166c3a67d7a4874ab6f7eb34c6ed6652d0e21a7290829a3a5063682a7229af3ef63c180e198172c3bc69be6550547806249e3
AUX hip-3.9.0-lpl_ca-add-include.patch 418 BLAKE2B 7d1439e51b1c5e20fcb1768c5f33b22d1d6bec5cf36242cbaf030a9a83bd404cb02c95d6ddba2ada6740bb2c1006da3c1507927ab561e29cd47f1a7e64aed1a4 SHA512 511684b5f0f70f67371e34674933dd4cf1992d11406a77a1aa695b68880a031812b8ba7e399abb61a84e8e07d8f814c93c412c51952d4c27443a01c3a62ce276
AUX hip-4.1.0-DisableTest.patch 2201 BLAKE2B 2e3ba78fe748312edad994d063c2a41e75ec988d8c04ca97bcec15b33cc8328e384b64e3be7bd43bbcb21b947db40a0e153b249921dab0f9e1ecc0926a16fd6d SHA512 8d98b0a53b7b10f7ce3e30ca969181aa01325da6f6627ab7e190e32fbfc6fc659ea07a0a7afe6f20732e7009b9a2da66d8788814d942dbbcdae3d5384c21b8da
-AUX hipvars.pm 518 BLAKE2B e7ad6fb282a0ec44b80a96feb0489ecc81e785c58b82a524e8f5c475f369575b86f3acb10af1c24cd47c2ac256a9d338887a2529c656c683595666189c2f83ea SHA512 bbcfbe35774c4ffaf6b527a6c39fd78cfa371b74e49bb6ddc2cb858b1be1616a308f1ab38abdeb8fd5af2545c99db30192e8595ee953d39b3eb65735d8b198b4
+AUX hip-4.2.0-cancel-hcc-header-removal.patch 820 BLAKE2B 544f93864fafe38a0ac2456f6301f8076ea24061bd4fe9a5501a366cca6d46edbb50eaac6c71acb3534579cdd9fa5518a687ac7e6d265926db53f0820fdec0f2 SHA512 3e37b761148cc31f78d6beb6bdff4b472fe4171a496b8f76ecbe82900f1483df690f846e0473ae700127482bcc3787af16bcd6217506e1e9dd1ad019408725a5
+AUX hip-4.2.0-config-cmake-in.patch 588 BLAKE2B 98081d4caa593756c966b8eff9e3a306ba4d9799abaaccb9bdab40db3e32dd769b07b3c428a22787231e8819e62cd50a33f549f2d1de32f9528036f1abf400cb SHA512 803aae515ee8e2694e5ba1cf6b5d66c98a9e0abf422479c7f599e8bfa38b027062a40e3e9806fa0057fa89a00d019c93d22f1c1ad78f68f1ac3f9bea5ebd93be
+AUX hipvars.pm 598 BLAKE2B 1645b12179195b95757d207248c85b7c8d9eda0347caee5cb48bdc66e85fda517f607bcb69cdfc63657a0db04ad8e96494a0a80268df7c17d6bb0e689325c2e8 SHA512 6c4e71455341673a329b4b0163fefd7f2f4b7d62da3496643d0de096755899c99b3b5a80fffbdf29896c234cb4f617b368217f4eecfd005849b294ff434b79c6
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
EBUILD hip-4.0.0-r1.ebuild 3817 BLAKE2B c01eb20493f27e9650d1cad3413b7fa14ef799d67e8b02de235d1e37a4f6633c8f0f6ea73fa8f075d0a10ffb2dbe0ccba4a65c4a505e665be7d657d5c773641a SHA512 2b5b58f13d832572f547f5ba4e67daf62b180523424e1e4605e96d1b7d834b700f8aebc95b047ab08ba36e16098aa07ddf7f9c91654672b00edc863bb5c25d68
EBUILD hip-4.0.0.ebuild 3451 BLAKE2B c219b26871ab9197ddd75a4d8e03bdb2d6f9c12cc9d8bd4b29e1babceb3572afb5f859288c395952befd8520fdf2875703566a4dd7280045f98f309af8c3756b SHA512 d7b82a954d9dfde559e48dcad266aa7d3cb204442045ea2c3eaeafa7513f0f549ca3a656d5d823e636600e3b9112fd276fbfb9e9ebac74f01024327de76276dd
-EBUILD hip-4.1.0-r1.ebuild 3199 BLAKE2B 2ed7d2494c9954b4fd49a89415650a3043432a9b73416d28a22a07cc7a837e57606c117e17441bd7e4435bf11b65d0ab3954e4c8c06f62ccb9f6c6d96fef6a4e SHA512 e93aff845bc3bd6c69ae527a0653b17420f3ab0aa72f13f25091386e324594dad87e7d511b3332f4d8692d81b296db8e77d79b1390f241927bcb5d7858758eef
+EBUILD hip-4.1.0-r1.ebuild 3366 BLAKE2B c8663bbba532bca211de1a8b8253e2df9544cc656ae47a0d8e651161f7e4186227b9cdc11e3b3b010bbb1d8a18ff36ece37d5a9ad4092ed496f3c9d1e7dc7791 SHA512 fc2145fad2fe1e5a28331a91959c591693cec497504344e6ae2587276d7b20e7895d94780273a0f83307efbb0e6099e0bdc1874bcefa2595590a736092502891
EBUILD hip-4.1.0.ebuild 3476 BLAKE2B 101bb84d3083388e6dc761dca7ccf0ef5393a44be7666831e83303d1dfbd50e81e3fa09d572f9c5cdf30c6fb738e0587bb9ddd0ccb0627bef543bd64648b66f0 SHA512 3af9dc2a5ab5735dfb0cd5341cfe1e99961858d40409ffb065231bea793b8faa3de3b305d28f2dce90e4535e0406f90a3f933b4cbab06933d83b04dd3e433023
+EBUILD hip-4.2.0.ebuild 3634 BLAKE2B 6ab4a5d74b08a2dd765bae85bb91fa7174cb0fbe411c7f4b741db6e49b47d42277e5bbba7e86637b8481a24d2eb0f53b7cb096d4dea09f0a6fc31538a4250fbe SHA512 ad8e4ba2df35b36f96047bdf40e0f7420256eedaa9432249d3d6d184ccfb2d0acbec7d679dfbef8fd278dd6d748334de927a50e7c00f35ce4823af2297d14b5b
MISC metadata.xml 596 BLAKE2B 32b0fcf237a501e546584504ead6f5cc817f5f7891715df60d9e6a8863a87d779f6ccdb365536338440b3bdeb1f541dc481f2a29c014506519f6c62f9834ef0d SHA512 b67b87b25453471fe1337c78095341c00fe6e76a4d222390cb47d1b52226f7ebdf23c1f66f5926819a384ac1473cb1d6f22f5467ec1c600a5a96eef5e24fe1d2
diff --git a/dev-util/hip/files/hip-4.2.0-cancel-hcc-header-removal.patch b/dev-util/hip/files/hip-4.2.0-cancel-hcc-header-removal.patch
new file mode 100644
index 000000000000..08e0f3a3d4e3
--- /dev/null
+++ b/dev-util/hip/files/hip-4.2.0-cancel-hcc-header-removal.patch
@@ -0,0 +1,18 @@
+hcc now deprecated by ROCm upstream. They use cmake to delete hcc headers for upgrating hip on other distros,
+but Gentoo don't need this and the following code causes sandbox violation (#799257).
+
+github.com/ROCm-Developer-Tools/HIP/commit/c2adc70d4df3d30ef0db84d47be14b99b01aa340 introduce these lines.
+
+--- orig/CMakeLists.txt
++++ HIP-rocm-4.2.0/CMakeLists.txt
+@@ -333,10 +333,6 @@ if(NOT ${INSTALL_SOURCE} EQUAL 0)
+ endif()
+ install(DIRECTORY bin DESTINATION . USE_SOURCE_PERMISSIONS)
+
+- # The following two lines will be removed after upstream updation
+- install(CODE "MESSAGE(\"Removing ${CMAKE_INSTALL_PREFIX}/include\")")
+- install(CODE "file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/include)")
+-
+ install(DIRECTORY include DESTINATION .)
+ install(DIRECTORY cmake DESTINATION .)
+ endif()
diff --git a/dev-util/hip/files/hip-4.2.0-config-cmake-in.patch b/dev-util/hip/files/hip-4.2.0-config-cmake-in.patch
new file mode 100644
index 000000000000..12644828af78
--- /dev/null
+++ b/dev-util/hip/files/hip-4.2.0-config-cmake-in.patch
@@ -0,0 +1,15 @@
+since _IMPORT_PREFIX=/opt/gentoo/usr/lib/hip, INTERFACE_INCLUDE_DIRECTORIES should change
+
+--- orig/hip-config.cmake.in
++++ HIP-rocm-4.2.0/hip-config.cmake.in
+@@ -185,8 +185,8 @@ if(HIP_RUNTIME MATCHES "rocclr")
+
+ if(NOT WIN32)
+ set_target_properties(hip::device PROPERTIES
+- INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
+- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
++ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
++ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
+ )
+ endif()
+ endif()
diff --git a/dev-util/hip/files/hipvars.pm b/dev-util/hip/files/hipvars.pm
index 3f5c88409e0a..4c614080a119 100644
--- a/dev-util/hip/files/hipvars.pm
+++ b/dev-util/hip/files/hipvars.pm
@@ -1,9 +1,10 @@
#!/usr/bin/perl -w
package hipvars;
-$HIP_BASE_VERSION_MAJOR = "4";
-$HIP_BASE_VERSION_MINOR = "1";
+$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@";
+$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@";
+$isWindows = 0;
$HIP_PATH='/usr/lib/hip';
$ROCM_PATH='/usr';
$CUDA_PATH='/opt/cuda';
@@ -15,5 +16,5 @@ $HIP_COMPILER = "clang";
$HIP_RUNTIME = "rocclr";
$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR;
$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR;
-$HIP_VERSION_PATCH = "0";
+$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@";
$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
diff --git a/dev-util/hip/hip-4.1.0-r1.ebuild b/dev-util/hip/hip-4.1.0-r1.ebuild
index 827305877f9f..15d5bfcd3e35 100644
--- a/dev-util/hip/hip-4.1.0-r1.ebuild
+++ b/dev-util/hip/hip-4.1.0-r1.ebuild
@@ -59,6 +59,8 @@ src_prepare() {
hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${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() {
diff --git a/dev-util/hip/hip-4.2.0.ebuild b/dev-util/hip/hip-4.2.0.ebuild
new file mode 100644
index 000000000000..20017c515343
--- /dev/null
+++ b/dev-util/hip/hip-4.2.0.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit cmake flag-o-matic prefix
+
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
+SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug profile"
+
+# Don't strip to prevent some tests from failing.
+RESTRICT="strip"
+
+DEPEND="dev-libs/rocclr:${SLOT}
+ dev-util/rocminfo:${SLOT}
+ =sys-devel/llvm-roc-${PV}*[runtime]
+ profile? ( dev-util/roctracer:${SLOT} )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
+ "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
+ "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
+ "${FILESDIR}/${PN}-3.5.1-hip_vector_types.patch"
+ "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
+)
+
+S="${WORKDIR}/HIP-rocm-${PV}"
+
+src_prepare() {
+ cmake_src_prepare
+ 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
+
+ # remove forcing set USE_PROF_API to 1
+ sed -e '/set(USE_PROF_API "1")/d' -i rocclr/CMakeLists.txt || die
+
+ # "hcc" is deprecated and not installed, new platform is "rocclr";
+ # 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 || 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
+
+ # 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}")
+
+ 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() {
+ strip-flags
+ 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/lib/hip"
+ -DBUILD_HIPIFY_CLANG=OFF
+ -DHIP_PLATFORM=rocclr
+ -DHIP_COMPILER=clang
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DHSA_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API=$(usex profile 1 0)
+ -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext
+ -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
+ echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
+ echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
+
+ doenvd 99hip
+
+ cmake_src_install
+
+ rm "${ED}/usr/lib/hip/include/hip/hcc_detail" || die
+}