commit:     972c8a73ae779e128b3c9a3b2c1c71b4217c9215
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Thu Sep  1 07:32:49 2022 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 01:08:11 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=972c8a73

sci-libs/rocSOLVER: add 5.1.3, using rocm.eclass

require dev-libs/libfmt-8

Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 sci-libs/rocSOLVER/Manifest                        |   1 +
 .../rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch  | 173 +++++++++++++++++++++
 sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild          |  79 ++++++++++
 3 files changed, 253 insertions(+)

diff --git a/sci-libs/rocSOLVER/Manifest b/sci-libs/rocSOLVER/Manifest
index 4a48b1da3b26..d0a72473309d 100644
--- a/sci-libs/rocSOLVER/Manifest
+++ b/sci-libs/rocSOLVER/Manifest
@@ -1,2 +1,3 @@
 DIST rocSOLVER-4.3.0.tar.gz 454249 BLAKE2B 
727ae416d85c5a19983257d2a0b01836013c1d69cddf3334b2c1b808b96b401db938b46b7ecf1e7faf26ff555374d1d3abed74abbe7be47110a36b44019469ee
 SHA512 
2910e1cfad4d17a2877e2ae572d80179b84903c632652571c01bd12856c92c22e073ea1005ed9aac04244b4c502a7e0c18d96445e57658ae8eb5b320bada549b
 DIST rocSOLVER-5.0.2.tar.gz 530085 BLAKE2B 
f3c3594b5ee2703424da289cc0c520a589da28f9d3f4c04d81cace35a4f77f3ca79ff9a1e7139d83d7a2ae1907083aded99b5d9fbe216d81b225dc1b9fc4105b
 SHA512 
ab349044aba0c1b6b7d0019d15f2bdf068805d2da73790f424ae90835f2d7dd4137d0a641d8edbf98fcb190989f0d0fa57dfc448a376a19e21fd62940046b3a1
+DIST rocSOLVER-5.1.3.tar.gz 545627 BLAKE2B 
2cca24a1310efba7f8c66d1614fb50704221ebc8aa50d6aba11083baf9a7427575642fd28218ce80f8a7b83d3406348c2dd18373fb32e533509d01d37cf06927
 SHA512 
38e7a4ed6b67e83960ad3416d1008f82f895d19dc85427cd6f9c76f00b1ce18f78a4dd73d1ab53ffe81588890cd5545315029e903e2e09b85d6cfb854d405753

