1 |
commit: 972c8a73ae779e128b3c9a3b2c1c71b4217c9215 |
2 |
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Sep 1 07:32:49 2022 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 22 01:08:11 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=972c8a73 |
7 |
|
8 |
sci-libs/rocSOLVER: add 5.1.3, using rocm.eclass |
9 |
|
10 |
require dev-libs/libfmt-8 |
11 |
|
12 |
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com> |
13 |
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> |
14 |
|
15 |
sci-libs/rocSOLVER/Manifest | 1 + |
16 |
.../rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch | 173 +++++++++++++++++++++ |
17 |
sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild | 79 ++++++++++ |
18 |
3 files changed, 253 insertions(+) |
19 |
|
20 |
diff --git a/sci-libs/rocSOLVER/Manifest b/sci-libs/rocSOLVER/Manifest |
21 |
index 4a48b1da3b26..d0a72473309d 100644 |
22 |
--- a/sci-libs/rocSOLVER/Manifest |
23 |
+++ b/sci-libs/rocSOLVER/Manifest |
24 |
@@ -1,2 +1,3 @@ |
25 |
DIST rocSOLVER-4.3.0.tar.gz 454249 BLAKE2B 727ae416d85c5a19983257d2a0b01836013c1d69cddf3334b2c1b808b96b401db938b46b7ecf1e7faf26ff555374d1d3abed74abbe7be47110a36b44019469ee SHA512 2910e1cfad4d17a2877e2ae572d80179b84903c632652571c01bd12856c92c22e073ea1005ed9aac04244b4c502a7e0c18d96445e57658ae8eb5b320bada549b |
26 |
DIST rocSOLVER-5.0.2.tar.gz 530085 BLAKE2B f3c3594b5ee2703424da289cc0c520a589da28f9d3f4c04d81cace35a4f77f3ca79ff9a1e7139d83d7a2ae1907083aded99b5d9fbe216d81b225dc1b9fc4105b SHA512 ab349044aba0c1b6b7d0019d15f2bdf068805d2da73790f424ae90835f2d7dd4137d0a641d8edbf98fcb190989f0d0fa57dfc448a376a19e21fd62940046b3a1 |
27 |
+DIST rocSOLVER-5.1.3.tar.gz 545627 BLAKE2B 2cca24a1310efba7f8c66d1614fb50704221ebc8aa50d6aba11083baf9a7427575642fd28218ce80f8a7b83d3406348c2dd18373fb32e533509d01d37cf06927 SHA512 38e7a4ed6b67e83960ad3416d1008f82f895d19dc85427cd6f9c76f00b1ce18f78a4dd73d1ab53ffe81588890cd5545315029e903e2e09b85d6cfb854d405753 |
28 |
|
29 |
diff --git a/sci-libs/rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch b/sci-libs/rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch |
30 |
new file mode 100644 |
31 |
index 000000000000..3f2c0553689b |
32 |
--- /dev/null |
33 |
+++ b/sci-libs/rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch |
34 |
@@ -0,0 +1,173 @@ |
35 |
+Backported from upstream to fix dev-cpp/libfmt-8 compatibility |
36 |
+ |
37 |
+remove changes of CHANGELOG.md from original git commit |
38 |
+ |
39 |
+From 2bbfb8976f6e4d667499c77e41a6433850063e88 Mon Sep 17 00:00:00 2001 |
40 |
+From: Cory Bloor <Cordell.Bloor@×××.com> |
41 |
+Date: Tue, 8 Feb 2022 23:53:57 -0700 |
42 |
+Subject: [PATCH] Fix compatibility with fmt v8.1 (#371) |
43 |
+ |
44 |
+* Make rocsolver_logvalue fmt specializations const |
45 |
+ |
46 |
+This allows for compile-time format string processing in fmt v8.0. |
47 |
+ |
48 |
+* Fix compatibility with fmt v7.1 |
49 |
+ |
50 |
+* Update CHANGELOG.md |
51 |
+--- |
52 |
+ CHANGELOG.md | 2 ++ |
53 |
+ library/src/include/rocsolver_logvalue.hpp | 38 +++++++++++++--------- |
54 |
+ 2 files changed, 25 insertions(+), 15 deletions(-) |
55 |
+ |
56 |
+diff --git a/library/src/include/rocsolver_logvalue.hpp b/library/src/include/rocsolver_logvalue.hpp |
57 |
+index 199f8d57d..9b3791031 100644 |
58 |
+--- a/library/src/include/rocsolver_logvalue.hpp |
59 |
++++ b/library/src/include/rocsolver_logvalue.hpp |
60 |
+@@ -1,5 +1,5 @@ |
61 |
+ /* ************************************************************************ |
62 |
+- * Copyright (c) 2021 Advanced Micro Devices, Inc. |
63 |
++ * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. |
64 |
+ * ************************************************************************ */ |
65 |
+ |
66 |
+ #pragma once |
67 |
+@@ -8,6 +8,14 @@ |
68 |
+ |
69 |
+ #include "rocsolver_datatype2string.hpp" |
70 |
+ |
71 |
++/* The format function for user-defined types cannot be const before fmt v8.0 |
72 |
++ but must be const in fmt v8.1 if the type is used in a tuple. */ |
73 |
++#if FMT_VERSION < 80000 |
74 |
++#define ROCSOLVER_FMT_CONST |
75 |
++#else |
76 |
++#define ROCSOLVER_FMT_CONST const |
77 |
++#endif |
78 |
++ |
79 |
+ /*************************************************************************** |
80 |
+ * Wrapper for types passed to logger, so we can more easily adjust the |
81 |
+ * default way of printing built-in types without doing it globally. (e.g. |
82 |
+@@ -37,7 +45,7 @@ template <typename T> |
83 |
+ struct formatter<rocsolver_logvalue<T>> : formatter<T> |
84 |
+ { |
85 |
+ template <typename FormatCtx> |
86 |
+- auto format(rocsolver_logvalue<T> wrapper, FormatCtx& ctx) |
87 |
++ auto format(rocsolver_logvalue<T> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
88 |
+ { |
89 |
+ return formatter<T>::format(wrapper.value, ctx); |
90 |
+ } |
91 |
+@@ -49,7 +57,7 @@ template <> |
92 |
+ struct formatter<rocsolver_logvalue<bool>> : formatter<char> |
93 |
+ { |
94 |
+ template <typename FormatCtx> |
95 |
+- auto format(rocsolver_logvalue<bool> wrapper, FormatCtx& ctx) |
96 |
++ auto format(rocsolver_logvalue<bool> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
97 |
+ { |
98 |
+ return formatter<char>::format(wrapper.value ? '1' : '0', ctx); |
99 |
+ } |
100 |
+@@ -58,7 +66,7 @@ template <> |
101 |
+ struct formatter<rocsolver_logvalue<rocblas_operation>> : formatter<char> |
102 |
+ { |
103 |
+ template <typename FormatCtx> |
104 |
+- auto format(rocsolver_logvalue<rocblas_operation> wrapper, FormatCtx& ctx) |
105 |
++ auto format(rocsolver_logvalue<rocblas_operation> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
106 |
+ { |
107 |
+ return formatter<char>::format(rocblas2char_operation(wrapper.value), ctx); |
108 |
+ } |
109 |
+@@ -67,7 +75,7 @@ template <> |
110 |
+ struct formatter<rocsolver_logvalue<rocblas_fill>> : formatter<char> |
111 |
+ { |
112 |
+ template <typename FormatCtx> |
113 |
+- auto format(rocsolver_logvalue<rocblas_fill> wrapper, FormatCtx& ctx) |
114 |
++ auto format(rocsolver_logvalue<rocblas_fill> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
115 |
+ { |
116 |
+ return formatter<char>::format(rocblas2char_fill(wrapper.value), ctx); |
117 |
+ } |
118 |
+@@ -76,7 +84,7 @@ template <> |
119 |
+ struct formatter<rocsolver_logvalue<rocblas_diagonal>> : formatter<char> |
120 |
+ { |
121 |
+ template <typename FormatCtx> |
122 |
+- auto format(rocsolver_logvalue<rocblas_diagonal> wrapper, FormatCtx& ctx) |
123 |
++ auto format(rocsolver_logvalue<rocblas_diagonal> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
124 |
+ { |
125 |
+ return formatter<char>::format(rocblas2char_diagonal(wrapper.value), ctx); |
126 |
+ } |
127 |
+@@ -85,7 +93,7 @@ template <> |
128 |
+ struct formatter<rocsolver_logvalue<rocblas_side>> : formatter<char> |
129 |
+ { |
130 |
+ template <typename FormatCtx> |
131 |
+- auto format(rocsolver_logvalue<rocblas_side> wrapper, FormatCtx& ctx) |
132 |
++ auto format(rocsolver_logvalue<rocblas_side> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
133 |
+ { |
134 |
+ return formatter<char>::format(rocblas2char_side(wrapper.value), ctx); |
135 |
+ } |
136 |
+@@ -94,7 +102,7 @@ template <> |
137 |
+ struct formatter<rocsolver_logvalue<rocblas_direct>> : formatter<char> |
138 |
+ { |
139 |
+ template <typename FormatCtx> |
140 |
+- auto format(rocsolver_logvalue<rocblas_direct> wrapper, FormatCtx& ctx) |
141 |
++ auto format(rocsolver_logvalue<rocblas_direct> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
142 |
+ { |
143 |
+ return formatter<char>::format(rocblas2char_direct(wrapper.value), ctx); |
144 |
+ } |
145 |
+@@ -104,7 +112,7 @@ template <> |
146 |
+ struct formatter<rocsolver_logvalue<rocblas_storev>> : formatter<char> |
147 |
+ { |
148 |
+ template <typename FormatCtx> |
149 |
+- auto format(rocsolver_logvalue<rocblas_storev> wrapper, FormatCtx& ctx) |
150 |
++ auto format(rocsolver_logvalue<rocblas_storev> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
151 |
+ { |
152 |
+ return formatter<char>::format(rocblas2char_storev(wrapper.value), ctx); |
153 |
+ } |
154 |
+@@ -113,7 +121,7 @@ template <> |
155 |
+ struct formatter<rocsolver_logvalue<rocblas_workmode>> : formatter<char> |
156 |
+ { |
157 |
+ template <typename FormatCtx> |
158 |
+- auto format(rocsolver_logvalue<rocblas_workmode> wrapper, FormatCtx& ctx) |
159 |
++ auto format(rocsolver_logvalue<rocblas_workmode> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
160 |
+ { |
161 |
+ return formatter<char>::format(rocblas2char_workmode(wrapper.value), ctx); |
162 |
+ } |
163 |
+@@ -122,7 +130,7 @@ template <> |
164 |
+ struct formatter<rocsolver_logvalue<rocblas_svect>> : formatter<char> |
165 |
+ { |
166 |
+ template <typename FormatCtx> |
167 |
+- auto format(rocsolver_logvalue<rocblas_svect> wrapper, FormatCtx& ctx) |
168 |
++ auto format(rocsolver_logvalue<rocblas_svect> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
169 |
+ { |
170 |
+ return formatter<char>::format(rocblas2char_svect(wrapper.value), ctx); |
171 |
+ } |
172 |
+@@ -131,7 +139,7 @@ template <> |
173 |
+ struct formatter<rocsolver_logvalue<rocblas_evect>> : formatter<char> |
174 |
+ { |
175 |
+ template <typename FormatCtx> |
176 |
+- auto format(rocsolver_logvalue<rocblas_evect> wrapper, FormatCtx& ctx) |
177 |
++ auto format(rocsolver_logvalue<rocblas_evect> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
178 |
+ { |
179 |
+ return formatter<char>::format(rocblas2char_evect(wrapper.value), ctx); |
180 |
+ } |
181 |
+@@ -140,7 +148,7 @@ template <> |
182 |
+ struct formatter<rocsolver_logvalue<rocblas_eform>> : formatter<char> |
183 |
+ { |
184 |
+ template <typename FormatCtx> |
185 |
+- auto format(rocsolver_logvalue<rocblas_eform> wrapper, FormatCtx& ctx) |
186 |
++ auto format(rocsolver_logvalue<rocblas_eform> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
187 |
+ { |
188 |
+ return formatter<char>::format(rocblas2char_eform(wrapper.value), ctx); |
189 |
+ } |
190 |
+@@ -149,7 +157,7 @@ template <> |
191 |
+ struct formatter<rocsolver_logvalue<rocblas_datatype>> : formatter<string_view> |
192 |
+ { |
193 |
+ template <typename FormatCtx> |
194 |
+- auto format(rocsolver_logvalue<rocblas_datatype> wrapper, FormatCtx& ctx) |
195 |
++ auto format(rocsolver_logvalue<rocblas_datatype> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
196 |
+ { |
197 |
+ return formatter<string_view>::format(rocblas2string_datatype(wrapper.value), ctx); |
198 |
+ } |
199 |
+@@ -158,7 +166,7 @@ template <> |
200 |
+ struct formatter<rocsolver_logvalue<rocblas_initialization>> : formatter<string_view> |
201 |
+ { |
202 |
+ template <typename FormatCtx> |
203 |
+- auto format(rocsolver_logvalue<rocblas_initialization> wrapper, FormatCtx& ctx) |
204 |
++ auto format(rocsolver_logvalue<rocblas_initialization> wrapper, FormatCtx& ctx) ROCSOLVER_FMT_CONST |
205 |
+ { |
206 |
+ return formatter<string_view>::format(rocblas2string_initialization(wrapper.value), ctx); |
207 |
+ } |
208 |
|
209 |
diff --git a/sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild b/sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild |
210 |
new file mode 100644 |
211 |
index 000000000000..e643014fda76 |
212 |
--- /dev/null |
213 |
+++ b/sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild |
214 |
@@ -0,0 +1,79 @@ |
215 |
+# Copyright 1999-2022 Gentoo Authors |
216 |
+# Distributed under the terms of the GNU General Public License v2 |
217 |
+ |
218 |
+EAPI=8 |
219 |
+ |
220 |
+ROCM_VERSION=${PV} |
221 |
+ |
222 |
+inherit cmake edo rocm |
223 |
+ |
224 |
+DESCRIPTION="Implementation of a subset of LAPACK functionality on the ROCm platform" |
225 |
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocSOLVER" |
226 |
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocSOLVER/archive/rocm-${PV}.tar.gz -> rocSOLVER-${PV}.tar.gz" |
227 |
+ |
228 |
+LICENSE="BSD" |
229 |
+KEYWORDS="~amd64" |
230 |
+SLOT="0/$(ver_cut 1-2)" |
231 |
+ |
232 |
+IUSE="test benchmark" |
233 |
+REQUIRED_USE="${ROCM_REQUIRED_USE}" |
234 |
+ |
235 |
+# sci-libs/rocBLAS:${SLOT} |
236 |
+RDEPEND="dev-util/hip |
237 |
+ sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] |
238 |
+ =dev-libs/libfmt-8* |
239 |
+ benchmark? ( virtual/blas )" |
240 |
+DEPEND="${RDEPEND}" |
241 |
+BDEPEND="test? ( dev-cpp/gtest |
242 |
+ >=dev-util/cmake-3.22 |
243 |
+ virtual/blas )" |
244 |
+ |
245 |
+PATCHES=( |
246 |
+ "${FILESDIR}/${PN}-4.2.0-add-stdint-header.patch" |
247 |
+ "${FILESDIR}/${P}-libfmt8.patch" |
248 |
+) |
249 |
+ |
250 |
+RESTRICT="!test? ( test )" |
251 |
+ |
252 |
+S=${WORKDIR}/${PN}-rocm-${PV} |
253 |
+ |
254 |
+src_prepare() { |
255 |
+ sed -e "s: PREFIX rocsolver:# PREFIX rocsolver:" -i library/src/CMakeLists.txt |
256 |
+ sed -e "s:\$<INSTALL_INTERFACE\:include>:\$<INSTALL_INTERFACE\:include/rocsolver>:" -i library/src/CMakeLists.txt |
257 |
+ sed -e "s:rocm_install_symlink_subdir( rocsolver ):#rocm_install_symlink_subdir( rocsolver ):" -i library/src/CMakeLists.txt |
258 |
+ |
259 |
+ cmake_src_prepare |
260 |
+} |
261 |
+ |
262 |
+src_configure() { |
263 |
+ # avoid sandbox violation |
264 |
+ addpredict /dev/kfd |
265 |
+ addpredict /dev/dri/ |
266 |
+ |
267 |
+ local mycmakeargs=( |
268 |
+ -DCMAKE_SKIP_RPATH=On |
269 |
+ -DAMDGPU_TARGETS="$(get_amdgpu_flags)" |
270 |
+ -Wno-dev |
271 |
+ -DCMAKE_INSTALL_INCLUDEDIR="${EPREFIX}/usr/include/rocsolver" |
272 |
+ -DBUILD_CLIENTS_SAMPLES=NO |
273 |
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) |
274 |
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF) |
275 |
+ ) |
276 |
+ |
277 |
+ CXX=hipcc cmake_src_configure |
278 |
+} |
279 |
+ |
280 |
+src_test() { |
281 |
+ check_amdgpu |
282 |
+ cd "${BUILD_DIR}"/clients/staging || die |
283 |
+ LD_LIBRARY_PATH="${BUILD_DIR}/library/src" edob ./rocsolver-test |
284 |
+} |
285 |
+ |
286 |
+src_install() { |
287 |
+ cmake_src_install |
288 |
+ |
289 |
+ if use benchmark; then |
290 |
+ cd "${BUILD_DIR}" || die |
291 |
+ dobin clients/staging/rocsolver-bench |
292 |
+ fi |
293 |
+} |