commit:     20ba0493ccc5cd9ffd83ebc27f03879024717871
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 29 07:07:22 2023 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Jul 30 04:35:24 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20ba0493

sci-libs/hipFFT: do not use cmake module to find HIP.

Loosen the versioned dependence on dev-util/hip.

Reference: https://github.com/ROCmSoftwarePlatform/hipFFT/pull/66
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 .../hipFFT/files/hipFFT-5.1.3_hip-config.patch     | 90 ++++++++++++++++++++++
 ...{hipFFT-5.1.3.ebuild => hipFFT-5.1.3-r1.ebuild} | 16 ++--
 2 files changed, 95 insertions(+), 11 deletions(-)

diff --git a/sci-libs/hipFFT/files/hipFFT-5.1.3_hip-config.patch 
b/sci-libs/hipFFT/files/hipFFT-5.1.3_hip-config.patch
new file mode 100644
index 000000000000..2f63a0f8e6f7
--- /dev/null
+++ b/sci-libs/hipFFT/files/hipFFT-5.1.3_hip-config.patch
@@ -0,0 +1,90 @@
+reverts the following commit.
+
+Upstream: https://github.com/ROCmSoftwarePlatform/hipFFT/pull/67
+
+commit 41491c9a70f808ed74690a538ca7bd25ff1ae1ca
+Author: Steve Leung <[email protected]>
+Date:   Wed Sep 1 11:25:26 2021 -0600
+
+    cmake: use HIP CONFIG on Windows
+
+diff --git a/clients/rider/CMakeLists.txt b/clients/rider/CMakeLists.txt
+index de1fc7d..8b88103 100644
+--- b/clients/rider/CMakeLists.txt
++++ a/clients/rider/CMakeLists.txt
+@@ -43,11 +43,7 @@
+   
+ if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
+   if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
+-    if( WIN32 )
+-      find_package( HIP CONFIG REQUIRED )
+-    else()
+-      find_package( HIP MODULE REQUIRED )
+-    endif()
++    find_package( HIP REQUIRED )
+     target_link_libraries( hipfft-rider PRIVATE hip::host )
+   else()
+ 
+diff --git a/clients/samples/CMakeLists.txt b/clients/samples/CMakeLists.txt
+index 5a882c6..37162ab 100644
+--- b/clients/samples/CMakeLists.txt
++++ a/clients/samples/CMakeLists.txt
+@@ -48,11 +48,7 @@
+   target_link_libraries( ${sample} PRIVATE hip::hipfft )
+   
+   if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
+-    if( WIN32 )
+-      find_package( HIP CONFIG REQUIRED )
+-    else()
+-      find_package( HIP MODULE REQUIRED )
+-    endif()
++    find_package( HIP REQUIRED )
+     if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
+       target_link_libraries( ${sample} PRIVATE hip::host )
+     else()
+diff --git a/clients/tests/CMakeLists.txt b/clients/tests/CMakeLists.txt
+index 2b965e2..0442a79 100644
+--- b/clients/tests/CMakeLists.txt
++++ a/clients/tests/CMakeLists.txt
+@@ -81,11 +81,7 @@
+ 
+ if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
+   if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
+-    if( WIN32 )
+-      find_package( HIP CONFIG REQUIRED )
+-    else()
+-      find_package( HIP MODULE REQUIRED )
+-    endif()
++    find_package( HIP REQUIRED )
+     target_link_libraries( hipfft-test PRIVATE hip::host )
+   else()
+     target_compile_definitions( hipfft-test PRIVATE __HIP_PLATFORM_NVIDIA__)
+diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
+index 022e3e4..0c8b3f8 100644
+--- b/cmake/dependencies.cmake
++++ a/cmake/dependencies.cmake
+@@ -27,22 +27,14 @@
+ # HIP
+ if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
+   if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
+-    if( WIN32 )
+-      find_package( HIP CONFIG REQUIRED )
+-    else()
+-      find_package( HIP MODULE REQUIRED )
+-    endif()
++    find_package( HIP REQUIRED )
+     list( APPEND HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include" )
+   endif()
+ else()
+   if( BUILD_WITH_LIB STREQUAL "CUDA" )
+     set(HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include")
+   else()
+-    if( WIN32 )
+-      find_package( HIP CONFIG REQUIRED )
+-    else()
+-      find_package( HIP MODULE REQUIRED )
+-    endif()
++    find_package( HIP REQUIRED )
+   endif()
+ endif()
+   

diff --git a/sci-libs/hipFFT/hipFFT-5.1.3.ebuild 
b/sci-libs/hipFFT/hipFFT-5.1.3-r1.ebuild
similarity index 73%
rename from sci-libs/hipFFT/hipFFT-5.1.3.ebuild
rename to sci-libs/hipFFT/hipFFT-5.1.3-r1.ebuild
index 216d15841546..79eb8052324f 100644
--- a/sci-libs/hipFFT/hipFFT-5.1.3.ebuild
+++ b/sci-libs/hipFFT/hipFFT-5.1.3-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -18,7 +18,7 @@ SLOT="0/$(ver_cut 1-2)"
 
 RESTRICT="test"
 
-RDEPEND="dev-util/hip:${SLOT}
+RDEPEND="dev-util/hip
        sci-libs/rocFFT:${SLOT}[${ROCM_USEDEP}]"
 DEPEND="${RDEPEND}"
 BDEPEND=""
@@ -26,25 +26,19 @@ BDEPEND=""
 S="${WORKDIR}/hipFFT-rocm-${PV}"
 
 PATCHES=(
+       "${FILESDIR}/${PN}-5.1.3_hip-config.patch"
        "${FILESDIR}/${PN}-5.1.3-gentoo-install-locations.patch"
        "${FILESDIR}/${PN}-5.0.2-remove-git-dependency.patch"
        "${FILESDIR}/${PN}-4.3.0-add-complex-header.patch"
 )
 
-src_prepare() {
-       sed -e "/CMAKE_INSTALL_LIBDIR/d" -i CMakeLists.txt || die
-       cmake_src_prepare
-}
-
 src_configure() {
        local mycmakeargs=(
-               -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
                -DCMAKE_INSTALL_INCLUDEDIR="include/hipfft"
-               -DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake"
-               -DHIP_ROOT_DIR="${EPREFIX}/usr"
+               -DROCM_SYMLINK_LIBS=OFF
                -DBUILD_CLIENTS_TESTS=OFF
                -DBUILD_CLIENTS_RIDER=OFF
        )
 
-       cmake_src_configure
+       CXX=hipcc cmake_src_configure
 }

Reply via email to