diff --git a/sci-libs/rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch 
b/sci-libs/rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch
new file mode 100644
index 000000000000..3f2c0553689b
--- /dev/null
+++ b/sci-libs/rocSOLVER/files/rocSOLVER-5.1.3-libfmt8.patch
@@ -0,0 +1,173 @@
+Backported from upstream to fix dev-cpp/libfmt-8 compatibility
+
+remove changes of CHANGELOG.md from original git commit
+
+From 2bbfb8976f6e4d667499c77e41a6433850063e88 Mon Sep 17 00:00:00 2001
+From: Cory Bloor <cordell.bl...@amd.com>
+Date: Tue, 8 Feb 2022 23:53:57 -0700
+Subject: [PATCH] Fix compatibility with fmt v8.1 (#371)
+
+* Make rocsolver_logvalue fmt specializations const
+
+This allows for compile-time format string processing in fmt v8.0.
+
+* Fix compatibility with fmt v7.1
+
+* Update CHANGELOG.md
+---
+ CHANGELOG.md                               |  2 ++
+ library/src/include/rocsolver_logvalue.hpp | 38 +++++++++++++---------
+ 2 files changed, 25 insertions(+), 15 deletions(-)
+
+diff --git a/library/src/include/rocsolver_logvalue.hpp 
b/library/src/include/rocsolver_logvalue.hpp
+index 199f8d57d..9b3791031 100644
+--- a/library/src/include/rocsolver_logvalue.hpp
++++ b/library/src/include/rocsolver_logvalue.hpp
+@@ -1,5 +1,5 @@
+ /* ************************************************************************
+- * Copyright (c) 2021 Advanced Micro Devices, Inc.
++ * Copyright (c) 2021-2022 Advanced Micro Devices, Inc.
+  * ************************************************************************ */
+ 
+ #pragma once
+@@ -8,6 +8,14 @@
+ 
+ #include "rocsolver_datatype2string.hpp"
+ 
++/* The format function for user-defined types cannot be const before fmt v8.0
++   but must be const in fmt v8.1 if the type is used in a tuple. */
++#if FMT_VERSION < 80000
++#define ROCSOLVER_FMT_CONST
++#else
++#define ROCSOLVER_FMT_CONST const
++#endif
++
+ /***************************************************************************
+  * Wrapper for types passed to logger, so we can more easily adjust the
+  * default way of printing built-in types without doing it globally. (e.g.
+@@ -37,7 +45,7 @@ template <typename T>
+ struct formatter<rocsolver_logvalue<T>> : formatter<T>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<T> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<T> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<T>::format(wrapper.value, ctx);
+     }
+@@ -49,7 +57,7 @@ template <>
+ struct formatter<rocsolver_logvalue<bool>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<bool> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<bool> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(wrapper.value ? '1' : '0', ctx);
+     }
+@@ -58,7 +66,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_operation>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_operation> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_operation> wrapper, FormatCtx& 
ctx) ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_operation(wrapper.value), 
ctx);
+     }
+@@ -67,7 +75,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_fill>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_fill> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_fill> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_fill(wrapper.value), ctx);
+     }
+@@ -76,7 +84,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_diagonal>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_diagonal> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_diagonal> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_diagonal(wrapper.value), 
ctx);
+     }
+@@ -85,7 +93,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_side>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_side> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_side> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_side(wrapper.value), ctx);
+     }
+@@ -94,7 +102,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_direct>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_direct> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_direct> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_direct(wrapper.value), 
ctx);
+     }
+@@ -104,7 +112,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_storev>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_storev> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_storev> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_storev(wrapper.value), 
ctx);
+     }
+@@ -113,7 +121,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_workmode>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_workmode> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_workmode> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_workmode(wrapper.value), 
ctx);
+     }
+@@ -122,7 +130,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_svect>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_svect> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_svect> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_svect(wrapper.value), 
ctx);
+     }
+@@ -131,7 +139,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_evect>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_evect> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_evect> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_evect(wrapper.value), 
ctx);
+     }
+@@ -140,7 +148,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_eform>> : formatter<char>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_eform> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_eform> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return formatter<char>::format(rocblas2char_eform(wrapper.value), 
ctx);
+     }
+@@ -149,7 +157,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_datatype>> : 
formatter<string_view>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_datatype> wrapper, FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_datatype> wrapper, FormatCtx& ctx) 
ROCSOLVER_FMT_CONST
+     {
+         return 
formatter<string_view>::format(rocblas2string_datatype(wrapper.value), ctx);
+     }
+@@ -158,7 +166,7 @@ template <>
+ struct formatter<rocsolver_logvalue<rocblas_initialization>> : 
formatter<string_view>
+ {
+     template <typename FormatCtx>
+-    auto format(rocsolver_logvalue<rocblas_initialization> wrapper, 
FormatCtx& ctx)
++    auto format(rocsolver_logvalue<rocblas_initialization> wrapper, 
FormatCtx& ctx) ROCSOLVER_FMT_CONST
+     {
+         return 
formatter<string_view>::format(rocblas2string_initialization(wrapper.value), 
ctx);
+     }

diff --git a/sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild 
b/sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild
new file mode 100644
index 000000000000..e643014fda76
--- /dev/null
+++ b/sci-libs/rocSOLVER/rocSOLVER-5.1.3.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ROCM_VERSION=${PV}
+
+inherit cmake edo rocm
+
+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"
+REQUIRED_USE="${ROCM_REQUIRED_USE}"
+
+# sci-libs/rocBLAS:${SLOT}
+RDEPEND="dev-util/hip
+       sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}]
+       =dev-libs/libfmt-8*
+       benchmark? ( virtual/blas )"
+DEPEND="${RDEPEND}"
+BDEPEND="test? ( dev-cpp/gtest
+       >=dev-util/cmake-3.22
+       virtual/blas )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.2.0-add-stdint-header.patch"
+       "${FILESDIR}/${P}-libfmt8.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() {
+       # avoid sandbox violation
+       addpredict /dev/kfd
+       addpredict /dev/dri/
+
+       local mycmakeargs=(
+               -DCMAKE_SKIP_RPATH=On
+               -DAMDGPU_TARGETS="$(get_amdgpu_flags)"
+               -Wno-dev
+               -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)
+       )
+
+       CXX=hipcc cmake_src_configure
+}
+
+src_test() {
+       check_amdgpu
+       cd "${BUILD_DIR}"/clients/staging || die
+       LD_LIBRARY_PATH="${BUILD_DIR}/library/src" edob ./rocsolver-test
+}
+
+src_install() {
+       cmake_src_install
+
+       if use benchmark; then
+               cd "${BUILD_DIR}" || die
+               dobin clients/staging/rocsolver-bench
+       fi
+}

Reply via email to