commit:     2367211d2e24bfb778d36aaca4c83d754cf99b60
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Sun May 15 05:53:06 2022 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 04:31:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2367211d

sci-libs/hipFFT: bump version to 5.0.2

Closes: https://github.com/gentoo/gentoo/pull/25830
Bug: https://bugs.gentoo.org/847469
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 sci-libs/hipFFT/Manifest                           |  2 +
 .../hipFFT-5.0.2-gentoo-install-locations.patch    | 28 ++++++++
 .../files/hipFFT-5.0.2-remove-git-dependency.patch | 35 ++++++++++
 sci-libs/hipFFT/hipFFT-5.0.2.ebuild                | 77 ++++++++++++++++++++++
 4 files changed, 142 insertions(+)

diff --git a/sci-libs/hipFFT/Manifest b/sci-libs/hipFFT/Manifest
index c756438b9383..ea28dc7b9ab8 100644
--- a/sci-libs/hipFFT/Manifest
+++ b/sci-libs/hipFFT/Manifest
@@ -1,2 +1,4 @@
 DIST hipFFT-rocm-4.3.0.tar.gz 83355 BLAKE2B 
ee99b4cb685cbb846084d8a7c77982d75cf0d1597f9270260284bb26ae00702a31dd4d5ad9ae1885ab631c390f65c0f584f302be189701ba4f0dd9061b1bba5a
 SHA512 
0d3100b054ff485eae06b13b8c568626b8e3a3286f36012c5a5f9bb4918e03c30c687a2714049bd797f6c3973f1730ad0936f02ad044cde1663c9c5750bbcf40
+DIST hipFFT-rocm-5.0.2.tar.gz 88405 BLAKE2B 
c3a2e5e029d7d91c7cdc1c4e2ddec71c17df0cf2d863c81ef263eea3734488fcc31795ea681b27dffd04c0833c99df252256c3ffacfbf29305fa1ba5b8bd4efa
 SHA512 
4fdc080479f1094e9ce92acc0eceb630a6a6ce711ffdc5ffef58d61baf23e8ea9ec45a922d798fb17a7724425d5785451f5f114bc7db40ebbfb50359b56456a6
 DIST rocFFT-4.3.0.tar.gz 840748 BLAKE2B 
236a5faa930751d35e501a9a32ecc8b4075448ef21a0ffb0bb7ec04f4ed1cb67b908aa153b5b424e0823d3e306cf375d7c01a77d687220ed79de6d374037e003
 SHA512 
765d41e4018a04a53e847c03de80eec830d3e8766187fb8cb493624afa2673175347c16e6eeeebd4ad7d88bb866e58f7e572708f22238723c710b98565a0cd3d
+DIST rocFFT-5.0.2.tar.gz 837508 BLAKE2B 
b74d0c6edd7b232f775bffefbca829d88d9d7cd9108c27a0698f45d7fe2760d40463bcda8c710e923874b3bbfb1e83e0fe8622db4dfa28afb29392b3e135e9a5
 SHA512 
d6810a92a10a27dbcac8a04e8fcd56c7fa198f208da626d8938d5ff28b6ab8b89a058c7a56b5666464165e8f6bd7c4c031a94315625a3613eb02a9b8eccd9eb9

diff --git a/sci-libs/hipFFT/files/hipFFT-5.0.2-gentoo-install-locations.patch 
b/sci-libs/hipFFT/files/hipFFT-5.0.2-gentoo-install-locations.patch
new file mode 100644
index 000000000000..eefdb2aaaaf5
--- /dev/null
+++ b/sci-libs/hipFFT/files/hipFFT-5.0.2-gentoo-install-locations.patch
@@ -0,0 +1,28 @@
+Index: hipFFT-rocm-5.0.2/library/CMakeLists.txt
+===================================================================
+--- hipFFT-rocm-5.0.2.orig/library/CMakeLists.txt
++++ hipFFT-rocm-5.0.2/library/CMakeLists.txt
+@@ -81,7 +81,7 @@ target_include_directories( hipfft
+   PUBLIC  $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/library/include>
+   $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
+   $<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
+-  $<INSTALL_INTERFACE:include>
++  $<INSTALL_INTERFACE:include/hipfft>
+   ${HIP_INCLUDE_DIRS}
+   )
+ 
+@@ -142,13 +142,11 @@ if( ROCM_FOUND )
+   rocm_install_targets( TARGETS hipfft
+     INCLUDE
+     ${CMAKE_SOURCE_DIR}/library/include
+-    ${CMAKE_BINARY_DIR}/include
+-    PREFIX hipfft )
++    ${CMAKE_BINARY_DIR}/include )
+   rocm_export_targets( TARGETS hip::hipfft
+     PREFIX hipfft
+     DEPENDS PACKAGE hip
+     NAMESPACE hip:: )
+-  rocm_install_symlink_subdir( hipfft )
+ 
+   # Package specific CPACK vars
+   if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )

