commit:     1f2509f3c9b9fff1b310259ded9ffd8145f9373f
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Wed Mar 20 12:06:34 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 09:19:21 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f2509f3

sci-libs/hipSOLVER: add 6.1.1

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

 sci-libs/hipSOLVER/Manifest                        |  1 +
 .../files/hipSOLVER-6.1.1-find-cholmod.patch       | 29 +++++++++++++
 sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild          | 47 ++++++++++++++++++++++
 sci-libs/hipSOLVER/metadata.xml                    |  3 ++
 4 files changed, 80 insertions(+)

diff --git a/sci-libs/hipSOLVER/Manifest b/sci-libs/hipSOLVER/Manifest
index 44e9bd41301a..bb01207f1e20 100644
--- a/sci-libs/hipSOLVER/Manifest
+++ b/sci-libs/hipSOLVER/Manifest
@@ -1 +1,2 @@
 DIST hipSOLVER-rocm-5.7.1.tar.gz 1516012 BLAKE2B 
8d0966d34877978784b9872150283719602465c85036c3a74a72a2fe7c516b6029af3f4aefbc022088b2cf37bb1e0a450c0221aef0ac3227018020de340adfcd
 SHA512 
f9c14b51ea582f17d1b323c7d066d9c0c95f4250f08515768d7a11067774fd2841fa3dec7354d3c98e56bd8dd53cff3b993c68b1d7df4b24f562b3afe9c4625e
+DIST hipSOLVER-rocm-6.1.1.tar.gz 2553462 BLAKE2B 
77731b876a7fe5f80f79e5af5128a84d8a5d4dee6d511f3e1cf4964845b636380f7f1e19f07e84ed24b98e99c3bdfbba623b97b48cf4ea1bc09a4c1bd3dccaed
 SHA512 
4f28ecd807717013318f293df8c48d7674f64fd3a538c2b827f4188a00a36165f48277d5ac50e806461d52a8a3b6d626cab91ff7c6687b17fea2580461e08de9

diff --git a/sci-libs/hipSOLVER/files/hipSOLVER-6.1.1-find-cholmod.patch 
b/sci-libs/hipSOLVER/files/hipSOLVER-6.1.1-find-cholmod.patch
new file mode 100644
index 000000000000..da43f4ff116b
--- /dev/null
+++ b/sci-libs/hipSOLVER/files/hipSOLVER-6.1.1-find-cholmod.patch
@@ -0,0 +1,29 @@
+cholmod.h is in /usr/include in Gentoo, use pkg-config to find it
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -221,11 +221,9 @@ if( NOT USE_CUDA )
+   if( BUILD_WITH_SPARSE )
+     list(APPEND hipsolver_pkgdeps "rocsparse >= 2.3.0")
+ 
+-    if( SYSTEM_OS STREQUAL "centos" OR SYSTEM_OS STREQUAL "rhel" )
+-      list(APPEND hipsolver_pkgdeps "suitesparse")
+-    else()
+-      list(APPEND hipsolver_pkgdeps "libcholmod3" "libsuitesparseconfig5")
+-    endif()
++    find_package(PkgConfig REQUIRED)
++    pkg_check_modules(CHOLMOD REQUIRED IMPORTED_TARGET cholmod)
++    target_link_libraries(hipsolver-common INTERFACE PkgConfig::CHOLMOD)
+   endif( )
+ 
+   rocm_package_add_dependencies(DEPENDS ${hipsolver_pkgdeps})
+--- a/library/src/amd_detail/hipsolver_sparse.cpp
++++ b/library/src/amd_detail/hipsolver_sparse.cpp
+@@ -45,7 +45,7 @@
+ 
+ #ifdef HAVE_ROCSPARSE
+ #include <rocsparse/rocsparse.h>
+-#include <suitesparse/cholmod.h>
++#include <cholmod.h>
+ #endif
+ 
+ #undef TRUE

diff --git a/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild 
b/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild
new file mode 100644
index 000000000000..be450babaed3
--- /dev/null
+++ b/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ROCM_VERSION=${PV}
+
+inherit cmake rocm
+
+DESCRIPTION="CU / ROCM agnostic marshalling library for LAPACK routines on the 
GPU"
+HOMEPAGE="https://github.com/ROCm/hipSOLVER";
+SRC_URI="https://github.com/ROCm/hipSOLVER/archive/refs/tags/rocm-${PV}.tar.gz 
-> hipSOLVER-rocm-${PV}.tar.gz"
+S="${WORKDIR}/hipSOLVER-rocm-${PV}"
+
+REQUIRED_USE="${ROCM_REQUIRED_USE}"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+IUSE="sparse"
+
+RESTRICT="test"
+
+RDEPEND="
+       dev-util/hip
+       sci-libs/rocSOLVER:${SLOT}[${ROCM_USEDEP}]
+       sparse? (
+               sci-libs/suitesparseconfig
+               sci-libs/cholmod
+       )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.1.1-find-cholmod.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DAMDGPU_TARGETS="$(get_amdgpu_flags)"
+               -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF
+               -DROCM_SYMLINK_LIBS=OFF
+               -DBUILD_WITH_SPARSE=$(usex sparse ON OFF)
+       )
+
+       CXX=hipcc cmake_src_configure
+}

diff --git a/sci-libs/hipSOLVER/metadata.xml b/sci-libs/hipSOLVER/metadata.xml
index dfd45574f216..9aa1438b519c 100644
--- a/sci-libs/hipSOLVER/metadata.xml
+++ b/sci-libs/hipSOLVER/metadata.xml
@@ -16,4 +16,7 @@
   <upstream>
     <remote-id type="github">ROCmSoftwarePlatform/hipSOLVER</remote-id>
   </upstream>
+  <use>
+    <flag name="sparse">Build hipSOLVER with sparse functionality 
(sci-libs/cholmod)</flag>
+  </use>
 </pkgmetadata>

Reply via email to