public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2020-12-27  1:55 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2020-12-27  1:55 UTC (permalink / raw
  To: gentoo-commits

commit:     36781efd38eb25f8e0d4643af2c44029f61f702c
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 23 17:06:47 2020 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 01:55:26 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36781efd

dev-util/hip: C++ Heterogeneous-Compute Interface for Portability.

This ebuild is adopted from that of https://github.com/justxi/rocm.

1. change hip location from /usr/lib/hip/<ver> to /usr/lib/hip. We do
   not have plans to support multiple hip versions at once.

2. turn the hipify function off as it does not work.  We will
   re-enable it as a USE flag when possible.

3. properly prefixify the source code making use of hprefixify().

4. migrate from cmake-utils to cmake eclass.

Closes: https://github.com/gentoo/gentoo/pull/18787
Suggested-by: Wilfried Holzke <gentoo <AT> holzke.net>
Suggested-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Package-Manager: Portage-3.0.12, Repoman-3.0.1
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 dev-util/hip/Manifest                              |   1 +
 dev-util/hip/files/hip-3.5.1-config-cmake-in.patch |  28 ++++++
 ...p-3.5.1-detect_offload-arch_for_clang-roc.patch |  21 ++++
 .../hip/files/hip-3.5.1-hip_vector_types.patch     |  10 ++
 dev-util/hip/files/hip-3.9.0-DisableTest.patch     |  87 +++++++++++++++++
 .../files/hip-3.9.0-add-include-directories.patch  |  13 +++
 .../hip/files/hip-3.9.0-lpl_ca-add-include.patch   |  10 ++
 dev-util/hip/hip-4.0.0.ebuild                      | 107 +++++++++++++++++++++
 dev-util/hip/metadata.xml                          |  19 ++++
 9 files changed, 296 insertions(+)

diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
new file mode 100644
index 00000000000..5081a96f35a
--- /dev/null
+++ b/dev-util/hip/Manifest
@@ -0,0 +1 @@
+DIST rocm-hip-4.0.0.tar.gz 1012154 BLAKE2B 02343239a5b27c42dafd241f2c9b6f5195c50f78bfd717ae72bcb16d384bd6cf97ff6f2b86bfcf323aaaf022d6897f46d0987826c80d6f6279be4cb4792e15be SHA512 cf840dbe28a9a15e3be14351bfa22d3c81e1654813a7aee55f53e71b2ee183f8dd0de14a79791617fabb5b357cadbf2ce2f476f78884b2843d30f206d65088f6

diff --git a/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch b/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch
new file mode 100644
index 00000000000..f3b5ac9c19e
--- /dev/null
+++ b/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch
@@ -0,0 +1,28 @@
+--- a/hip-config.cmake.in	2020-06-21 21:17:35.576297760 +0200
++++ b/hip-config.cmake.in	2020-06-21 21:17:59.861296628 +0200
+@@ -123,8 +123,10 @@
+   )
+   set_target_properties(hip::device PROPERTIES
+     INTERFACE_COMPILE_DEFINITIONS "__HIP_ROCclr__=1"
+-    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"
++#    INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
++#    INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
+   )
+ else()
+   set_target_properties(hip::hip_hcc_static PROPERTIES
+@@ -156,9 +158,9 @@
+     INTERFACE_LINK_LIBRARIES --hip-device-lib-path=${AMD_DEVICE_LIBS_PREFIX}/lib --hip-link
+   )
+ 
+-  set_property(TARGET hip::device APPEND PROPERTY
+-    INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
+-  )
++#  set_property(TARGET hip::device APPEND PROPERTY
++#    INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
++#  )
+ 
+   set_property(TARGET hip::device APPEND PROPERTY
+     INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."

diff --git a/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch b/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch
new file mode 100644
index 00000000000..7997e292966
--- /dev/null
+++ b/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch
@@ -0,0 +1,21 @@
+diff -uprN HIP-rocm-3.5.1/bin/hipcc patched/bin/hipcc
+--- HIP-rocm-3.5.1/bin/hipcc	2020-07-21 14:29:11.625878447 +0800
++++ patched/bin/hipcc	2020-07-21 14:34:11.454395203 +0800
+@@ -675,7 +675,7 @@ foreach $arg (@ARGV)
+     $prevArg = $arg;
+ }
+ 
+-if($HIP_PLATFORM eq "hcc"){
++if($HIP_PLATFORM eq "hcc" || $HIP_PLATFORM eq "rocclr"){
+     # No AMDGPU target specified at commandline. So look for HCC_AMDGPU_TARGET
+     if($default_amdgpu_target eq 1) {
+         if (defined $ENV{HCC_AMDGPU_TARGET}) {
+@@ -694,6 +694,8 @@ if($HIP_PLATFORM eq "hcc"){
+ 
+     if($HIP_COMPILER eq "hcc") {
+         $GPU_ARCH_OPT = " --amdgpu-target=";
++    } elsif($HIP_COMPILER eq "clang") {
++        $GPU_ARCH_OPT = " --offload-arch=";
+     } else {
+         $GPU_ARCH_OPT = " --cuda-gpu-arch=";
+     }

diff --git a/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch b/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch
new file mode 100644
index 00000000000..382ed52f692
--- /dev/null
+++ b/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch
@@ -0,0 +1,10 @@
+--- a/include/hip/hcc_detail/hip_vector_types.h
++++ b/include/hip/hcc_detail/hip_vector_types.h
+@@ -42,6 +42,7 @@
+     #endif
+ 
+ #if defined(__cplusplus)
++    #include <new>
+     #include <array>
+     #include <iosfwd>
+     #include <type_traits>

diff --git a/dev-util/hip/files/hip-3.9.0-DisableTest.patch b/dev-util/hip/files/hip-3.9.0-DisableTest.patch
new file mode 100644
index 00000000000..3fc787a7354
--- /dev/null
+++ b/dev-util/hip/files/hip-3.9.0-DisableTest.patch
@@ -0,0 +1,87 @@
+--- a/CMakeLists.txt	2020-11-15 11:26:09.747793881 +0100
++++ b/CMakeLists.txt	2020-11-15 11:28:45.289793287 +0100
+@@ -676,45 +676,45 @@
+ # Target: test
+ set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+-if(HIP_PLATFORM STREQUAL "nvcc")
+-	execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-endif()
+-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/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_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-endif()
+-if(${RUN_HIT} EQUAL 0)
+-    set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
+-    include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
+-
+-    # Add tests
+-    include_directories(${HIP_SRC_PATH}/tests/src)
+-    hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/src "directed_tests")
+-
+-    # Add unit tests
+-    include_directories(${HIP_SRC_PATH}/tests/unit)
+-    hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/unit "unit_tests")
+-
+-    # Add performance tests
+-    include_directories(${HIP_SRC_PATH}/tests/performance)
+-    hit_add_directory_recursive(${HIP_CTEST_CONFIG_PERFORMANCE} ${HIP_SRC_PATH}/tests/performance "performance_tests")
+-
+-    # Add top-level tests to build_tests
+-    add_custom_target(build_tests DEPENDS directed_tests unit_tests)
+-
+-    # Add top-level tests to build performance_tests.
+-    # To build performance tests, just run "make build_perf"
+-    add_custom_target(build_perf DEPENDS performance_tests)
+-
+-    # Add custom target: perf.
+-    # To run performance tests, just run "make perf"
+-    add_custom_target(perf COMMAND "${CMAKE_CTEST_COMMAND}" -C "${HIP_CTEST_CONFIG_PERFORMANCE}" -R "performance_tests/" --verbose)
+-
+-    # Add custom target: check
+-    add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests)
+-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()
++#if(HIP_PLATFORM STREQUAL "nvcc")
++#	execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
++#endif()
++#execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/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_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
++#endif()
++#if(${RUN_HIT} EQUAL 0)
++#    set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
++#    include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
++#
++#   # Add tests
++#    include_directories(${HIP_SRC_PATH}/tests/src)
++#    hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/src "directed_tests")
++#
++#    # Add unit tests
++#    include_directories(${HIP_SRC_PATH}/tests/unit)
++#    hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/unit "unit_tests")
++#
++#    # Add performance tests
++#    include_directories(${HIP_SRC_PATH}/tests/performance)
++#    hit_add_directory_recursive(${HIP_CTEST_CONFIG_PERFORMANCE} ${HIP_SRC_PATH}/tests/performance "performance_tests")
++#
++#    # Add top-level tests to build_tests
++#    add_custom_target(build_tests DEPENDS directed_tests unit_tests)
++#
++#    # Add top-level tests to build performance_tests.
++#    # To build performance tests, just run "make build_perf"
++#    add_custom_target(build_perf DEPENDS performance_tests)
++#
++#    # Add custom target: perf.
++#    # To run performance tests, just run "make perf"
++#    add_custom_target(perf COMMAND "${CMAKE_CTEST_COMMAND}" -C "${HIP_CTEST_CONFIG_PERFORMANCE}" -R "performance_tests/" --verbose)
++#
++#    # Add custom target: check
++#    add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests)
++#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()
+ 
+ #############################
+ # Code analysis

diff --git a/dev-util/hip/files/hip-3.9.0-add-include-directories.patch b/dev-util/hip/files/hip-3.9.0-add-include-directories.patch
new file mode 100644
index 00000000000..42bd9736ee2
--- /dev/null
+++ b/dev-util/hip/files/hip-3.9.0-add-include-directories.patch
@@ -0,0 +1,13 @@
+--- a/rocclr/CMakeLists.txt	2020-08-23 11:45:13.148817894 +0200
++++ b/rocclr/CMakeLists.txt	2020-08-23 11:50:12.409816752 +0200
+@@ -139,6 +139,10 @@
+   target_compile_definitions(hip64
+     PRIVATE
+       $<TARGET_PROPERTY:amdrocclr_static,INTERFACE_COMPILE_DEFINITIONS>)
++
++  include_directories(/usr/include/rocclr)
++  include_directories(/usr/include/rocclr/elf)
++  include_directories(/usr/include/rocclr/compiler/lib/include/)
+ endif()
+ 
+  # Enable profiling API

diff --git a/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch b/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch
new file mode 100644
index 00000000000..bebe6f0f4ec
--- /dev/null
+++ b/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch
@@ -0,0 +1,10 @@
+--- a/lpl_ca/CMakeLists.txt	2020-11-15 11:47:55.091788901 +0100
++++ b/lpl_ca/CMakeLists.txt	2020-11-15 11:49:14.881788597 +0100
+@@ -17,6 +17,7 @@
+     ${PROJECT_SOURCE_DIR}/src
+   PRIVATE
+     $<TARGET_PROPERTY:amdrocclr_static,INTERFACE_INCLUDE_DIRECTORIES>)
++target_include_directories(lpl SYSTEM PUBLIC /usr/include/rocclr/elf)
+ 
+ target_compile_options(lpl PUBLIC -Wall)
+ target_link_libraries(lpl PUBLIC pthread)

diff --git a/dev-util/hip/hip-4.0.0.ebuild b/dev-util/hip/hip-4.0.0.ebuild
new file mode 100644
index 00000000000..ae96dbdc84e
--- /dev/null
+++ b/dev-util/hip/hip-4.0.0.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2020 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-$(ver_cut 1-2)
+	>=dev-util/rocminfo-$(ver_cut 1-2)
+	=sys-devel/llvm-roc-${PV}*[runtime]"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-3.9.0-DisableTest.patch"
+	"${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
+	"${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch"
+	"${FILESDIR}/${PN}-3.5.1-hip_vector_types.patch"
+	"${FILESDIR}/${PN}-3.5.1-detect_offload-arch_for_clang-roc.patch"
+	"${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch"
+)
+
+S="${WORKDIR}/HIP-rocm-${PV}"
+
+src_prepare() {
+	cmake_src_prepare
+	eapply_user
+
+	# 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 "${S}/CMakeLists.txt" || die
+
+	# "hcc" is deprecated and not installed, new platform is "rocclr";
+	# Due to setting HAS_PATH to "/usr", this results in setting "-isystem /usr/include"
+	# which results in a e.g. "stdlib.h" not found when using "#include_next" in header files;
+	sed -e "s:\$HIP_PLATFORM eq \"hcc\" and \$HIP_COMPILER eq \"clang\":\$HIP_PLATFORM eq \"rocclr\" and \$HIP_COMPILER eq \"clang\":" \
+		-e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
+		-e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+		-i bin/hipcc || 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}")
+}
+
+src_configure() {
+	strip-flags
+	if ! use debug; then
+		append-cflags "-DNDEBUG"
+		append-cxxflags "-DNDEBUG"
+		buildtype="Release"
+	else
+		buildtype="Debug"
+	fi
+
+	# 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_RUNTIME=ROCclr
+		-DHIP_COMPILER=clang
+		-DROCM_PATH="${EPREFIX}/usr"
+		-DHSA_PATH="${EPREFIX}/usr"
+		-DUSE_PROF_API=$(usex profile 1 0)
+		-DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
+	)
+
+	cmake_src_configure
+}
+
+src_install() {
+	echo "HSA_PATH=${EPREFIX}/usr" > 99hip || die
+	echo "ROCM_PATH=${EPREFIX}/usr" >> 99hip || die
+	echo "HIP_PLATFORM=rocclr" >> 99hip || die
+	echo "HIP_RUNTIME=ROCclr" >> 99hip || die
+	echo "HIP_COMPILER=clang" >> 99hip || die
+	echo "HIP_CLANG_PATH=${EPREFIX}/usr/lib/llvm/roc/bin" >> 99hip || die
+
+	echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
+	echo "HIP_PATH=${EPREFIX}/usr/lib/hip" >> 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
+}

