Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocSOLVER/, sci-libs/rocSOLVER/files/
Date: Wed, 26 Jan 2022 13:48:52
Message-Id: 1643204864.fab1eab11ad3bebaae0cee85a6ffa4d904bb6416.heroxbd@gentoo
1 commit: fab1eab11ad3bebaae0cee85a6ffa4d904bb6416
2 Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
3 AuthorDate: Fri Jan 14 13:39:35 2022 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 26 13:47:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fab1eab1
7
8 sci-libs/rocSOLVER: Next generation LAPACK implementation for ROCm
9
10 It is the lapack package of ROCm GPGPU frame work, dependency of hipBLAS
11 and many other GPU accelerated frameworks (e.g. tensorflow)
12
13 Closes: https://github.com/gentoo/gentoo/pull/23789
14
15 Package-Manager: Portage-3.0.30, Repoman-3.0.3
16 Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
17 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
18
19 sci-libs/rocSOLVER/Manifest | 1 +
20 .../files/rocSOLVER-4.2.0-add-stdint-header.patch | 12 ++++
21 .../files/rocSOLVER-4.3.0-link-blas.patch | 21 ++++++
22 sci-libs/rocSOLVER/metadata.xml | 19 ++++++
23 sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild | 75 ++++++++++++++++++++++
24 5 files changed, 128 insertions(+)
25
26 diff --git a/sci-libs/rocSOLVER/Manifest b/sci-libs/rocSOLVER/Manifest
27 new file mode 100644
28 index 000000000000..e0d75a8c6951
29 --- /dev/null
30 +++ b/sci-libs/rocSOLVER/Manifest
31 @@ -0,0 +1 @@
32 +DIST rocSOLVER-4.3.0.tar.gz 454249 BLAKE2B 727ae416d85c5a19983257d2a0b01836013c1d69cddf3334b2c1b808b96b401db938b46b7ecf1e7faf26ff555374d1d3abed74abbe7be47110a36b44019469ee SHA512 2910e1cfad4d17a2877e2ae572d80179b84903c632652571c01bd12856c92c22e073ea1005ed9aac04244b4c502a7e0c18d96445e57658ae8eb5b320bada549b
33
34 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
35 new file mode 100644
36 index 000000000000..4afff8f467ea
37 --- /dev/null
38 +++ b/sci-libs/rocSOLVER/files/rocSOLVER-4.2.0-add-stdint-header.patch
39 @@ -0,0 +1,12 @@
40 +fix compilation error rocsolver-extra-types.h:11:9: error: unknown type name 'uint32_t'
41 +--- a/library/include/rocsolver-extra-types.h
42 ++++ b/library/include/rocsolver-extra-types.h
43 +@@ -5,6 +5,8 @@
44 + #ifndef ROCSOLVER_EXTRAS_H_
45 + #define ROCSOLVER_EXTRAS_H_
46 +
47 ++#include "stdint.h"
48 ++
49 + /*! \brief Used to specify the logging layer mode using a bitwise combination
50 + *of rocblas_layer_mode values.
51 + ********************************************************************************/
52
53 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
54 new file mode 100644
55 index 000000000000..407582831142
56 --- /dev/null
57 +++ b/sci-libs/rocSOLVER/files/rocSOLVER-4.3.0-link-blas.patch
58 @@ -0,0 +1,21 @@
59 +Should link blas otherwise ld return error adding symbols: DSO missing from command line
60 +--- orig/clients/benchmarks/CMakeLists.txt
61 ++++ rocSOLVER-rocm-4.3.0/clients/benchmarks/CMakeLists.txt
62 +@@ -17,6 +17,7 @@ target_include_directories( rocsolver-be
63 + )
64 +
65 + target_link_libraries( rocsolver-bench PRIVATE
66 ++ blas
67 + cblas
68 + lapack
69 + Threads::Threads
70 +--- orig/clients/gtest/CMakeLists.txt
71 ++++ rocSOLVER-rocm-4.3.0/clients/gtest/CMakeLists.txt
72 +@@ -87,6 +87,7 @@ target_include_directories( rocsolver-te
73 + )
74 +
75 + target_link_libraries( rocsolver-test PRIVATE
76 ++ blas
77 + cblas
78 + lapack
79 + GTest::GTest
80
81 diff --git a/sci-libs/rocSOLVER/metadata.xml b/sci-libs/rocSOLVER/metadata.xml
82 new file mode 100644
83 index 000000000000..344dd1337031
84 --- /dev/null
85 +++ b/sci-libs/rocSOLVER/metadata.xml
86 @@ -0,0 +1,19 @@
87 +<?xml version="1.0" encoding="UTF-8"?>
88 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
89 +<pkgmetadata>
90 + <maintainer type="project">
91 + <email>sci@g.o</email>
92 + </maintainer>
93 + <maintainer type="person">
94 + <email>gentoo@××××××.net</email>
95 + <name>Wilfried Holzke</name>
96 + </maintainer>
97 + <maintainer type="person">
98 + <email>xgreenlandforwyy@×××××.com</email>
99 + <name>Yiyang Wu</name>
100 + </maintainer>
101 + <use>
102 + <flag name="test">Perform rocsolver-test to compare the result between rocSOLVER and system LAPACK.</flag>
103 + <flag name="benchmark">Build and install rocsolver-bench.</flag>
104 + </use>
105 +</pkgmetadata>
106
107 diff --git a/sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild b/sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild
108 new file mode 100644
109 index 000000000000..c017b7ad31a0
110 --- /dev/null
111 +++ b/sci-libs/rocSOLVER/rocSOLVER-4.3.0.ebuild
112 @@ -0,0 +1,75 @@
113 +# Copyright 1999-2022 Gentoo Authors
114 +# Distributed under the terms of the GNU General Public License v2
115 +
116 +EAPI=7
117 +
118 +inherit cmake
119 +
120 +DESCRIPTION="Implementation of a subset of LAPACK functionality on the ROCm platform"
121 +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocSOLVER"
122 +SRC_URI="https://github.com/ROCmSoftwarePlatform/rocSOLVER/archive/rocm-${PV}.tar.gz -> rocSOLVER-${PV}.tar.gz"
123 +
124 +LICENSE="BSD"
125 +KEYWORDS="~amd64"
126 +SLOT="0/$(ver_cut 1-2)"
127 +
128 +IUSE="test benchmark"
129 +
130 +RDEPEND="dev-util/hip:${SLOT}
131 + sci-libs/rocBLAS:${SLOT}
132 + benchmark? ( virtual/blas )"
133 +DEPEND="${RDEPEND}"
134 +BDEPEND="test? ( dev-cpp/gtest
135 + virtual/blas )"
136 +
137 +PATCHES=(
138 + "${FILESDIR}/rocSOLVER-4.2.0-add-stdint-header.patch"
139 + "${FILESDIR}/rocSOLVER-4.3.0-link-blas.patch"
140 +)
141 +
142 +RESTRICT="!test? ( test )"
143 +
144 +S=${WORKDIR}/${PN}-rocm-${PV}
145 +
146 +src_prepare() {
147 + sed -e "s: PREFIX rocsolver:# PREFIX rocsolver:" -i library/src/CMakeLists.txt
148 + sed -e "s:\$<INSTALL_INTERFACE\:include>:\$<INSTALL_INTERFACE\:include/rocsolver>:" -i library/src/CMakeLists.txt
149 + sed -e "s:rocm_install_symlink_subdir( rocsolver ):#rocm_install_symlink_subdir( rocsolver ):" -i library/src/CMakeLists.txt
150 +
151 + cmake_src_prepare
152 +}
153 +
154 +src_configure() {
155 + # Grant access to the device
156 + addwrite /dev/kfd
157 + addpredict /dev/dri/
158 +
159 + local mycmakeargs=(
160 + -Wno-dev
161 + -DCMAKE_SKIP_RPATH=ON
162 + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
163 + -DCMAKE_INSTALL_INCLUDEDIR="${EPREFIX}/usr/include/rocsolver"
164 + -DBUILD_CLIENTS_SAMPLES=NO
165 + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
166 + -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
167 + ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
168 + )
169 +
170 + CXX="hipcc" cmake_src_configure
171 +}
172 +
173 +src_test() {
174 + addwrite /dev/kfd
175 + addwrite /dev/dri/
176 + cd "${BUILD_DIR}/clients/staging" || die
177 + LD_LIBRARY_PATH="${BUILD_DIR}/library/src" ./rocsolver-test || die
178 +}
179 +
180 +src_install() {
181 + cmake_src_install
182 +
183 + if use benchmark; then
184 + cd "${BUILD_DIR}" || die
185 + dobin clients/staging/rocsolver-bench
186 + fi
187 +}