summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyangWu <xgreenlandforwyy@gmail.com>2022-01-14 21:39:35 +0800
committerBenda Xu <heroxbd@gentoo.org>2022-01-26 21:47:44 +0800
commitfab1eab11ad3bebaae0cee85a6ffa4d904bb6416 (patch)
tree6b389c741d2311a6b507bba13d137e043c51df41 /sci-libs
parentdev-libs/nss: drop 3.68.1 (diff)
downloadgentoo-fab1eab11ad3bebaae0cee85a6ffa4d904bb6416.tar.gz
gentoo-fab1eab11ad3bebaae0cee85a6ffa4d904bb6416.tar.bz2
gentoo-fab1eab11ad3bebaae0cee85a6ffa4d904bb6416.zip
sci-libs/rocSOLVER: Next generation LAPACK implementation for ROCm
It is the lapack package of ROCm GPGPU frame work, dependency of hipBLAS and many other GPU accelerated frameworks (e.g. tensorflow) Closes: https://github.com/gentoo/gentoo/pull/23789 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/rocSOLVER/Manifest1
-rw-r--r--sci-libs/rocSOLVER/files/rocSOLVER-4.2.0-add-stdint-header.patch12
-rw-r--r--sci-libs/rocSOLVER/files/rocSOLVER-4.3.0-link-blas.patch21
-rw-r--r--sci-libs/rocSOLVER/metadata.xml19
-rw-r--r--sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild75
5 files changed, 128 insertions, 0 deletions
diff --git a/sci-libs/rocSOLVER/Manifest b/sci-libs/rocSOLVER/Manifest
new file mode 100644
index 000000000000..e0d75a8c6951
--- /dev/null
+++ b/sci-libs/rocSOLVER/Manifest
@@ -0,0 +1 @@
+DIST rocSOLVER-4.3.0.tar.gz 454249 BLAKE2B 727ae416d85c5a19983257d2a0b01836013c1d69cddf3334b2c1b808b96b401db938b46b7ecf1e7faf26ff555374d1d3abed74abbe7be47110a36b44019469ee SHA512 2910e1cfad4d17a2877e2ae572d80179b84903c632652571c01bd12856c92c22e073ea1005ed9aac04244b4c502a7e0c18d96445e57658ae8eb5b320bada549b
diff --git a/sci-libs/rocSOLVER/files/rocSOLVER-4.2.0-add-stdint-header.patch b/sci-libs/rocSOLVER/files/rocSOLVER-4.2.0-add-stdint-header.patch
new file mode 100644
index 000000000000..4afff8f467ea
--- /dev/null
+++ b/sci-libs/rocSOLVER/files/rocSOLVER-4.2.0-add-stdint-header.patch
@@ -0,0 +1,12 @@
+fix compilation error rocsolver-extra-types.h:11:9: error: unknown type name 'uint32_t'
+--- a/library/include/rocsolver-extra-types.h
++++ b/library/include/rocsolver-extra-types.h
+@@ -5,6 +5,8 @@
+ #ifndef ROCSOLVER_EXTRAS_H_
+ #define ROCSOLVER_EXTRAS_H_
+
++#include "stdint.h"
++
+ /*! \brief Used to specify the logging layer mode using a bitwise combination
+ *of rocblas_layer_mode values.
+ ********************************************************************************/
diff --git a/sci-libs/rocSOLVER/files/rocSOLVER-4.3.0-link-blas.patch b/sci-libs/rocSOLVER/files/rocSOLVER-4.3.0-link-blas.patch
new file mode 100644
index 000000000000..407582831142
--- /dev/null
+++ b/sci-libs/rocSOLVER/files/rocSOLVER-4.3.0-link-blas.patch
@@ -0,0 +1,21 @@
+Should link blas otherwise ld return error adding symbols: DSO missing from command line
+--- orig/clients/benchmarks/CMakeLists.txt
++++ rocSOLVER-rocm-4.3.0/clients/benchmarks/CMakeLists.txt
+@@ -17,6 +17,7 @@ target_include_directories( rocsolver-be
+ )
+
+ target_link_libraries( rocsolver-bench PRIVATE
++ blas
+ cblas
+ lapack
+ Threads::Threads
+--- orig/clients/gtest/CMakeLists.txt
++++ rocSOLVER-rocm-4.3.0/clients/gtest/CMakeLists.txt
+@@ -87,6 +87,7 @@ target_include_directories( rocsolver-te
+ )
+
+ target_link_libraries( rocsolver-test PRIVATE
++ blas
+ cblas
+ lapack
+ GTest::GTest
diff --git a/sci-libs/rocSOLVER/metadata.xml b/sci-libs/rocSOLVER/metadata.xml
new file mode 100644
index 000000000000..344dd1337031
--- /dev/null
+++ b/sci-libs/rocSOLVER/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>gentoo@holzke.net</email>
+ <name>Wilfried Holzke</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>xgreenlandforwyy@gmail.com</email>
+ <name>Yiyang Wu</name>
+ </maintainer>
+ <use>
+ <flag name="test">Perform rocsolver-test to compare the result between rocSOLVER and system LAPACK.</flag>
+ <flag name="benchmark">Build and install rocsolver-bench.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild b/sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild
new file mode 100644
index 000000000000..c017b7ad31a0
--- /dev/null
+++ b/sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="Implementation of a subset of LAPACK functionality on the ROCm platform"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocSOLVER"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocSOLVER/archive/rocm-${PV}.tar.gz -> rocSOLVER-${PV}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="test benchmark"
+
+RDEPEND="dev-util/hip:${SLOT}
+ sci-libs/rocBLAS:${SLOT}
+ benchmark? ( virtual/blas )"
+DEPEND="${RDEPEND}"
+BDEPEND="test? ( dev-cpp/gtest
+ virtual/blas )"
+
+PATCHES=(
+ "${FILESDIR}/rocSOLVER-4.2.0-add-stdint-header.patch"
+ "${FILESDIR}/rocSOLVER-4.3.0-link-blas.patch"
+)
+
+RESTRICT="!test? ( test )"
+
+S=${WORKDIR}/${PN}-rocm-${PV}
+
+src_prepare() {
+ sed -e "s: PREFIX rocsolver:# PREFIX rocsolver:" -i library/src/CMakeLists.txt
+ sed -e "s:\$<INSTALL_INTERFACE\:include>:\$<INSTALL_INTERFACE\:include/rocsolver>:" -i library/src/CMakeLists.txt
+ sed -e "s:rocm_install_symlink_subdir( rocsolver ):#rocm_install_symlink_subdir( rocsolver ):" -i library/src/CMakeLists.txt
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Grant access to the device
+ addwrite /dev/kfd
+ addpredict /dev/dri/
+
+ local mycmakeargs=(
+ -Wno-dev
+ -DCMAKE_SKIP_RPATH=ON
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+ -DCMAKE_INSTALL_INCLUDEDIR="${EPREFIX}/usr/include/rocsolver"
+ -DBUILD_CLIENTS_SAMPLES=NO
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
+ ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
+ )
+
+ CXX="hipcc" cmake_src_configure
+}
+
+src_test() {
+ addwrite /dev/kfd
+ addwrite /dev/dri/
+ cd "${BUILD_DIR}/clients/staging" || die
+ LD_LIBRARY_PATH="${BUILD_DIR}/library/src" ./rocsolver-test || die
+}
+
+src_install() {
+ cmake_src_install
+
+ if use benchmark; then
+ cd "${BUILD_DIR}" || die
+ dobin clients/staging/rocsolver-bench
+ fi
+}