diff --git a/sci-libs/hipFFT/files/hipFFT-5.0.2-remove-git-dependency.patch 
b/sci-libs/hipFFT/files/hipFFT-5.0.2-remove-git-dependency.patch
new file mode 100644
index 000000000000..fb2c97936a42
--- /dev/null
+++ b/sci-libs/hipFFT/files/hipFFT-5.0.2-remove-git-dependency.patch
@@ -0,0 +1,35 @@
+Index: hipFFT-rocm-5.0.2/cmake/dependencies.cmake
+===================================================================
+--- hipFFT-rocm-5.0.2.orig/cmake/dependencies.cmake
++++ hipFFT-rocm-5.0.2/cmake/dependencies.cmake
+@@ -21,9 +21,6 @@
+ #
+ # 
#############################################################################
+ 
+-# Git
+-find_package(Git REQUIRED)
+-
+ # HIP
+ if( NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
+   if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
+Index: hipFFT-rocm-5.0.2/clients/CMakeLists.txt
+===================================================================
+--- hipFFT-rocm-5.0.2.orig/clients/CMakeLists.txt
++++ hipFFT-rocm-5.0.2/clients/CMakeLists.txt
+@@ -54,16 +54,6 @@ list( APPEND CMAKE_MODULE_PATH ${CMAKE_C
+ 
+ include( build-options )
+ 
+-if( GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git" )
+-  message(STATUS "rocFFT submodule update")
+-  execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init 
--recursive
+-    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/clients/rocFFT
+-    RESULT_VARIABLE GIT_SUBMOD_RESULT)
+-  if( NOT GIT_SUBMOD_RESULT EQUAL "0" )
+-    message(FATAL_ERROR "git submodule update --init --recursive failed with 
${GIT_SUBMOD_RESULT}, please checkout submodules manually.")
+-  endif( )
+-endif( )
+-
+ if( NOT EXISTS "${CMAKE_SOURCE_DIR}/clients/rocFFT/CMakeLists.txt" )
+   message(FATAL_ERROR "The rocFFT submodule is not present!  Please update 
git submodules and try again. 
${CMAKE_CURRENT_SOURCE_DIR}/clients/rocFFT/CMakeLists.txt")
+ endif( )

diff --git a/sci-libs/hipFFT/hipFFT-5.0.2.ebuild 
b/sci-libs/hipFFT/hipFFT-5.0.2.ebuild
new file mode 100644
index 000000000000..bf7e339f002a
--- /dev/null
+++ b/sci-libs/hipFFT/hipFFT-5.0.2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="CU / ROCM agnostic hip FFT implementation"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/hipFFT";
+SRC_URI="https://github.com/ROCmSoftwarePlatform/hipFFT/archive/refs/tags/rocm-${PV}.tar.gz
 -> hipFFT-rocm-${PV}.tar.gz
+       test? ( 
https://github.com/ROCmSoftwarePlatform/rocFFT/archive/rocm-${PV}.tar.gz -> 
rocFFT-${PV}.tar.gz )"
+
+LICENSE="MIT"
+KEYWORDS="~amd64"
+IUSE="benchmark test"
+SLOT="0/$(ver_cut 1-2)"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-util/hip:${SLOT}
+       sci-libs/rocFFT:${SLOT}"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       test? (
+               dev-cpp/gtest
+               dev-libs/boost
+)"
+
+S="${WORKDIR}/hipFFT-rocm-${PV}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-5.0.2-gentoo-install-locations.patch"
+       "${FILESDIR}/${PN}-5.0.2-remove-git-dependency.patch"
+       "${FILESDIR}/${PN}-4.3.0-add-complex-header.patch"
+)
+
+src_prepare() {
+       use test && rmdir rocFFT && ln -s ../rocFFT-rocm-${PV} rocFFT
+       sed -e "/CMAKE_INSTALL_LIBDIR/d" -i CMakeLists.txt || die
+       CXX=hipcc cmake_src_prepare
+}
+
+src_configure() {
+       # Grant access to the device
+       addwrite /dev/kfd
+       addpredict /dev/dri/
+
+       local mycmakeargs=(
+               -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+               -DCMAKE_INSTALL_INCLUDEDIR="include/hipfft"
+               -DCMAKE_SKIP_RPATH=ON
+               -DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake"
+               -DHIP_ROOT_DIR="${EPREFIX}/usr"
+               -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
+               -DBUILD_CLIENTS_RIDER=$(usex benchmark ON OFF)
+               ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
+       )
+
+       export CXX=hipcc
+       cmake_src_configure
+}
+
+src_test () {
+       addwrite /dev/kfd
+       addpredict /dev/dri
+       cd "${BUILD_DIR}/clients/staging" || die
+       einfo "Running hipfft-test"
+       LD_LIBRARY_PATH=${BUILD_DIR}/library ./hipfft-test || die
+}
+
+src_install() {
+       cmake_src_install
+       if use benchmark; then
+               cd "${BUILD_DIR}/clients/staging" || die
+               dobin hipfft-rider
+       fi
+}

Reply via email to