diff --git a/dev-util/hip/metadata.xml b/dev-util/hip/metadata.xml
new file mode 100644
index 00000000000..db491e13a34
--- /dev/null
+++ b/dev-util/hip/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="project">
+    <email>sci@gentoo.org</email>
+    <name>Gentoo Science Project</name>
+  </maintainer>
+  <maintainer type="person">
+    <email>candrews@gentoo.org</email>
+    <name>Craig Andrews</name>
+  </maintainer>
+  <maintainer type="person">
+    <email>gentoo@holzke.net</email>
+    <name>Wilfried Holzke</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">ROCm-Developer-Tools/HIP</remote-id>
+  </upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2021-04-11 15:17 Craig Andrews
  0 siblings, 0 replies; 15+ messages in thread
From: Craig Andrews @ 2021-04-11 15:17 UTC (permalink / raw
  To: gentoo-commits

commit:     ccb5830fe290c0fd8ae43546d188068cf4f60e91
Author:     Wilfried Holzke <gentoo <AT> holzke <DOT> net>
AuthorDate: Fri Apr  2 09:47:49 2021 +0000
Commit:     Craig Andrews <candrews <AT> gentoo <DOT> org>
CommitDate: Sun Apr 11 15:17:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccb5830f

dev-util/hip: Version bump to 4.1.0

Signed-off-by: Wilfried Holzke <gentoo <AT> holzke.net>
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Closes: https://github.com/gentoo/gentoo/pull/20228
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>

 dev-util/hip/Manifest                          |   1 +
 dev-util/hip/files/hip-4.1.0-DisableTest.patch |  37 ++++++++
 dev-util/hip/hip-4.1.0.ebuild                  | 114 +++++++++++++++++++++++++
 3 files changed, 152 insertions(+)

diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 5081a96f35a..fb6e7126f26 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1 +1,2 @@
 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

diff --git a/dev-util/hip/files/hip-4.1.0-DisableTest.patch b/dev-util/hip/files/hip-4.1.0-DisableTest.patch
new file mode 100644
index 00000000000..49e7171b2f0
--- /dev/null
+++ b/dev-util/hip/files/hip-4.1.0-DisableTest.patch
@@ -0,0 +1,37 @@
+--- a/CMakeLists.txt	2021-03-28 18:02:34.755857717 +0200
++++ b/CMakeLists.txt	2021-03-28 18:04:54.217854203 +0200
+@@ -474,20 +474,20 @@
+ #############################
+ 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_SRC_PATH}/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_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-endif()
+-if(${RUN_HIT} EQUAL 0)
+-    set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
+-    include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
+-    include(${HIP_SRC_PATH}/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()
++#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_SRC_PATH}/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_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
++#endif()
++#if(${RUN_HIT} EQUAL 0)
++#    set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
++#    include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
++#    include(${HIP_SRC_PATH}/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()
+ 
+ #############################
+ # Code analysis

diff --git a/dev-util/hip/hip-4.1.0.ebuild b/dev-util/hip/hip-4.1.0.ebuild
new file mode 100644
index 00000000000..e6e6a374a78
--- /dev/null
+++ b/dev-util/hip/hip-4.1.0.ebuild
@@ -0,0 +1,114 @@
+# 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-$(ver_cut 1-2)
+	>=dev-util/rocminfo-$(ver_cut 1-2)
+	=sys-devel/llvm-roc-${PV}*[runtime]"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
+	"${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
+	"${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch"
+	"${FILESDIR}/${PN}-3.5.1-hip_vector_types.patch"
+	"${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch"
+)
+
+S="${WORKDIR}/HIP-rocm-${PV}"
+
+src_prepare() {
+	cmake_src_prepare
+	eapply_user
+
+	# Use Gentoo version number, otherwise git hash is attempted in vain.
+	sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${PVR})" -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 "${S}/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 "/HIP_PLATFORM.*HIP_COMPILER.*clang/s:hcc:rocclr:" \
+		-e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
+		-e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+		-i bin/hipcc || die
+
+	# replace hcc remnants with modern rocclr.
+	sed -e "/HIP_PLATFORM.*STREQUAL/s:hcc:rocclr:" -i cmake/FindHIP/run_hipcc.cmake || 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}")
+}
+
+src_configure() {
+	strip-flags
+	if ! use debug; then
+		append-cflags "-DNDEBUG"
+		append-cxxflags "-DNDEBUG"
+		buildtype="Release"
+	else
+		buildtype="Debug"
+	fi
+
+	# 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)
+		-DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
+	)
+
+	cmake_src_configure
+}
+
+src_install() {
+	echo "HSA_PATH=${EPREFIX}/usr" > 99hip || die
+	echo "ROCM_PATH=${EPREFIX}/usr" >> 99hip || die
+	echo "HIP_PLATFORM=amd" >> 99hip || die
+	echo "HIP_RUNTIME=rocclr" >> 99hip || die
+	echo "HIP_COMPILER=clang" >> 99hip || die
+	echo "HIP_CLANG_PATH=${EPREFIX}/usr/lib/llvm/roc/bin" >> 99hip || die
+
+	echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
+	echo "HIP_PATH=${EPREFIX}/usr/lib/hip" >> 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
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2021-08-03  6:32 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2021-08-03  6:32 UTC (permalink / raw
  To: gentoo-commits

commit:     2ed748a3b6412f99bc249e089e9221e38417a8f8
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  3 06:32:04 2021 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Aug  3 06:32:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ed748a3

dev-util/hip: remove environment variable dependencies.

ROCm upstream allows for overriding HIP_PATH, ROCM_PATH, CUDA_PATH,
HSA_PATH, HIP_CLANG_PATH, HIP_ROCCLR_HOME, HIP_PLATFORM, HIP_COMPILER,
HIP_RUNTIME for flexibility, at the cost of having to set a handful
environmental variables each time before invoking hipcc.

If any of the environmental variables is not set correctly, hipvars.pm
or hipcc may take wrong guesses and refuses to work.

For Gentoo, all the of variables are predictable and determined at
build time.  It is more straightforward and transparent to hardcode
them in the perl script.

Bug: https://github.com/ROCm-Developer-Tools/HIP/issues/2224
Bug: https://github.com/ROCm-Developer-Tools/HIP/issues/2256
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 dev-util/hip/files/hipvars.pm    |  19 ++++++++
 dev-util/hip/hip-4.1.0-r1.ebuild | 103 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)

diff --git a/dev-util/hip/files/hipvars.pm b/dev-util/hip/files/hipvars.pm
new file mode 100644
index 00000000000..3f5c88409e0
--- /dev/null
+++ b/dev-util/hip/files/hipvars.pm
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+package hipvars;
+
+$HIP_BASE_VERSION_MAJOR = "4";
+$HIP_BASE_VERSION_MINOR = "1";
+
+$HIP_PATH='/usr/lib/hip';
+$ROCM_PATH='/usr';
+$CUDA_PATH='/opt/cuda';
+$HSA_PATH='/usr';
+$HIP_CLANG_PATH='/usr/lib/llvm/roc/bin';
+$HIP_ROCCLR_HOME=$HIP_PATH;
+$HIP_PLATFORM='amd';
+$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="$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
new file mode 100644
index 00000000000..ff12517ad83
--- /dev/null
+++ b/dev-util/hip/hip-4.1.0-r1.ebuild
@@ -0,0 +1,103 @@
+# 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-$(ver_cut 1-2)
+	>=dev-util/rocminfo-$(ver_cut 1-2)
+	=sys-devel/llvm-roc-${PV}*[runtime]"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
+	"${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
+	"${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch"
+	"${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch"
+)
+
+S="${WORKDIR}/HIP-rocm-${PV}"
+
+src_prepare() {
+	cmake_src_prepare
+	eapply_user
+
+	# Use Gentoo version number, otherwise git hash is attempted in vain.
+	sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${PVR})" -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
+
+	# "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':" \
+		-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 "${FILESDIR}"/hipvars.pm bin/ || die "failed to replace hipvars.pm"
+}
+
+src_configure() {
+	strip-flags
+	if ! use debug; then
+		append-cflags "-DNDEBUG"
+		append-cxxflags "-DNDEBUG"
+		buildtype="Release"
+	else
+		buildtype="Debug"
+	fi
+
+	# 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)
+		-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
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2021-08-13  5:08 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2021-08-13  5:08 UTC (permalink / raw
  To: gentoo-commits

commit:     7f9224da75c864396af5693c2e5b3dbbd0f529c1
Author:     YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Thu Jul 15 15:19:15 2021 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Aug 13 05:08:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f9224da

dev-util/hip: bump version to 4.2.0

Update hip-3.5.1-config-cmake-in.patch to 4.2.0
lpl_ca removed, so hip-3.9.0-lpl_ca-add-include.patch not used
fill version into hipvars.pm at src_prepare
fix sandbox violation issue
remove linker flag -rpath in hipcc
correct profiling api header location and profile use flag settings

Closes: https://bugs.gentoo.org/799257
Closes: https://github.com/gentoo/gentoo/pull/21655

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 dev-util/hip/Manifest                              |  1 +
 .../hip-4.2.0-cancel-hcc-header-removal.patch      | 18 ++++++++++++++++
 dev-util/hip/files/hip-4.2.0-config-cmake-in.patch | 15 +++++++++++++
 dev-util/hip/files/hipvars.pm                      |  7 +++---
 dev-util/hip/hip-4.1.0-r1.ebuild                   |  2 ++
 .../hip/{hip-4.1.0-r1.ebuild => hip-4.2.0.ebuild}  | 25 +++++++++++++---------
 6 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index fb6e7126f26..272ac83deb9 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,2 +1,3 @@
 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

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 00000000000..08e0f3a3d4e
--- /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 00000000000..12644828af7
--- /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 3f5c88409e0..4c614080a11 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 827305877f9..15d5bfcd3e3 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.1.0-r1.ebuild b/dev-util/hip/hip-4.2.0.ebuild
similarity index 80%
copy from dev-util/hip/hip-4.1.0-r1.ebuild
copy to dev-util/hip/hip-4.2.0.ebuild
index 827305877f9..20017c51534 100644
--- a/dev-util/hip/hip-4.1.0-r1.ebuild
+++ b/dev-util/hip/hip-4.2.0.ebuild
@@ -19,14 +19,16 @@ RESTRICT="strip"
 
 DEPEND="dev-libs/rocclr:${SLOT}
 	dev-util/rocminfo:${SLOT}
-	=sys-devel/llvm-roc-${PV}*[runtime]"
+	=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}-3.5.1-config-cmake-in.patch"
-	"${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.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}"
@@ -41,11 +43,15 @@ src_prepare() {
 	# 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
@@ -59,17 +65,13 @@ 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() {
 	strip-flags
-	if ! use debug; then
-		append-cflags "-DNDEBUG"
-		append-cxxflags "-DNDEBUG"
-		buildtype="Release"
-	else
-		buildtype="Debug"
-	fi
+	use debug && CMAKE_BUILD_TYPE="Debug"
 
 	# TODO: Currently a GENTOO configuration is build,
 	# this is also used in the cmake configuration files
@@ -86,6 +88,7 @@ src_configure() {
 		-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
 	)
 
@@ -100,4 +103,6 @@ src_install() {
 	doenvd 99hip
 
 	cmake_src_install
+
+	rm "${ED}/usr/lib/hip/include/hip/hcc_detail" || die
 }


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2021-08-26 12:39 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2021-08-26 12:39 UTC (permalink / raw
  To: gentoo-commits

commit:     e482882d725cf6203e097f79388e6e76dd15b65b
Author:     YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Thu Aug 19 14:33:19 2021 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Aug 26 12:38:59 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e482882d

dev-util/hip: bump to version 4.3.0

Add a missing header file amdocl/cl_vk_amd.hpp from
rocm-opencl-runtime, to resolve compilation error.

Reference: https://github.com/ROCm-Developer-Tools/HIP/issues/2317
Bug: https://github.com/gentoo/gentoo/pull/22035
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 dev-util/hip/Manifest                              |   2 +
 .../hip/files/hip-4.3.0-hip_vector_types.patch     |  11 +++
 dev-util/hip/hip-4.3.0.ebuild                      | 107 +++++++++++++++++++++
 3 files changed, 120 insertions(+)

diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 272ac83deb9..a8db3b5914b 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,3 +1,5 @@
 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-opencl-runtime-4.3.0.tar.gz 1006792 BLAKE2B 29fd5843bb0153c7d3fe5250898f0fbdd089db6304122698c9ec9a5436e3a6845916f241f1a1e79a614e369f000297ac12413620edec0660d859ccddaa978d07 SHA512 a514d626700350f2c663db468427479eaa9e39dd912266ac2db6830d712351ffbc18737b208fd37f7ab5afdc2c9f6412d8d765973d6c72759bf51f864fc6bf1d

diff --git a/dev-util/hip/files/hip-4.3.0-hip_vector_types.patch b/dev-util/hip/files/hip-4.3.0-hip_vector_types.patch
new file mode 100644
index 00000000000..faad9629740
--- /dev/null
+++ b/dev-util/hip/files/hip-4.3.0-hip_vector_types.patch
@@ -0,0 +1,11 @@
+mitigate compilation error
+--- a/include/hip/amd_detail/hip_vector_types.h
++++ b/include/hip/amd_detail/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-4.3.0.ebuild b/dev-util/hip/hip-4.3.0.ebuild
new file mode 100644
index 00000000000..7e522e9fb0e
--- /dev/null
+++ b/dev-util/hip/hip-4.3.0.ebuild
@@ -0,0 +1,107 @@
+# 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
+	https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug profile"
+
+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}-4.3.0-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
+
+	cp -a "${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}/amdocl/cl_vk_amd.hpp amdocl/ || 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/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
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2022-06-13 12:00 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2022-06-13 12:00 UTC (permalink / raw
  To: gentoo-commits

commit:     d5835abbe66be09b9851fcc79a158d1a083ad8fc
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Sun Jun 12 11:55:29 2022 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 12:00:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5835abb

dev-util/hip-5.0.2: fix HIP_PATH in hipvars.pm

Reference: https://github.com/gentoo/gentoo/pull/25536#issuecomment-1153136503
Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1152988796
Closes: https://github.com/gentoo/gentoo/pull/25861
Suggested-by: Paul Preney <paul <AT> preney.ca>
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 dev-util/hip/files/hipvars-5.0.2.pm                  | 20 ++++++++++++++++++++
 .../hip/{hip-5.0.2.ebuild => hip-5.0.2-r1.ebuild}    |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/dev-util/hip/files/hipvars-5.0.2.pm b/dev-util/hip/files/hipvars-5.0.2.pm
new file mode 100644
index 000000000000..88d3c27bab99
--- /dev/null
+++ b/dev-util/hip/files/hipvars-5.0.2.pm
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+package hipvars;
+
+$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@";
+$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@";
+
+$isWindows = 0;
+$HIP_PATH='/usr';
+$ROCM_PATH='/usr';
+$CUDA_PATH='/opt/cuda';
+$HSA_PATH='/usr';
+$HIP_CLANG_PATH='/usr/lib/llvm/roc/bin';
+$HIP_ROCCLR_HOME=$HIP_PATH;
+$HIP_PLATFORM='amd';
+$HIP_COMPILER = "clang";
+$HIP_RUNTIME = "rocclr";
+$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR;
+$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR;
+$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@";
+$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";

diff --git a/dev-util/hip/hip-5.0.2.ebuild b/dev-util/hip/hip-5.0.2-r1.ebuild
similarity index 97%
rename from dev-util/hip/hip-5.0.2.ebuild
rename to dev-util/hip/hip-5.0.2-r1.ebuild
index e3438bc87ea4..771cda985e88 100644
--- a/dev-util/hip/hip-5.0.2.ebuild
+++ b/dev-util/hip/hip-5.0.2-r1.ebuild
@@ -79,7 +79,7 @@ src_prepare() {
 	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"
+	cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.0.2.pm)" bin/hipvars.pm || 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
 }


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2022-06-22 13:03 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2022-06-22 13:03 UTC (permalink / raw
  To: gentoo-commits

commit:     93ff73188c29fe12088f6166df669847cde9b2b4
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Wed Jun 22 11:39:27 2022 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Wed Jun 22 13:00:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93ff7318

dev-util/hip: fix build failure when git not installed

Closes: https://bugs.gentoo.org/853718
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 dev-util/hip/files/hip-5.0.2-set-build-id.patch | 20 ++++++++++++++++++++
 dev-util/hip/hip-5.0.2-r2.ebuild                |  1 +
 2 files changed, 21 insertions(+)

diff --git a/dev-util/hip/files/hip-5.0.2-set-build-id.patch b/dev-util/hip/files/hip-5.0.2-set-build-id.patch
new file mode 100644
index 000000000000..21dfadf18b61
--- /dev/null
+++ b/dev-util/hip/files/hip-5.0.2-set-build-id.patch
@@ -0,0 +1,20 @@
+If git is not found, HIP_VERSION_BUILD_ID will not be set, causing bug 853718
+===================================================================
+--- hipamd-rocm-5.0.2.orig/CMakeLists.txt
++++ hipamd-rocm-5.0.2/CMakeLists.txt
+@@ -89,6 +89,7 @@ list(GET VERSION_LIST 2 HIP_VERSION_PATC
+ string(REPLACE "-" ";" VERSION_LIST ${HIP_VERSION_PATCH_GITHASH})
+ list(GET VERSION_LIST 0 HIP_VERSION_PATCH)
+ set(HIP_VERSION_GITDATE 0)
++set(HIP_VERSION_BUILD_ID 0)
+ 
+ find_package(Git)
+ 
+@@ -126,7 +127,6 @@ if(GIT_FOUND)
+     set(HIP_VERSION_GITHASH ${git_output})
+   endif()
+ 
+-  set(HIP_VERSION_BUILD_ID 0)
+   set(HIP_VERSION_BUILD_NAME "")
+   if(NOT DEFINED ENV{HIP_OFFICIAL_BUILD} AND NOT HIP_OFFICIAL_BUILD)
+     # FIXME: Disabling it for ROCm 5.0

diff --git a/dev-util/hip/hip-5.0.2-r2.ebuild b/dev-util/hip/hip-5.0.2-r2.ebuild
index 037c442ec73b..223386227084 100644
--- a/dev-util/hip/hip-5.0.2-r2.ebuild
+++ b/dev-util/hip/hip-5.0.2-r2.ebuild
@@ -35,6 +35,7 @@ PATCHES=(
 	"${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"
+	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
 )
 
 S="${WORKDIR}/hipamd-rocm-${PV}"


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2022-09-12  8:41 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2022-09-12  8:41 UTC (permalink / raw
  To: gentoo-commits

commit:     617aabf1f78804a35d1cdf614e40d5873c813207
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Fri Sep  2 08:25:49 2022 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 08:41:01 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=617aabf1

dev-util/hip: Use docs.eclass to control doc install

By default, hip build documentation using doxygen in
packaging/CMakeLists. Patch it out and use docs.eclass instead.

Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 .../hip-5.1.3-remove-cmake-doxygen-commands.patch   | 21 +++++++++++++++++++++
 dev-util/hip/hip-5.1.3-r1.ebuild                    | 12 +++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/dev-util/hip/files/hip-5.1.3-remove-cmake-doxygen-commands.patch b/dev-util/hip/files/hip-5.1.3-remove-cmake-doxygen-commands.patch
new file mode 100644
index 000000000000..921452b2ba92
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-remove-cmake-doxygen-commands.patch
@@ -0,0 +1,21 @@
+Index: hipamd-rocm-5.1.3/packaging/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.1.3.orig/packaging/CMakeLists.txt
++++ hipamd-rocm-5.1.3/packaging/CMakeLists.txt
+@@ -88,16 +88,6 @@ install(FILES ${CMAKE_BINARY_DIR}/includ
+         DESTINATION include/hip COMPONENT dev)
+ #End dev files install
+ 
+-#Begin doc files install
+-find_program(DOXYGEN_EXE doxygen)
+-if(DOXYGEN_EXE)
+-    add_custom_target(build_doxygen ALL
+-                  COMMAND HIP_PATH=${HIP_COMMON_DIR} doxygen ${HIP_COMMON_DIR}/docs/doxygen-input/doxy.cfg)
+-    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/RuntimeAPI/html
+-            DESTINATION docs/RuntimeAPI COMPONENT doc)
+-endif()
+-#End doc files install
+-
+ #Begin samples files install
+ install(DIRECTORY ${HIP_COMMON_DIR}/samples DESTINATION ${CMAKE_INSTALL_DOCDIR}/ COMPONENT samples)
+ #End samples files install

diff --git a/dev-util/hip/hip-5.1.3-r1.ebuild b/dev-util/hip/hip-5.1.3-r1.ebuild
index f9f620fe8170..9a485e3edfdc 100644
--- a/dev-util/hip/hip-5.1.3-r1.ebuild
+++ b/dev-util/hip/hip-5.1.3-r1.ebuild
@@ -4,8 +4,10 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{8..11} )
+DOCS_BUILDER="doxygen"
+DOCS_DEPEND="media-gfx/graphviz"
 
-inherit cmake llvm prefix python-any-r1
+inherit cmake docs llvm prefix python-any-r1
 
 LLVM_MAX_SLOT=14
 
@@ -48,6 +50,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
 	"${FILESDIR}/${PN}-5.1.3-fix-hip_prof_gen.patch"
 	"${FILESDIR}/${PN}-5.1.3-correct-sample-install-location.patch"
+	"${FILESDIR}/${PN}-5.1.3-remove-cmake-doxygen-commands.patch"
 	"${FILESDIR}/0001-SWDEV-316128-HIP-surface-API-support.patch"
 )
 
@@ -62,6 +65,8 @@ 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}
+DOCS_DIR="${HIP_S}"/docs/doxygen-input
+DOCS_CONFIG_NAME=doxy.cfg
 
 src_prepare() {
 	cmake_src_prepare
@@ -151,6 +156,11 @@ src_configure() {
 	cmake_src_configure
 }
 
+src_compile() {
+	HIP_PATH=${HIP_S} docs_compile
+	cmake_src_compile
+}
+
 src_install() {
 
 	cmake_src_install


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2022-09-12  8:41 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2022-09-12  8:41 UTC (permalink / raw
  To: gentoo-commits

commit:     3431032de4948980d3720393331d1a978461911a
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Fri Sep  2 08:24:49 2022 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 08:40:58 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3431032d

dev-util/hip: Fix sample install dir

Using patch instead of sed command. In hip develop branch, the syntax
has changed, so use patch can avoid silent failures in the future.

Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 .../files/hip-5.1.3-correct-sample-install-location.patch   | 13 +++++++++++++
 dev-util/hip/hip-5.1.3-r1.ebuild                            |  1 +
 2 files changed, 14 insertions(+)

diff --git a/dev-util/hip/files/hip-5.1.3-correct-sample-install-location.patch b/dev-util/hip/files/hip-5.1.3-correct-sample-install-location.patch
new file mode 100644
index 000000000000..57ac5cc3e992
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-correct-sample-install-location.patch
@@ -0,0 +1,13 @@
+Index: hipamd-rocm-5.1.3/packaging/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.1.3.orig/packaging/CMakeLists.txt
++++ hipamd-rocm-5.1.3/packaging/CMakeLists.txt
+@@ -106,7 +106,7 @@ endif()
+ #End doc files install
+ 
+ #Begin samples files install
+-install(DIRECTORY ${HIP_COMMON_DIR}/samples DESTINATION . COMPONENT samples)
++install(DIRECTORY ${HIP_COMMON_DIR}/samples DESTINATION ${CMAKE_INSTALL_DOCDIR}/ COMPONENT samples)
+ #End samples files install
+ 
+ #Begin test files install

diff --git a/dev-util/hip/hip-5.1.3-r1.ebuild b/dev-util/hip/hip-5.1.3-r1.ebuild
index 634351aead1f..f9f620fe8170 100644
--- a/dev-util/hip/hip-5.1.3-r1.ebuild
+++ b/dev-util/hip/hip-5.1.3-r1.ebuild
@@ -47,6 +47,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
 	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
 	"${FILESDIR}/${PN}-5.1.3-fix-hip_prof_gen.patch"
+	"${FILESDIR}/${PN}-5.1.3-correct-sample-install-location.patch"
 	"${FILESDIR}/0001-SWDEV-316128-HIP-surface-API-support.patch"
 )
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2023-01-31 13:32 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2023-01-31 13:32 UTC (permalink / raw
  To: gentoo-commits

commit:     38ab28e27cd7da59f4a241b09d3ac734c4f8b575
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Wed Jan 25 03:14:27 2023 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Jan 31 13:31:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38ab28e2

dev-util/hip: Backport fixes for clang directories search

Closes: https://bugs.gentoo.org/891013
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 ...0-hipcc-fails-to-parse-version-of-clang-i.patch |  70 +++++++++
 ...8-LLVM-pkg-search-directly-using-find_dep.patch | 163 +++++++++++++++++++
 ...DEV-355608-Remove-clang-include-path-2996.patch |  51 ++++++
 ...8-Removed-relative-path-based-CLANG-inclu.patch | 173 +++++++++++++++++++++
 dev-util/hip/files/hipvars-5.3.3.pm                |  20 +++
 dev-util/hip/hip-5.3.3-r2.ebuild                   |  17 +-
 6 files changed, 483 insertions(+), 11 deletions(-)

diff --git a/dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch b/dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch
new file mode 100644
index 000000000000..b9a1329e5931
--- /dev/null
+++ b/dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch
@@ -0,0 +1,70 @@
+From 73430b62a5437d1ba6c36a1d812a1434d1ad9df7 Mon Sep 17 00:00:00 2001
+From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com>
+Date: Tue, 20 Dec 2022 06:51:12 +0530
+Subject: [PATCH 1/3] SWDEV-344620 - hipcc fails to parse version of clang in
+ some cases (#3119)
+
+Change-Id: I46f716c82a7500b9a2bcaf5f9ff4ad8a8f982770
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ bin/hipcc.pl | 22 +++++++---------------
+ 1 file changed, 7 insertions(+), 15 deletions(-)
+
+diff --git a/bin/hipcc.pl b/bin/hipcc.pl
+index 645ae62d..2a01dcc3 100755
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -144,7 +144,7 @@ if ($HIP_PLATFORM eq "amd") {
+     $execExtension = "";
+     if($isWindows) {
+         $execExtension = ".exe";
+-    } 
++    }
+     $HIPCC="$HIP_CLANG_PATH/clang++" . $execExtension;
+ 
+     # If $HIPCC clang++ is not compiled, use clang instead
+@@ -157,13 +157,10 @@ if ($HIP_PLATFORM eq "amd") {
+         $HIPLDFLAGS .= " -fuse-ld=lld";
+         $HIPLDFLAGS .= " --ld-path=$HIP_CLANG_PATH/lld-link.exe";
+     }
+-    $HIP_CLANG_VERSION = `$HIPCC --version`;
+-    $HIP_CLANG_VERSION=~/.*clang version (\S+).*/;
+-    $HIP_CLANG_VERSION=$1;
+ 
+-    # Figure out the target with which llvm is configured
+-    $HIP_CLANG_TARGET = `$HIPCC -print-target-triple`;
+-    $HIP_CLANG_TARGET = chomp($HIP_CLANG_TARGET);
++    # get Clang RT Builtin path 
++    $HIP_CLANG_RT_LIB = `$HIPCC --print-runtime-dir`;
++    chomp($HIP_CLANG_RT_LIB);
+ 
+     if (! defined $HIP_CLANG_INCLUDE_PATH) {
+         $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");
+@@ -184,7 +181,7 @@ if ($HIP_PLATFORM eq "amd") {
+         print ("HIP_INCLUDE_PATH=$HIP_INCLUDE_PATH\n");
+         print ("HIP_LIB_PATH=$HIP_LIB_PATH\n");
+         print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n");
+-        print ("HIP_CLANG_TARGET=$HIP_CLANG_TARGET\n");
++        print ("HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB\n");
+     }
+ 
+     if ($isWindows) {
+@@ -715,13 +712,8 @@ if ($HIP_PLATFORM eq "amd") {
+       } else {
+         $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 ";
+       }
+-      # To support __fp16 and _Float16, explicitly link with compiler-rt
+-      $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
+-      if (-e $HIP_CLANG_BUILTIN_LIB) {
+-        $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET -lclang_rt.builtins "
+-      } else {
+-        $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/linux -lclang_rt.builtins-x86_64 "
+-      }
++
++      $toolArgs .= " -L$HIP_CLANG_RT_LIB -lclang_rt.builtins-x86_64 "
+     }
+ }
+ 
+-- 
+2.38.1
+

diff --git a/dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch b/dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch
new file mode 100644
index 000000000000..9dbfe8a55395
--- /dev/null
+++ b/dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch
@@ -0,0 +1,163 @@
+From 6c12b045bc3c434dd13e74bf124ed54afec668c6 Mon Sep 17 00:00:00 2001
+From: AravindanC <aravindan.cheruvally@amd.com>
+Date: Fri, 26 Aug 2022 15:02:09 -0700
+Subject: [PATCH] SWDEV-352878 - LLVM pkg search directly using find_dep() for
+ CLANG Include path
+
+Change-Id: I355e39890757be07de8b9332deca159f35039dfd
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ hip-config.cmake.in | 108 ++++++++++++++++++++++++++------------------
+ 1 file changed, 64 insertions(+), 44 deletions(-)
+
+diff --git a/hip-config.cmake.in b/hip-config.cmake.in
+index 89d1224e..67d898d8 100755
+--- a/hip-config.cmake.in
++++ b/hip-config.cmake.in
+@@ -147,41 +147,62 @@ if(HIP_COMPILER STREQUAL "clang")
+   if(NOT HIP_CXX_COMPILER)
+     set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER})
+   endif()
+-  if(HIP_CXX_COMPILER MATCHES ".*hipcc" OR HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
+-    execute_process(COMMAND ${HIP_CXX_COMPILER} --version
++
++  # Use HIP_CXX_COMPILER option -print-resource-dir
++  # To fetch the clang include path
++  execute_process(
++    COMMAND ${HIP_CXX_COMPILER} -print-resource-dir
++    OUTPUT_VARIABLE HIP_CLANG_INCLUDE_PATH
++    OUTPUT_STRIP_TRAILING_WHITESPACE
++    RESULT_VARIABLE CLANG_INCLUDE_PATH_FETCH_EXIT_CODE)
++
++  if( NOT "${CLANG_INCLUDE_PATH_FETCH_EXIT_CODE}" STREQUAL "0" )
++    if(HIP_CXX_COMPILER MATCHES ".*hipcc" OR HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
++      # IF not successful in fetching HIP_CLANG_INCLUDE_PATH using
++      # HIP_CXX_COMPILER binary command options -print-resource-dir
++      # fallback to old method of getting include by finding HIP_CLANG_ROOT
++      # and from predefined relative path of HIP_CLANG_ROOT
++      execute_process(COMMAND ${HIP_CXX_COMPILER} --version
+                     OUTPUT_STRIP_TRAILING_WHITESPACE
+                     OUTPUT_VARIABLE HIP_CXX_COMPILER_VERSION_OUTPUT)
+-    # Capture the repo, branch and patch level details of the HIP CXX Compiler.
+-    # Ex. clang version 13.0.0 (https://github.com/ROCm-Developer-Tools/HIP main 12345 COMMIT_HASH)
+-    # HIP_CLANG_REPO: https://github.com/ROCm-Developer-Tools/HIP
+-    # HIP_CLANG_BRANCH: main
+-    # HIP_CLANG_PATCH_LEVEL: 12345
+-    if(${HIP_CXX_COMPILER_VERSION_OUTPUT} MATCHES "clang version [0-9]+\\.[0-9]+\\.[0-9]+ \\(([^ \n]*) ([^ \n]*) ([^ \n]*)")
+-      set(HIP_CLANG_REPO ${CMAKE_MATCH_1})
+-      set(HIP_CLANG_BRANCH ${CMAKE_MATCH_2})
+-      set(HIP_CLANG_PATCH_LEVEL ${CMAKE_MATCH_3})
+-    endif()
+-  endif()
+-  if(HIP_CXX_COMPILER MATCHES ".*hipcc")
+-    if(HIP_CXX_COMPILER_VERSION_OUTPUT MATCHES "InstalledDir:[ \t]*([^\n]*)")
+-      get_filename_component(HIP_CLANG_ROOT "${CMAKE_MATCH_1}" DIRECTORY)
+-    endif()
+-  elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
+-    get_filename_component(_HIP_CLANG_REAL_PATH "${HIP_CXX_COMPILER}" REALPATH)
+-    get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY)
+-    get_filename_component(HIP_CLANG_ROOT "${_HIP_CLANG_BIN_PATH}" DIRECTORY)
+-  endif()
+-  file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS ${HIP_CLANG_ROOT}/lib/clang/*/include)
+-  find_path(HIP_CLANG_INCLUDE_PATH stddef.h
+-      HINTS
++      # Capture the repo, branch and patch level details of the HIP CXX Compiler.
++      # Ex. clang version 13.0.0 (https://github.com/ROCm-Developer-Tools/HIP main 12345 COMMIT_HASH)
++      # HIP_CLANG_REPO: https://github.com/ROCm-Developer-Tools/HIP
++      # HIP_CLANG_BRANCH: main
++      # HIP_CLANG_PATCH_LEVEL: 12345
++      if(${HIP_CXX_COMPILER_VERSION_OUTPUT} MATCHES "clang version [0-9]+\\.[0-9]+\\.[0-9]+ \\(([^ \n]*) ([^ \n]*) ([^ \n]*)")
++        set(HIP_CLANG_REPO ${CMAKE_MATCH_1})
++        set(HIP_CLANG_BRANCH ${CMAKE_MATCH_2})
++        set(HIP_CLANG_PATCH_LEVEL ${CMAKE_MATCH_3})
++      endif()
++      if(HIP_CXX_COMPILER MATCHES ".*hipcc")
++        if(HIP_CXX_COMPILER_VERSION_OUTPUT MATCHES "InstalledDir:[ \t]*([^\n]*)")
++          get_filename_component(HIP_CLANG_ROOT "${CMAKE_MATCH_1}" DIRECTORY)
++        endif()
++      elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
++        get_filename_component(_HIP_CLANG_REAL_PATH "${HIP_CXX_COMPILER}" REALPATH)
++        get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY)
++        get_filename_component(HIP_CLANG_ROOT "${_HIP_CLANG_BIN_PATH}" DIRECTORY)
++      endif()
++
++
++      file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS ${HIP_CLANG_ROOT}/lib/clang/*/include)
++      find_path(HIP_CLANG_INCLUDE_PATH stddef.h
++        HINTS
+           ${HIP_CLANG_INCLUDE_SEARCH_PATHS}
+-      NO_DEFAULT_PATH)
++        NO_DEFAULT_PATH)
++      # Since INTERFACE_INCLUDE_DIRECTORIES need to set the parent directory
++      # of HIP_CLANG_INCLUDE_PATH incase using find_path() of stddefs.h
++      set(HIP_CLANG_INCLUDE_PATH "${HIP_CLANG_INCLUDE_PATH}/..")
++    endif() # HIP_CXX_COMPILER Check
++  endif() # CLANG_INCLUDE_PATH_FETCH_EXIT_CODE Check
++
+   if(NOT WIN32)
+     find_dependency(AMDDeviceLibs)
+   endif()
+   set(AMDGPU_TARGETS "gfx900;gfx906;gfx908;gfx90a;gfx1030" CACHE STRING "AMD GPU targets to compile for")
+   set(GPU_TARGETS "${AMDGPU_TARGETS}" CACHE STRING "GPU targets to compile for")
+-endif()
++endif() # HIP_COMPILER check
+ 
+ if(NOT WIN32)
+   find_dependency(amd_comgr)
+@@ -263,11 +284,11 @@ if(HIP_COMPILER STREQUAL "clang")
+   hip_add_interface_link_flags(hip::device --hip-link)
+ 
+   set_property(TARGET hip::device APPEND PROPERTY
+-    INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
++    INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}"
+   )
+ 
+   set_property(TARGET hip::device APPEND PROPERTY
+-    INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
++    INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}"
+   )
+ 
+   foreach(GPU_TARGET ${GPU_TARGETS})
+@@ -291,25 +312,24 @@ if(HIP_COMPILER STREQUAL "clang")
+     endif()
+   endif()
+ 
+-  file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_CLANG_ROOT}/lib/clang/*/lib/*")
+-  find_library(CLANGRT_BUILTINS
+-    NAMES
+-      clang_rt.builtins
+-      clang_rt.builtins-x86_64
+-    PATHS
+-      ${HIP_CLANGRT_LIB_SEARCH_PATHS}
+-      ${HIP_CLANG_INCLUDE_PATH}/../lib/linux
+-      ${HIP_CLANG_INCLUDE_PATH}/../lib/windows
+-      NO_DEFAULT_PATH)
++
++  # Use HIP_CXX option -print-libgcc-file-name --rtlib=compiler-rt
++  # To fetch the compiler rt library file name.
++  execute_process(
++    COMMAND ${HIP_CXX_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt
++    OUTPUT_VARIABLE CLANGRT_BUILTINS
++    OUTPUT_STRIP_TRAILING_WHITESPACE
++    RESULT_VARIABLE CLANGRT_BUILTINS_FETCH_EXIT_CODE)
+ 
+   # Add support for __fp16 and _Float16, explicitly link with compiler-rt
+-  if(NOT CLANGRT_BUILTINS)
+-    message(FATAL_ERROR "clangrt builtins lib not found")
+-  else()
++  if( "${CLANGRT_BUILTINS_FETCH_EXIT_CODE}" STREQUAL "0" )
++    # CLANG_RT Builtins found Successfully Set interface link libraries property
+     set_property(TARGET hip::host APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${CLANGRT_BUILTINS}")
+     set_property(TARGET hip::device APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${CLANGRT_BUILTINS}")
+-  endif()
+-endif()
++  else()
++    message(STATUS "clangrt builtins lib not found: ${CLANGRT_BUILTINS_FETCH_EXIT_CODE}")
++  endif() # CLANGRT_BUILTINS_FETCH_EXIT_CODE Check
++endif() # HIP_COMPILER Check
+ 
+ set( hip_LIBRARIES hip::host hip::device)
+ set( hip_LIBRARY ${hip_LIBRARIES})
+-- 
+2.38.1
+

diff --git a/dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch b/dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch
new file mode 100644
index 000000000000..6d64ad8c9fd8
--- /dev/null
+++ b/dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch
@@ -0,0 +1,51 @@
+From 7613e00fe0299d6584d3ee67e5d4010e7fc0866a Mon Sep 17 00:00:00 2001
+From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com>
+Date: Fri, 14 Oct 2022 16:02:40 +0530
+Subject: [PATCH 2/3] SWDEV-355608 - Remove clang include path (#2996)
+
+Clang doesn't need to be told where to find the clang headers
+
+Change-Id: I175781731c43647676d91eedc8a915124f2479ab
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ bin/hipcc.pl | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/bin/hipcc.pl b/bin/hipcc.pl
+index 2a01dcc3..7e82cad8 100755
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -162,9 +162,6 @@ if ($HIP_PLATFORM eq "amd") {
+     $HIP_CLANG_RT_LIB = `$HIPCC --print-runtime-dir`;
+     chomp($HIP_CLANG_RT_LIB);
+ 
+-    if (! defined $HIP_CLANG_INCLUDE_PATH) {
+-        $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");
+-    }
+     if (! defined $HIP_INCLUDE_PATH) {
+         $HIP_INCLUDE_PATH = "$HIP_PATH/include";
+     }
+@@ -177,20 +174,12 @@ if ($HIP_PLATFORM eq "amd") {
+             print ("HIP_ROCCLR_HOME=$HIP_ROCCLR_HOME\n");
+         }
+         print ("HIP_CLANG_PATH=$HIP_CLANG_PATH\n");
+-        print ("HIP_CLANG_INCLUDE_PATH=$HIP_CLANG_INCLUDE_PATH\n");
+         print ("HIP_INCLUDE_PATH=$HIP_INCLUDE_PATH\n");
+         print ("HIP_LIB_PATH=$HIP_LIB_PATH\n");
+         print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n");
+         print ("HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB\n");
+     }
+ 
+-    if ($isWindows) {
+-      $HIPCXXFLAGS .= " -std=c++14 -fms-extensions -fms-compatibility";
+-    } else {
+-      $HIPCXXFLAGS .= " -std=c++11";
+-    }
+-    $HIPCXXFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
+-    $HIPCFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
+     $HIPLDFLAGS .= " -L\"$HIP_LIB_PATH\"";
+     if ($isWindows) {
+       $HIPLDFLAGS .= " -lamdhip64";
+-- 
+2.38.1
+

diff --git a/dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch b/dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch
new file mode 100644
index 000000000000..f92cce4cf8d8
--- /dev/null
+++ b/dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch
@@ -0,0 +1,173 @@
+From fddbcef9a5a45ab63d4805c53d1f8fcf5c30d095 Mon Sep 17 00:00:00 2001
+From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com>
+Date: Fri, 6 Jan 2023 02:37:15 +0530
+Subject: [PATCH 3/3] SWDEV-352878 - Removed relative path based CLANG include,
+ CLANGRT dependencies (#3124)
+
+Change-Id: Ifdcd117679bff548a6351ba915a8272689e647de
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ cmake/FindHIP.cmake      | 37 ++++++++++++++++++++++++++++-
+ hip-lang-config.cmake.in | 51 +++++++++++++++++++++-------------------
+ 2 files changed, 63 insertions(+), 25 deletions(-)
+
+diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake
+index 8b196dea..109c9f65 100644
+--- a/cmake/FindHIP.cmake
++++ b/cmake/FindHIP.cmake
+@@ -48,6 +48,29 @@ mark_as_advanced(HIP_HOST_COMPILATION_CPP)
+ # FIND: HIP and associated helper binaries
+ ###############################################################################
+ 
++if(NOT HIP_CXX_COMPILER)
++  set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER})
++endif()
++
++# Approach: To find HIP_CLANG_PATH using HIP_CXX_COMPILER options
++# Using --version option of HIP_CXX_COMPILER get the Install Directory
++# This install directory is set as the HIP_CLANG_PATH.
++# IF not successful in getting the Install Directory using HIP_CXX_COMPILER
++# fallback to Old Method to find HIP_CLANG_PATH from ENV Vars, ROCMPATH, HIPPATH etc.
++execute_process(COMMAND ${HIP_CXX_COMPILER} --version
++             OUTPUT_STRIP_TRAILING_WHITESPACE
++             OUTPUT_VARIABLE HIP_CXX_COMPILER_VERSION_OUTPUT)
++if(HIP_CXX_COMPILER MATCHES ".*hipcc")
++  if(HIP_CXX_COMPILER_VERSION_OUTPUT MATCHES "InstalledDir:[ \t]*([^\n]*)")
++    get_filename_component(HIP_CLANG_INSTALL_DIR "${CMAKE_MATCH_1}" DIRECTORY)
++  endif()
++elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
++  get_filename_component(_HIP_CLANG_REAL_PATH "${HIP_CXX_COMPILER}" REALPATH)
++  get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY)
++  get_filename_component(HIP_CLANG_INSTALL_DIR "${_HIP_CLANG_BIN_PATH}" DIRECTORY)
++endif()
++
++
+ get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
+ 
+ # HIP is currently not supported for apple
+@@ -230,6 +253,10 @@ if("${HIP_COMPILER}" STREQUAL "nvcc")
+ elseif("${HIP_COMPILER}" STREQUAL "clang")
+     #Set HIP_CLANG_PATH
+     if("x${HIP_CLANG_PATH}" STREQUAL "x")
++      # IF HIP_CLANG_INSTALL_DIR is Found
++      if( HIP_CLANG_INSTALL_DIR )
++        set(HIP_CLANG_PATH ${HIP_CLANG_INSTALL_DIR})
++      else() # IF HIP_CLANG_INSTALL_DIR is not found
+         if(DEFINED ENV{HIP_CLANG_PATH})
+             set(HIP_CLANG_PATH $ENV{HIP_CLANG_PATH})
+         elseif(DEFINED ENV{ROCM_PATH})
+@@ -252,7 +279,9 @@ elseif("${HIP_COMPILER}" STREQUAL "clang")
+         else()
+             message(FATAL_ERROR "Unable to find the clang compiler path. Set ROCM_PATH or HIP_PATH in env ")
+         endif()
+-    endif()
++      endif() # HIP_CLANG_INSTALL_DIR Check
++    endif() # Set HIP_CLANG_PATH
++
+     #Number of parallel jobs by default is 1
+     if(NOT DEFINED HIP_CLANG_NUM_PARALLEL_JOBS)
+       set(HIP_CLANG_NUM_PARALLEL_JOBS 1)
+@@ -660,6 +689,10 @@ macro(HIP_ADD_EXECUTABLE hip_target)
+     endif()
+     if("${HIP_COMPILER}" STREQUAL "clang")
+         if("x${HIP_CLANG_PATH}" STREQUAL "x")
++          # IF HIP_CLANG_INSTALL_DIR is Found
++          if( HIP_CLANG_INSTALL_DIR )
++            set(HIP_CLANG_PATH ${HIP_CLANG_INSTALL_DIR})
++          else() # IF HIP_CLANG_INSTALL_DIR is not found
+             if(DEFINED ENV{HIP_CLANG_PATH})
+                 set(HIP_CLANG_PATH $ENV{HIP_CLANG_PATH})
+             elseif(DEFINED ENV{ROCM_PATH})
+@@ -682,7 +715,9 @@ macro(HIP_ADD_EXECUTABLE hip_target)
+             else()
+                 message(FATAL_ERROR "Unable to find the clang compiler path. Set ROCM_PATH or HIP_PATH in env")
+             endif()
++          endif() # HIP_CLANG_INSTALL_DIR Check
+         endif()
++
+         set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+     else()
+         set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+diff --git a/hip-lang-config.cmake.in b/hip-lang-config.cmake.in
+index 9250a68a..1cf4e40f 100644
+--- a/hip-lang-config.cmake.in
++++ b/hip-lang-config.cmake.in
+@@ -70,15 +70,6 @@ get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+ get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH)
+ 
+ 
+-#need _IMPORT_PREFIX to be set #FILE_REORG_BACKWARD_COMPATIBILITY
+-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "${_IMPORT_PREFIX}/../llvm/lib/clang/*/include")
+-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "${_IMPORT_PREFIX}/llvm/lib/clang/*/include")
+-find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h
+-    HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS}
+-          ${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG}
+-    NO_DEFAULT_PATH)
+-get_filename_component(HIP_CLANG_INCLUDE_PATH "${HIP_CLANG_INCLUDE_PATH}" DIRECTORY)
+-
+ #If HIP isnot installed under ROCm, need this to find HSA assuming HSA is under ROCm
+ if( DEFINED ENV{ROCM_PATH} )
+   set(ROCM_PATH "$ENV{ROCM_PATH}")
+@@ -96,18 +87,10 @@ if (NOT HSA_HEADER)
+   message (FATAL_ERROR "HSA header not found! ROCM_PATH environment not set")
+ endif()
+ 
+-get_filename_component(HIP_COMPILER_INSTALL_PATH ${CMAKE_HIP_COMPILER} DIRECTORY)
+-file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_COMPILER_INSTALL_PATH}/../lib/clang/*/lib/*")
+-find_library(CLANGRT_BUILTINS
+-    NAMES
+-      clang_rt.builtins
+-      clang_rt.builtins-x86_64
+-    PATHS
+-      ${HIP_CLANGRT_LIB_SEARCH_PATHS}
+-      ${HIP_CLANG_INCLUDE_PATH}/../lib/linux)
++
+ set_target_properties(hip-lang::device PROPERTIES
+-  INTERFACE_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include;${HIP_CLANG_INCLUDE_PATH}>"
+-  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include;${HIP_CLANG_INCLUDE_PATH}>"
++  INTERFACE_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include>"
++  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:HIP>:${_IMPORT_PREFIX}/include>"
+ )
+ 
+ set_target_properties(hip-lang::amdhip64 PROPERTIES
+@@ -133,13 +116,33 @@ set_property(TARGET hip-lang::device APPEND PROPERTY
+   INTERFACE_LINK_OPTIONS "$<$<LINK_LANGUAGE:HIP>:--hip-link>"
+ )
+ 
++# Approach: Check CLANGRT LIB support for CMAKE_HIP_COMPILER
++# Use CMAKE_HIP_COMPILER option -print-libgcc-file-name --rtlib=compiler-rt
++# Note: For Linux add additional option -unwindlib=libgcc also
++# To fetch the compiler rt library file name and confirm.
++# If unsuccessful in getting clangrt using this option then
++# FATAL_ERROR message send since compiler-rt linkage dependency is mandatory.
++# If successful then --rtlib=compiler-rt (and -unwindlib=libgcc for non windows)
++# added to Target's INTERFACE_LINK_LIBRARIES property
++if (NOT WIN32)
++  set(CLANGRT_LINUX_OPTION "-unwindlib=libgcc")
++endif()
++
++execute_process(
++  COMMAND ${CMAKE_HIP_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt ${CLANGRT_LINUX_OPTION}
++  OUTPUT_VARIABLE CLANGRT_BUILTINS
++  OUTPUT_STRIP_TRAILING_WHITESPACE
++  RESULT_VARIABLE CLANGRT_BUILTINS_FETCH_EXIT_CODE)
++
+ # Add support for __fp16 and _Float16, explicitly link with compiler-rt
+-if(NOT CLANGRT_BUILTINS)
+-    message(FATAL_ERROR "clangrt builtins lib not found")
+-else()
++if( "${CLANGRT_BUILTINS_FETCH_EXIT_CODE}" STREQUAL "0" )
+   set_property(TARGET hip-lang::device APPEND PROPERTY
+-    INTERFACE_LINK_LIBRARIES "$<$<LINK_LANGUAGE:HIP>:${CLANGRT_BUILTINS}>"
++    INTERFACE_LINK_OPTIONS $<$<LINK_LANGUAGE:HIP>:--rtlib=compiler-rt ${CLANGRT_LINUX_OPTION}>
+   )
++else()
++  # FATAL_ERROR send if not successfull on compiler-rt linkage dependency
++  message(FATAL_ERROR
++	"${CMAKE_FIND_PACKAGE_NAME} Error:${CLANGRT_BUILTINS_FETCH_EXIT_CODE} - clangrt builtins lib could not be found.")
+ endif()
+ 
+ # Approved by CMake to use this name. This is used so that HIP can
+-- 
+2.38.1
+

diff --git a/dev-util/hip/files/hipvars-5.3.3.pm b/dev-util/hip/files/hipvars-5.3.3.pm
new file mode 100644
index 000000000000..fd1403661efb
--- /dev/null
+++ b/dev-util/hip/files/hipvars-5.3.3.pm
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+package hipvars;
+
+$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@";
+$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@";
+
+$isWindows = 0;
+$HIP_PATH='/usr';
+$ROCM_PATH='/usr';
+$CUDA_PATH='/opt/cuda';
+$HSA_PATH='/usr';
+$HIP_CLANG_PATH='@CLANG_PATH@';
+$HIP_ROCCLR_HOME=$HIP_PATH;
+$HIP_PLATFORM='amd';
+$HIP_COMPILER = "clang";
+$HIP_RUNTIME = "rocclr";
+$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR;
+$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR;
+$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@";
+$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";

diff --git a/dev-util/hip/hip-5.3.3-r2.ebuild b/dev-util/hip/hip-5.3.3-r2.ebuild
index 23778ce69cb9..d52892ff9c6f 100644
--- a/dev-util/hip/hip-5.3.3-r2.ebuild
+++ b/dev-util/hip/hip-5.3.3-r2.ebuild
@@ -47,6 +47,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
 	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
 	"${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
+	"${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
 )
 
 python_check_deps() {
@@ -74,7 +75,6 @@ src_prepare() {
 
 	# correctly find HIP_CLANG_INCLUDE_PATH using cmake
 	local LLVM_PREFIX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
-	local CLANG_RESOURCE_DIR=$("${LLVM_PREFIX}/bin/clang" -print-resource-dir)
 	sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":${LLVM_PREFIX}:" -i hip-config.cmake.in || die
 
 	# correct libs and cmake install dir
@@ -84,18 +84,18 @@ src_prepare() {
 		-e "/CPACK_RESOURCE_FILE_LICENSE/d" -i packaging/CMakeLists.txt || die
 
 	pushd ${HIP_S} || die
-	eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch"
 	eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
 	eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
+	eapply "${FILESDIR}/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch"
+	eapply "${FILESDIR}/0002-SWDEV-355608-Remove-clang-include-path-2996.patch"
+	eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
 	# 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 "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
 		-e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
 		-e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
-		-e "/rpath/s,--rpath=[^ ]*,," \
-		-e "s,\$HIP_CLANG_PATH/../lib/clang/\$HIP_CLANG_VERSION/,${CLANG_RESOURCE_DIR}/,g" \
-		-i bin/hipcc.pl || die
+		-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:${EPREFIX}/usr/lib/amdgcn/bitcode:" \
@@ -105,15 +105,10 @@ src_prepare() {
 	hprefixify $(grep -rl --exclude-dir=build/ --exclude="hip-config.cmake.in" "/usr" "${S}")
 	hprefixify $(grep -rl --exclude-dir=build/ --exclude="hipcc.pl" "/usr" "${HIP_S}")
 
-	cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.1.3.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm"
+	cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.3.3.pm)" bin/hipvars.pm || 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)," \
-		-e "s,@CLANG_INCLUDE_PATH@,${CLANG_RESOURCE_DIR}/include," \
 		-e "s,@CLANG_PATH@,${LLVM_PREFIX}/bin," -i bin/hipvars.pm || die
-
-	sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${_IMPORT_PREFIX}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-lang-config.cmake.in || die
-	popd || die
-	sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${HIP_CLANG_ROOT}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-config.cmake.in || die
 }
 
 src_configure() {


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2023-02-06  3:59 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2023-02-06  3:59 UTC (permalink / raw
  To: gentoo-commits

commit:     488879eeea7979b54150b096a326a33c62e5efe2
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Mon Feb  6 02:48:10 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb  6 03:58:49 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=488879ee

dev-util/hip: add back patch to strip -rpath in hipcc

This fixes hipcc adding -rpath in compilation, which causes QA issue for
building ROCm libraries, and linking the incorrect BLAS/LAPACK
implementation to rocblas-test, which may cause testing performance
degrade.

Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/29443
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/hip/files/hip-5.3.3-correct-ldflag.patch    | 20 ++++++++++++++++++++
 .../hip/{hip-5.3.3-r2.ebuild => hip-5.3.3-r3.ebuild} |  1 +
 2 files changed, 21 insertions(+)

diff --git a/dev-util/hip/files/hip-5.3.3-correct-ldflag.patch b/dev-util/hip/files/hip-5.3.3-correct-ldflag.patch
new file mode 100644
index 000000000000..20d117841c2b
--- /dev/null
+++ b/dev-util/hip/files/hip-5.3.3-correct-ldflag.patch
@@ -0,0 +1,20 @@
+This removes ldflag -L"/usr/lib" and -Wl,-rpath=/usr/lib:/usr/lib which
+causes `ld: skipping incompatible /usr/lib/libm.so when searching for -lm`
+Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1166193820
+===================================================================
+Index: HIP-rocm-5.3.3/bin/hipcc.pl
+===================================================================
+--- HIP-rocm-5.3.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.3.3/bin/hipcc.pl
+@@ -711,9 +711,9 @@ if ($HIP_PLATFORM eq "amd") {
+ 
+     if (not $isWindows  and not $compileOnly) {
+       if ($linkType eq 0) {
+-        $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
++        $toolArgs = " -lamdhip64 -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
+       } else {
+-        $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 ";
++        $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -lamdhip64 ";
+       }
+       # To support __fp16 and _Float16, explicitly link with compiler-rt
+       $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";

diff --git a/dev-util/hip/hip-5.3.3-r2.ebuild b/dev-util/hip/hip-5.3.3-r3.ebuild
similarity index 98%
rename from dev-util/hip/hip-5.3.3-r2.ebuild
rename to dev-util/hip/hip-5.3.3-r3.ebuild
index 072b8d319e97..c11b85e3f2ec 100644
--- a/dev-util/hip/hip-5.3.3-r2.ebuild
+++ b/dev-util/hip/hip-5.3.3-r3.ebuild
@@ -77,6 +77,7 @@ src_prepare() {
 	pushd ${HIP_S} || die
 	eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
 	eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
+	eapply "${FILESDIR}/${PN}-5.3.3-correct-ldflag.patch"
 	eapply "${FILESDIR}/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch"
 	eapply "${FILESDIR}/0002-SWDEV-355608-Remove-clang-include-path-2996.patch"
 	eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2023-09-03  6:37 罗百科
  0 siblings, 0 replies; 15+ messages in thread
From: 罗百科 @ 2023-09-03  6:37 UTC (permalink / raw
  To: gentoo-commits

commit:     b82c9c796475c8d55d310405190c97a38f6d1c7e
Author:     Patrick Lauer <patrick <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  3 06:35:45 2023 +0000
Commit:     罗百科 <patrick <AT> gentoo <DOT> org>
CommitDate: Sun Sep  3 06:37:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b82c9c79

dev-util/hip: add 5.5.1

Closes: https://bugs.gentoo.org/908501
Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>

 dev-util/hip/Manifest                             |   4 +
 dev-util/hip/files/hip-5.5.1-disable-Werror.patch |  18 +++
 dev-util/hip/hip-5.5.1.ebuild                     | 152 ++++++++++++++++++++++
 3 files changed, 174 insertions(+)

diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 8cb4cece793c..61341cfb54ec 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -2,13 +2,17 @@ DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96ea
 DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca
 DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827eeea59f4312b788e868265dcb42197181fd5ef411416da2e11662c7f665f578aa750ab88c3a5405bcc58ee449 SHA512 3f85532cffc09c2ca8e7cd1770263d1c1a38633ed2bc5cfe62072e12a6f8f669db400519950718be31f6b77693d372e2ef905f06c7f02e126aa9ff7d2da97924
 DIST rocclr-5.4.3.tar.gz 640557 BLAKE2B 9ab91bab7ffb06c9c0d1c2ae79533fccc597071dda289ac375e32eb2965c638a7029951d2a49d46eeead9d7d242fe3a0cedb3e444d877af1bbf0e2d801c91e11 SHA512 c1d1a2ca08c2d762a221c04d394469aa7aff46086151333b145e0db9a7c7eb3dbbf8b9693e50d816aa9a13c16b4ebacf5ff3d5d8ff3393a8a764728ef5172d3a
+DIST rocclr-5.5.1.tar.gz 634330 BLAKE2B e6383a6b6b09f274a944d66effd345e38a191ec73ee5c5240f8ec8bb62a4df97b80835ce57f8f78c3834602b9da425b49289b5c7cd7e4c7071147ff409c6a6c9 SHA512 4c12011d22a4f14d9e93250b2a38716eb973139afa1adbbbd51c0e0ed13c0b7c1f45a37c71ef937c5fdabf09e928d7913ca3332fc61b7a2c10d21421306a228f
 DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24
 DIST rocm-hip-5.3.3.tar.gz 1151858 BLAKE2B 5f460b2078c850b3eb4414fcec4a6f951a3b282aa9828f77ba5d5adfdc0ee8d2e62c856e112a154c340daaf7dad49f4871412edd7b38f7fae2e6b17840ee144b SHA512 e747cc10e78cd09009cac762f0e060be13f3447af7ec2a4a2889cbdc09cd76ecb1b5b58c89f09a3b45a8296c2c71e1c55baf113e58a5a12434af3de7168b8d87
 DIST rocm-hip-5.4.3.tar.gz 1195173 BLAKE2B 7452ee7a874bc4703b0d3aaaf9fa2a51e223d5650c65c34982a9981dbe14e8ec70c93d7e70c5ad36a8d02c3d2214fa6a393e20502a01418fb3320d8cfe363feb SHA512 1f4100e114576dcbad83aae453e21ab85cf25bd8a6ada380bb11cfc30e5f92ba903055b7257a099321a84b65adb444dd52b8258e82567f4bc882e65d89369b43
+DIST rocm-hip-5.5.1.tar.gz 1235158 BLAKE2B 2bd675c065fbe054a220f65b30834333d9db91fbd864c408f8ee915f3a511a2f607820562e4d6eacc8e5aa5dc3f8f37fe2b5675c9e89784e61c4a46a9357eef3 SHA512 9d57e96ff1d3eb14300d0809049a32dd8403851c70cd6d94cab8d17206a1210fef8b6f713063b041d35de37ef0ae10319e9d9803c65493a54fb59e66d29c9c4d
 DIST rocm-hipamd-5.1.3.tar.gz 331996 BLAKE2B 176121fe199d53c02a0fc407015681c2f08c8a72104738b457581fd81b37d16efb8170a46d687fb85a45242ba8564246cdd5746e78d9b73dd0bdc9b24eb8378c SHA512 daa6f4da97f71a5fd1f79d8c9e5fc43324743aec91362a05fa62e08966397a637d794abc7e14230eccf5f1271f9fac58d1336aaad1f2cded6cd10792845a494b
 DIST rocm-hipamd-5.3.3.tar.gz 383179 BLAKE2B 45c4fbf28d639095db3cec0632e1b1d872104b3755bdca818ed37ac46caab399fcd2224330e6ac8df7ab155fb146b6272b3ed2efe00d7358b47f31ca2cb1e4f5 SHA512 34c62d915990b6742a2df9b37b6b2bad09f7383e561009519911095e8b65f6f1d79486f7f9b97fa76d7a9755b59fca5a5dff321d8c8b15fd83f2fd22ce08834c
 DIST rocm-hipamd-5.4.3.tar.gz 387070 BLAKE2B c5f30b606227692eea4bf9e35d35bff861648ef44357994996b7f1fb798ffe8b3ccf909bedd47d5486049c9742e426002f2d6636daabc679bae1b70e9ee5e89b SHA512 f2e36ceeca2580fd85f6847dc8320640bd43382bcd584f67362b11580a1d429c36596adbde252967a96d3a2dfc2bdca4d34bd23f5fb0d5e5e73e7844f925b03b
+DIST rocm-hipamd-5.5.1.tar.gz 401791 BLAKE2B f6d0ce1ae684b51177a2c7b3d7f885cce48314ed7c76d075983e8ab6f1a15421feb11d0a718ea592c9c015c015d99ff92f892d69bee58a543a7fe0f0d476150f SHA512 c979edf358a87abfeddaee0fe809d65c106b188c5684a1f229af962e5c4505f4108b1d14db160485048806d69cf5811ad330711b84a6c995386adb21916851c5
 DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa666785699f6b4ec0584a927904a94bf830883050943503f8bdd7c97438a2fb11c71686a330d526f633959916c5c6c8da2e037841e79 SHA512 b83c3ae0bfad80f867bacce36710a8964f6dd7e64bf50da3ec6ce842217d6de63299d9ceaab9dc25a22252484520a85d02859809463dad5dda9b1f00a86863e0
 DIST rocm-opencl-runtime-5.3.3.tar.gz 1007773 BLAKE2B a3f600a68183337f92b152a123241cb7025889cca2ef6814d9d5b5a2146a78703b171d20bcb432bc7a2cdd1f24ad349408c17816b25a66702e9f0f5345af9082 SHA512 391f0f244b7f02972df8cada821e69ee8d81d96b9cff3c14f1d0838da583d8fb136ec4bd5ee820f6dd261968e9eef5e9a5b10b7bb76b1b64625c399d79bcb03f
 DIST rocm-opencl-runtime-5.4.3.tar.gz 1005268 BLAKE2B f9398e4c2b0f045f1b5d8df9f31b7f2bef6a9201885aa6ee5fc5d71632cfde26a078d9a5ea38c3da12d3c187faf04c7bdcf1a8ecb9927cdba56b1efdfcdc44ee SHA512 f65d4622ce8721a6b91ab5b5b306d142ba507d3e631ac3ab0b76c5bc6d8d18455e02debd954c82e7eb609f232b509f1ec1a013dc2fad467c2c2ad31fdf15755d
+DIST rocm-opencl-runtime-5.5.1.tar.gz 991802 BLAKE2B 07d955b4a76b11296259287f5878cadc2438350a3abcdb5bd693c02790ff4c330b1d0a2a87f8de5334b3e3459c26b3fdf695886502ec5d2c373d807c242c8f93 SHA512 06786e818002dc43f64e4b0aaae0a0a2bcdad7acdb4662e1215d43277b107d65fb9a7f7441c31e3378c380cac860b1cd2eaefb5753246beffa4d9c10efced85e
 DIST rocm-tracer-5.1.3.tar.gz 511617 BLAKE2B 4142979b3b7d649798a7ac0b2a04b42aa7fbcbf82f2cf51b0e5363ec0da538046d6e59283d0ce1bfd341317bf24ac2f694d5c8a7d1f132f9b21caea5caf7eda3 SHA512 e73b0c921ffbdcac571d8b0825de39bd8a4fd5f2720ecdd0c189951db85efb607a0b1cd7a9bb02b3dbf329b277cb5e197525216a8e8927eea4e6ce290b7e7c7b

diff --git a/dev-util/hip/files/hip-5.5.1-disable-Werror.patch b/dev-util/hip/files/hip-5.5.1-disable-Werror.patch
new file mode 100644
index 000000000000..ee104644fbda
--- /dev/null
+++ b/dev-util/hip/files/hip-5.5.1-disable-Werror.patch
@@ -0,0 +1,18 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 619d6a0..c520db0 100644
+--- hipamd-rocm-5.5.1.orig/src/CMakeLists.txt
++++ hipamd-rocm-5.5.1/src/CMakeLists.txt
+@@ -44,13 +44,6 @@ if(ADDRESS_SANITIZER)
+   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ASAN_LINKER_FLAGS} -Wl,--build-id=sha1")
+ endif()
+ 
+-if(CMAKE_COMPILER_IS_GNUCC)
+-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=deprecated-declarations")
+-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")
+-endif()
+-
+ option(DISABLE_DIRECT_DISPATCH "Disable Direct Dispatch" OFF)
+ 
+ option(BUILD_SHARED_LIBS "Build the shared library" ON)

diff --git a/dev-util/hip/hip-5.5.1.ebuild b/dev-util/hip/hip-5.5.1.ebuild
new file mode 100644
index 000000000000..276e8628ad9c
--- /dev/null
+++ b/dev-util/hip/hip-5.5.1.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DOCS_BUILDER="doxygen"
+DOCS_DEPEND="media-gfx/graphviz"
+
+inherit cmake docs llvm prefix
+
+LLVM_MAX_SLOT=16
+
+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"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug"
+
+DEPEND="
+	>=dev-util/rocminfo-5
+	sys-devel/clang:${LLVM_MAX_SLOT}
+	dev-libs/rocm-comgr:${SLOT}
+	virtual/opengl
+"
+RDEPEND="${DEPEND}
+	dev-perl/URI-Encode
+	sys-devel/clang-runtime:=
+	>=dev-libs/roct-thunk-interface-5"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
+	"${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
+	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
+	"${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
+	"${FILESDIR}/${PN}-5.5.1-disable-Werror.patch"
+	#"${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.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}
+DOCS_DIR="${HIP_S}"/docs/doxygen-input
+DOCS_CONFIG_NAME=doxy.cfg
+
+pkg_setup() {
+	# Ignore QA FLAGS check for library compiled from assembly sources
+	QA_FLAGS_IGNORED="/usr/$(get_libdir)/libhiprtc-builtins.so.$(ver_cut 1-2)"
+}
+
+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
+
+	# correctly find HIP_CLANG_INCLUDE_PATH using cmake
+	local LLVM_PREFIX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+	sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":${LLVM_PREFIX}:" -i hip-config.cmake.in || die
+
+	# correct libs and cmake install dir
+	sed -e "/\${HIP_COMMON_DIR}/s:cmake DESTINATION .):cmake/ DESTINATION share/cmake/Modules):" -i CMakeLists.txt || die
+
+	sed -e "/\.hip/d" \
+		-e "/CPACK_RESOURCE_FILE_LICENSE/d" -i packaging/CMakeLists.txt || die
+
+	pushd ${HIP_S} || die
+	eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
+	eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
+	#eapply "${FILESDIR}/${PN}-5.4.3-correct-ldflag.patch"
+	#eapply "${FILESDIR}/${PN}-5.4.3-clang-version.patch"
+	#eapply "${FILESDIR}/${PN}-5.4.3-clang-include.patch"
+	#eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+	eapply "${FILESDIR}/${PN}-5.4.3-fix-HIP_CLANG_PATH-detection.patch"
+
+	# 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 "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
+		-e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
+		-e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
+		-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:${EPREFIX}/usr/lib/amdgcn/bitcode:" \
+		-i "${S}/hip-config.cmake.in" || die
+
+	einfo "prefixing hipcc and its utils..."
+	hprefixify $(grep -rl --exclude-dir=build/ --exclude="hip-config.cmake.in" "/usr" "${S}")
+	hprefixify $(grep -rl --exclude-dir=build/ --exclude="hipcc.pl" "/usr" "${HIP_S}")
+
+	cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.3.3.pm)" bin/hipvars.pm || 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)," \
+		-e "s,@CLANG_PATH@,${LLVM_PREFIX}/bin," -i bin/hipvars.pm || die
+	popd || die
+
+	pushd ${CLR_S} || die
+	eapply "${FILESDIR}/rocclr-5.3.3-gcc13.patch"
+}
+
+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="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+		-DCMAKE_BUILD_TYPE=${buildtype}
+		-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+		-DCMAKE_SKIP_RPATH=ON
+		-DBUILD_HIPIFY_CLANG=OFF
+		-DHIP_PLATFORM=amd
+		-DHIP_COMPILER=clang
+		-DROCM_PATH="${EPREFIX}/usr"
+		-DUSE_PROF_API=0
+		-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
+		-DROCCLR_PATH=${CLR_S}
+		-DHIP_COMMON_DIR=${HIP_S}
+		-DAMD_OPENCL_PATH=${OCL_S}
+	)
+
+	cmake_src_configure
+}
+
+src_compile() {
+	HIP_PATH=${HIP_S} docs_compile
+	cmake_src_compile
+}
+
+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/bin/.hipVersion" || die
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2023-11-19  2:18 Benda XU
  0 siblings, 0 replies; 15+ messages in thread
From: Benda XU @ 2023-11-19  2:18 UTC (permalink / raw
  To: gentoo-commits

commit:     74964e47d7cb86d9cbb992f02e9de25a554727ac
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Wed Oct 18 18:34:10 2023 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Nov 19 02:18:21 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74964e47

dev-util/hip: fix crashes and QA issues.

- add fix-unaligned-memcpy.patch
- add exec-stack.patch
- add disable-stack-protector patch
- drop asan doc from the build system.

Closes: https://bugs.gentoo.org/915969
Bug: https://github.com/ROCm-Developer-Tools/clr/issues/18
Bug: https://github.com/gentoo/gentoo/pull/33400
Bug: https://github.com/ROCm-Developer-Tools/clr/issues/22
Bug: https://github.com/ROCm-Developer-Tools/clr/issues/21
Bug: https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/issues/61
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 .../files/hip-5.7.1-disable-stack-protector.patch  | 13 +++++
 dev-util/hip/files/hip-5.7.1-exec-stack.patch      | 31 ++++++++++
 .../hip/files/hip-5.7.1-fix-unaligned-access.patch | 67 ++++++++++++++++++++++
 dev-util/hip/files/hip-5.7.1-no_asan_doc.patch     | 17 ++++++
 dev-util/hip/hip-5.7.1.ebuild                      |  9 ++-
 5 files changed, 134 insertions(+), 3 deletions(-)

diff --git a/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch b/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch
new file mode 100644
index 000000000000..49d944ef4bc9
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-disable-stack-protector.patch
@@ -0,0 +1,13 @@
+Disable stack-protector (which is enabled by default gentoo-hardened) in device code.
+This is not required after https://github.com/llvm/llvm-project/pull/70799, but helps with older clang.
+Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/21
+--- a/hipamd/src/hiprtc/hiprtcInternal.cpp
++++ b/hipamd/src/hiprtc/hiprtcInternal.cpp
+@@ -144,6 +144,7 @@ RTCCompileProgram::RTCCompileProgram(std::string name_) : RTCProgram(name_), fgp
+   compile_options_.push_back("-nogpuinc");
+   compile_options_.push_back("-Wno-gnu-line-marker");
+   compile_options_.push_back("-Wno-missing-prototypes");
++  compile_options_.push_back("-fno-stack-protector");
+ #ifdef _WIN32
+   compile_options_.push_back("-target");
+   compile_options_.push_back("x86_64-pc-windows-msvc");

diff --git a/dev-util/hip/files/hip-5.7.1-exec-stack.patch b/dev-util/hip/files/hip-5.7.1-exec-stack.patch
new file mode 100644
index 000000000000..744ca7b953c3
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-exec-stack.patch
@@ -0,0 +1,31 @@
+Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/22
+--- a/hipamd/src/hip_embed_pch.sh
++++ b/hipamd/src/hip_embed_pch.sh
+@@ -178,6 +178,7 @@ EOF
+ 
+   echo "// Automatically generated script for HIP RTC." > $mcinFile
+   if [[ $isWindows -eq 0 ]]; then
++    echo "  .section .note.GNU-stack,"",%progbits" >> $mcinFile
+     echo "  .type __hipRTC_header,@object" >> $mcinFile
+     echo "  .type __hipRTC_header_size,@object" >> $mcinFile
+   fi
+--- a/hipamd/src/hiprtc/cmake/HIPRTC.cmake
++++ b/hipamd/src/hiprtc/cmake/HIPRTC.cmake
+@@ -98,6 +98,7 @@ macro(generate_hiprtc_mcin HiprtcMcin HiprtcPreprocessedInput)
+     set(HIPRTC_TYPE_LINUX_ONLY "")
+   else()
+     set(HIPRTC_TYPE_LINUX_ONLY
++      "  .section .note.GNU-stack,\"\",%progbits\n"
+       "  .type __hipRTC_header,@object\n"
+       "  .type __hipRTC_header_size,@object")
+   endif()
+--- a/hipamd/src/hip_embed_pch.sh
++++ b/hipamd/src/hip_embed_pch.sh
+@@ -111,6 +111,7 @@ cat >$tmp/hip_pch.h <<EOF
+ EOF
+ 
+ cat >$tmp/hip_pch.mcin <<EOF
++  .section .note.GNU-stack,"",%progbits
+   .type __hip_pch_wave32,@object
+   .section .hip_pch_wave32,"aMS",@progbits,1
+   .data

diff --git a/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch b/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch
new file mode 100644
index 000000000000..ae2092f6e1ac
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-fix-unaligned-access.patch
@@ -0,0 +1,67 @@
+Fix SIGSEGV when compiled with avx-512 instructions.
+
+Due to unaligned allocations, library crashes in
+nontemporalMemcpy in _mm512_stream_si512 (which requires
+64-aligned allocations, but used to copy default-aligned objects).
+
+Without this patch hipamd causes random crashes in hipMemcpy* callers
+(tensile, rocBLAS, miopen, rocThrust, etc.).
+
+Bug: https://bugs.gentoo.org/915969
+Bug report in upstream: https://github.com/ROCm-Developer-Tools/clr/issues/18
+--- a/rocclr/device/rocm/rocvirtual.cpp
++++ b/rocclr/device/rocm/rocvirtual.cpp
+@@ -2790,44 +2790,6 @@ bool VirtualGPU::createVirtualQueue(uint deviceQueueSize)
+   return true;
+ }
+ 
+-// ================================================================================================
+-__attribute__((optimize("unroll-all-loops"), always_inline))
+-static inline void nontemporalMemcpy(void* __restrict dst, const void* __restrict src,
+-                              uint16_t size) {
+-  #if defined(__AVX512F__)
+-    for (auto i = 0u; i != size / sizeof(__m512i); ++i) {
+-      _mm512_stream_si512(reinterpret_cast<__m512i* __restrict&>(dst)++,
+-                          *reinterpret_cast<const __m512i* __restrict&>(src)++);
+-    }
+-    size = size % sizeof(__m512i);
+-  #endif
+-
+-  #if defined(__AVX__)
+-    for (auto i = 0u; i != size / sizeof(__m256i); ++i) {
+-      _mm256_stream_si256(reinterpret_cast<__m256i* __restrict&>(dst)++,
+-                          *reinterpret_cast<const __m256i* __restrict&>(src)++);
+-    }
+-    size = size % sizeof(__m256i);
+-  #endif
+-
+-  for (auto i = 0u; i != size / sizeof(__m128i); ++i) {
+-    _mm_stream_si128(reinterpret_cast<__m128i* __restrict&>(dst)++,
+-                     *(reinterpret_cast<const __m128i* __restrict&>(src)++));
+-  }
+-  size = size % sizeof(__m128i);
+-
+-  for (auto i = 0u; i != size / sizeof(long long); ++i) {
+-    _mm_stream_si64(reinterpret_cast<long long* __restrict&>(dst)++,
+-                    *reinterpret_cast<const long long* __restrict&>(src)++);
+-  }
+-  size = size % sizeof(long long);
+-
+-  for (auto i = 0u; i != size / sizeof(int); ++i) {
+-    _mm_stream_si32(reinterpret_cast<int* __restrict&>(dst)++,
+-                    *reinterpret_cast<const int* __restrict&>(src)++);
+-  }
+-}
+-
+ // ================================================================================================
+ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
+     const amd::Kernel& kernel, const_address parameters, void* eventHandle,
+@@ -3096,7 +3058,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
+       argBuffer = reinterpret_cast<address>(allocKernArg(gpuKernel.KernargSegmentByteSize(),
+                                             gpuKernel.KernargSegmentAlignment()));
+       // Load all kernel arguments
+-      nontemporalMemcpy(argBuffer, parameters,
++      memcpy(argBuffer, parameters,
+                         std::min(gpuKernel.KernargSegmentByteSize(),
+                                  signature.paramsSize()));
+     }

diff --git a/dev-util/hip/files/hip-5.7.1-no_asan_doc.patch b/dev-util/hip/files/hip-5.7.1-no_asan_doc.patch
new file mode 100644
index 000000000000..40de416334be
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-no_asan_doc.patch
@@ -0,0 +1,17 @@
+Donot install -asan documents.
+
+Reference:
+https://github.com/RadeonOpenCompute/llvm-project/commit/e782e09f7b113a0f896c6cec7240d411aca1d73f
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/issues/61
+
+--- a/hipamd/packaging/CMakeLists.txt	2023-11-18 23:25:45.000000000 +0800
++++ b/hipamd/packaging/CMakeLists.txt	2023-11-18 23:27:27.230354665 +0800
+@@ -36,8 +36,6 @@
+ ###Set License####
+ set(CPACK_RESOURCE_FILE_LICENSE ${hip_SOURCE_DIR}/LICENSE.txt)
+ install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary)
+-# install license file in share/doc/hip-asan folder
+-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-asan COMPONENT asan)
+ set(CPACK_RPM_PACKAGE_LICENSE "MIT")
+ #Begin binary files install
+ if(HIP_PLATFORM STREQUAL "amd" )

diff --git a/dev-util/hip/hip-5.7.1.ebuild b/dev-util/hip/hip-5.7.1.ebuild
index 0bba0d2f560b..c9094afe5ba6 100644
--- a/dev-util/hip/hip-5.7.1.ebuild
+++ b/dev-util/hip/hip-5.7.1.ebuild
@@ -35,8 +35,12 @@ RDEPEND="${DEPEND}
 	>=dev-libs/roct-thunk-interface-5"
 
 PATCHES=(
-	"${FILESDIR}/hip-5.7.0-install.patch"
-	)
+	"${FILESDIR}/${PN}-5.7.0-install.patch"
+	"${FILESDIR}/${PN}-5.7.1-fix-unaligned-access.patch"
+	"${FILESDIR}/${PN}-5.7.1-exec-stack.patch"
+	"${FILESDIR}/${PN}-5.7.1-disable-stack-protector.patch"
+	"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
+)
 
 S="${WORKDIR}/clr-rocm-${PV}/"
 
@@ -72,7 +76,6 @@ src_compile() {
 }
 
 src_install() {
-
 	cmake_src_install
 
 	rm "${ED}/usr/include/hip/hcc_detail" || die


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2024-03-08 19:22 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2024-03-08 19:22 UTC (permalink / raw
  To: gentoo-commits

commit:     d49991905031dbe78494f500730da8a43cd2763c
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Sat Jan 20 15:25:20 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar  8 19:22:05 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4999190

dev-util/hip: add backported fix for OOM check

Fixes failure of oidnTest from media-libs/oidn with HIP from https://github.com/gentoo/gentoo/pull/34869

Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../hip/files/hip-5.7.1-fix-mmap-oom-check.patch   | 41 ++++++++++++++++++++++
 dev-util/hip/hip-5.7.1-r2.ebuild                   |  1 +
 2 files changed, 42 insertions(+)

diff --git a/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch b/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch
new file mode 100644
index 000000000000..dbafe4e11a74
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch
@@ -0,0 +1,41 @@
+Backport of SWDEV-417691 - Error handling for MemoryMap OS calls.
+The issue was fixed in rocclr 6.0.0.
+https://github.com/ROCm/clr/commit/7a10423a44b8b353f67539dc1ae14c0b99c209b8
+--- a/rocclr/os/os_posix.cpp
++++ b/rocclr/os/os_posix.cpp
+@@ -214,7 +214,7 @@ address Os::reserveMemory(address start, size_t size, size_t alignment, MemProt
+                                 MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS, 0, 0);
+ 
+   // check for out of memory
+-  if (mem == NULL) return NULL;
++  if (mem == MAP_FAILED) return NULL;
+ 
+   address aligned = alignUp(mem, alignment);
+ 
+@@ -842,7 +842,7 @@ bool Os::MemoryMapFileDesc(FileDesc fdesc, size_t fsize, size_t foffset, const v
+   }
+ 
+   *mmap_ptr = mmap(NULL, fsize, PROT_READ, MAP_SHARED, fdesc, foffset);
+-  return true;
++  return (*mmap_ptr == MAP_FAILED) ? false : true;
+ }
+ 
+ bool Os::MemoryUnmapFile(const void* mmap_ptr, size_t mmap_size) {
+@@ -874,7 +874,7 @@ bool Os::MemoryMapFile(const char* fname, const void** mmap_ptr, size_t* mmap_si
+ 
+   close(fd);
+ 
+-  if (*mmap_ptr == nullptr) {
++  if (*mmap_ptr == MAP_FAILED) {
+     return false;
+   }
+ 
+@@ -899,7 +899,7 @@ bool Os::MemoryMapFileTruncated(const char* fname, const void** mmap_ptr, size_t
+ 
+   close(fd);
+ 
+-  if (*mmap_ptr == nullptr) {
++  if (*mmap_ptr == MAP_FAILED) {
+     return false;
+   }
+ 
\ No newline at end of file

diff --git a/dev-util/hip/hip-5.7.1-r2.ebuild b/dev-util/hip/hip-5.7.1-r2.ebuild
index f91ef2a7083c..034378272f53 100644
--- a/dev-util/hip/hip-5.7.1-r2.ebuild
+++ b/dev-util/hip/hip-5.7.1-r2.ebuild
@@ -47,6 +47,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-5.7.1-disable-stack-protector.patch"
 	"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
 	"${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
+	"${FILESDIR}/${PN}-5.7.1-fix-mmap-oom-check.patch"
 )
 
 S="${WORKDIR}/clr-rocm-${PV}/"


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/
@ 2024-06-26  9:21 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2024-06-26  9:21 UTC (permalink / raw
  To: gentoo-commits

commit:     2523be861bded1342a5a50ae6200300886b14bc1
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Tue Jun 25 20:47:10 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 09:19:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2523be86

dev-util/hip: rename patches

Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...ip-5.1.3-0001-SWDEV-316128-HIP-surface-API-support.patch} |  0
 ...DEV-352878-LLVM-pkg-search-directly-using-find_dep.patch} |  0
 ...DEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch} |  0
 ...3-0003-SWDEV-355608-Remove-clang-include-path-2996.patch} |  0
 ...DEV-352878-Removed-relative-path-based-CLANG-inclu.patch} |  0
 dev-util/hip/hip-5.1.3-r4.ebuild                             |  4 ++--
 dev-util/hip/hip-5.3.3-r3.ebuild                             | 12 +++++++-----
 dev-util/hip/hip-5.4.3.ebuild                                |  6 +++---
 dev-util/hip/hip-5.5.1.ebuild                                |  6 +++---
 9 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch b/dev-util/hip/files/hip-5.1.3-0001-SWDEV-316128-HIP-surface-API-support.patch
similarity index 100%
rename from dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch
rename to dev-util/hip/files/hip-5.1.3-0001-SWDEV-316128-HIP-surface-API-support.patch

diff --git a/dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch b/dev-util/hip/files/hip-5.3.3-0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch
similarity index 100%
rename from dev-util/hip/files/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch
rename to dev-util/hip/files/hip-5.3.3-0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch

diff --git a/dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch b/dev-util/hip/files/hip-5.3.3-0002-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch
similarity index 100%
rename from dev-util/hip/files/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch
rename to dev-util/hip/files/hip-5.3.3-0002-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch

diff --git a/dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch b/dev-util/hip/files/hip-5.3.3-0003-SWDEV-355608-Remove-clang-include-path-2996.patch
similarity index 100%
rename from dev-util/hip/files/0002-SWDEV-355608-Remove-clang-include-path-2996.patch
rename to dev-util/hip/files/hip-5.3.3-0003-SWDEV-355608-Remove-clang-include-path-2996.patch

diff --git a/dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch b/dev-util/hip/files/hip-5.3.3-0004-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch
similarity index 100%
rename from dev-util/hip/files/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch
rename to dev-util/hip/files/hip-5.3.3-0004-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch

diff --git a/dev-util/hip/hip-5.1.3-r4.ebuild b/dev-util/hip/hip-5.1.3-r4.ebuild
index a8654a3e0568..764d4f49f49b 100644
--- a/dev-util/hip/hip-5.1.3-r4.ebuild
+++ b/dev-util/hip/hip-5.1.3-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -51,7 +51,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-5.1.3-fix-hip_prof_gen.patch"
 	"${FILESDIR}/${PN}-5.1.3-correct-sample-install-location.patch"
 	"${FILESDIR}/${PN}-5.1.3-remove-cmake-doxygen-commands.patch"
-	"${FILESDIR}/0001-SWDEV-316128-HIP-surface-API-support.patch"
+	"${FILESDIR}/${PN}-5.1.3-0001-SWDEV-316128-HIP-surface-API-support.patch"
 	"${FILESDIR}/${PN}-5.1.3-llvm-15-noinline-keyword.patch"
 )
 

diff --git a/dev-util/hip/hip-5.3.3-r3.ebuild b/dev-util/hip/hip-5.3.3-r3.ebuild
index c03da0d6effc..fe717ad3b84c 100644
--- a/dev-util/hip/hip-5.3.3-r3.ebuild
+++ b/dev-util/hip/hip-5.3.3-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -40,7 +40,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
 	"${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
 	"${FILESDIR}/${PN}-5.3.3-disable-Werror.patch"
-	"${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
+	"${FILESDIR}/${PN}-5.3.3-0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
 )
 
 S="${WORKDIR}/hipamd-rocm-${PV}"
@@ -78,9 +78,11 @@ src_prepare() {
 	eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
 	eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
 	eapply "${FILESDIR}/${PN}-5.3.3-correct-ldflag.patch"
-	eapply "${FILESDIR}/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch"
-	eapply "${FILESDIR}/0002-SWDEV-355608-Remove-clang-include-path-2996.patch"
-	eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+
+	eapply "${FILESDIR}/${PN}-5.3.3-0002-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch"
+	eapply "${FILESDIR}/${PN}-5.3.3-0003-SWDEV-355608-Remove-clang-include-path-2996.patch"
+	eapply "${FILESDIR}/${PN}-5.3.3-0004-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+
 	eapply "${FILESDIR}/${PN}-5.4.3-fix-HIP_CLANG_PATH-detection.patch"
 	# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
 	# which makes "stdlib.h" not found when using "#include_next" in header files;

diff --git a/dev-util/hip/hip-5.4.3.ebuild b/dev-util/hip/hip-5.4.3.ebuild
index 7798aab3e444..3eb09247c48f 100644
--- a/dev-util/hip/hip-5.4.3.ebuild
+++ b/dev-util/hip/hip-5.4.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -40,7 +40,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
 	"${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
 	"${FILESDIR}/${PN}-5.3.3-disable-Werror.patch"
-	"${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
+	"${FILESDIR}/${PN}-5.3.3-0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
 )
 
 S="${WORKDIR}/hipamd-rocm-${PV}"
@@ -80,7 +80,7 @@ src_prepare() {
 	eapply "${FILESDIR}/${PN}-5.4.3-correct-ldflag.patch"
 	eapply "${FILESDIR}/${PN}-5.4.3-clang-version.patch"
 	eapply "${FILESDIR}/${PN}-5.4.3-clang-include.patch"
-	eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+	eapply "${FILESDIR}/${PN}-5.3.3-0004-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
 	eapply "${FILESDIR}/${PN}-5.4.3-fix-HIP_CLANG_PATH-detection.patch"
 
 	# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"

diff --git a/dev-util/hip/hip-5.5.1.ebuild b/dev-util/hip/hip-5.5.1.ebuild
index 276e8628ad9c..3bb5b6bb99c9 100644
--- a/dev-util/hip/hip-5.5.1.ebuild
+++ b/dev-util/hip/hip-5.5.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -40,7 +40,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
 	"${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
 	"${FILESDIR}/${PN}-5.5.1-disable-Werror.patch"
-	#"${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
+	# "${FILESDIR}/${PN}-5.3.3-0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
 )
 
 S="${WORKDIR}/hipamd-rocm-${PV}"
@@ -80,7 +80,7 @@ src_prepare() {
 	#eapply "${FILESDIR}/${PN}-5.4.3-correct-ldflag.patch"
 	#eapply "${FILESDIR}/${PN}-5.4.3-clang-version.patch"
 	#eapply "${FILESDIR}/${PN}-5.4.3-clang-include.patch"
-	#eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+	#eapply "${FILESDIR}/${PN}-5.3.3-0004-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
 	eapply "${FILESDIR}/${PN}-5.4.3-fix-HIP_CLANG_PATH-detection.patch"
 
 	# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-06-26  9:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-22 13:03 [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/ Benda XU
  -- strict thread matches above, loose matches on Subject: below --
2024-06-26  9:21 Sam James
2024-03-08 19:22 Sam James
2023-11-19  2:18 Benda XU
2023-09-03  6:37 罗百科
2023-02-06  3:59 Sam James
2023-01-31 13:32 Benda XU
2022-09-12  8:41 Benda XU
2022-09-12  8:41 Benda XU
2022-06-13 12:00 Benda XU
2021-08-26 12:39 Benda XU
2021-08-13  5:08 Benda XU
2021-08-03  6:32 Benda XU
2021-04-11 15:17 Craig Andrews
2020-12-27  1:55 Benda XU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox