From 56c61822dbdf76f1e2eff9630c3604cc1387127e Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Mon, 9 Dec 2024 18:07:40 +0000 Subject: [PATCH] sci-libs/hipSOLVER: add 6.3.0 Signed-off-by: Sv. Lockal Signed-off-by: Sam James --- sci-libs/hipSOLVER/Manifest | 1 + .../files/hipSOLVER-6.3.0-find-cholmod.patch | 56 +++++++++++++++++++ sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild | 2 +- sci-libs/hipSOLVER/hipSOLVER-6.3.0.ebuild | 49 ++++++++++++++++ sci-libs/hipSOLVER/metadata.xml | 2 +- 5 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 sci-libs/hipSOLVER/files/hipSOLVER-6.3.0-find-cholmod.patch create mode 100644 sci-libs/hipSOLVER/hipSOLVER-6.3.0.ebuild diff --git a/sci-libs/hipSOLVER/Manifest b/sci-libs/hipSOLVER/Manifest index bb01207f1e209..e017ef01d1158 100644 --- a/sci-libs/hipSOLVER/Manifest +++ b/sci-libs/hipSOLVER/Manifest @@ -1,2 +1,3 @@ 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 +DIST hipSOLVER-rocm-6.3.0.tar.gz 2575560 BLAKE2B 293a149e162e74bbf5ddc143bb5bb3fffe52fbe0a53f7ad2d3141fb91cd2fe1108f6a12c976e5b4b91de98b146a84f7290f073d6226214e2dbc13ccd1ddca26c SHA512 a648472695c917e3eab49414ceb6eb9a1c4a6dc3f667907f7d9a67f873d8826588dad823f74b8498bc81c23741a52b745451d13e78079e86d95b36da9b789a7b diff --git a/sci-libs/hipSOLVER/files/hipSOLVER-6.3.0-find-cholmod.patch b/sci-libs/hipSOLVER/files/hipSOLVER-6.3.0-find-cholmod.patch new file mode 100644 index 0000000000000..32c049c5947f2 --- /dev/null +++ b/sci-libs/hipSOLVER/files/hipSOLVER-6.3.0-find-cholmod.patch @@ -0,0 +1,56 @@ +Builds with -DBUILD_WITH_SPARSE=ON are broken +Upstream bug: https://github.com/ROCm/hipSOLVER/issues/347 +--- a/library/src/amd_detail/dlopen/cholmod.hpp ++++ b/library/src/amd_detail/dlopen/cholmod.hpp +@@ -24,7 +24,7 @@ + #include "lib_macros.hpp" + + #ifdef HAVE_ROCSPARSE +-#include ++#include + #else + + // constants +--- a/library/src/CMakeLists.txt ++++ b/library/src/CMakeLists.txt +@@ -42,8 +42,6 @@ prepend_path(".." hipsolver_headers_public relative_hipsolver_headers_public) + + if(NOT USE_CUDA) + set(hipsolver_source +- "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/dlopen/cholmod.cpp" +- "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/dlopen/rocsparse.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/hipsolver_conversions.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/hipsolver.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/hipsolver_dense.cpp" +@@ -52,6 +50,12 @@ if(NOT USE_CUDA) + "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/hipsolver_sparse.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/common/hipsolver_dense_common.cpp" + ) ++ if (NOT BUILD_WITH_SPARSE) ++ list(APPEND hipsolver_source ++ "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/dlopen/cholmod.cpp" ++ "${CMAKE_CURRENT_SOURCE_DIR}/amd_detail/dlopen/rocsparse.cpp" ++ ) ++ endif() + else() + set(hipsolver_source + "${CMAKE_CURRENT_SOURCE_DIR}/nvidia_detail/hipsolver_conversions.cpp" +@@ -149,14 +153,11 @@ if(NOT USE_CUDA) + list(APPEND static_depends PACKAGE rocsparse) + endif() + +- find_package(CHOLMOD QUIET) +- if(NOT TARGET SuiteSparse::CHOLMOD) +- # try again with the custom find modules for older versions of suitesparse +- list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/suitesparse) +- find_package(CHOLMOD REQUIRED) +- endif() ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(CHOLMOD REQUIRED IMPORTED_TARGET cholmod) ++ ++ target_link_libraries(hipsolver PRIVATE roc::rocsparse PkgConfig::CHOLMOD) + +- target_link_libraries( hipsolver PRIVATE roc::rocsparse SuiteSparse::CHOLMOD) + set_source_files_properties(${hipsolver_source} + PROPERTIES + COMPILE_DEFINITIONS HAVE_ROCSPARSE diff --git a/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild b/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild index 99c4a9c0ca41b..1a010790ca8da 100644 --- a/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild +++ b/sci-libs/hipSOLVER/hipSOLVER-6.1.1.ebuild @@ -22,7 +22,7 @@ IUSE="sparse" RESTRICT="test" RDEPEND=" - dev-util/hip + dev-util/hip:${SLOT} sci-libs/rocSOLVER:${SLOT}[${ROCM_USEDEP}] sparse? ( sci-libs/suitesparseconfig diff --git a/sci-libs/hipSOLVER/hipSOLVER-6.3.0.ebuild b/sci-libs/hipSOLVER/hipSOLVER-6.3.0.ebuild new file mode 100644 index 0000000000000..ea8bafabf7c51 --- /dev/null +++ b/sci-libs/hipSOLVER/hipSOLVER-6.3.0.ebuild @@ -0,0 +1,49 @@ +# 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:${SLOT} + sci-libs/rocSOLVER:${SLOT}[${ROCM_USEDEP}] + sparse? ( + sci-libs/suitesparseconfig + sci-libs/cholmod + ) +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-6.3.0-find-cholmod.patch +) + +src_configure() { + rocm_use_hipcc + + local mycmakeargs=( + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + -DBUILD_WITH_SPARSE=$(usex sparse ON OFF) + ) + + cmake_src_configure +} diff --git a/sci-libs/hipSOLVER/metadata.xml b/sci-libs/hipSOLVER/metadata.xml index 9aa1438b519ca..426f234221d8b 100644 --- a/sci-libs/hipSOLVER/metadata.xml +++ b/sci-libs/hipSOLVER/metadata.xml @@ -14,7 +14,7 @@ Sv. Lockal - ROCmSoftwarePlatform/hipSOLVER + ROCm/hipSOLVER Build hipSOLVER with sparse functionality (sci-libs/cholmod)