sci-libs/magma: allow multiple gpu implementations

Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2022-05-25 07:47:00 +02:00
parent 7b85b7e9e9
commit 887d4459a5

View File

@@ -30,6 +30,7 @@ IUSE_AMDGPU="
"
IUSE="doc openblas test ${IUSE_AMDGPU}"
# TODO: do not enforce openblas
RDEPEND="
openblas? ( sci-libs/openblas )
!openblas? (
@@ -47,7 +48,7 @@ BDEPEND="
doc? ( >=app-doc/doxygen-1.8.14-r1[dot] )
"
REQUIRED_USE="^^ ( ${IUSE_AMDGPU/+/} )"
REQUIRED_USE="|| ( ${IUSE_AMDGPU/+/} )"
RESTRICT="!test? ( test )"
pkg_setup() {
@@ -83,12 +84,16 @@ src_configure() {
# other options: Intel10_64lp, Intel10_64lp_seq, Intel10_64ilp, Intel10_64ilp_seq, Intel10_32, FLAME, ACML, Apple, NAS
local blasvendor="Generic"
use openblas && blasvendor="OpenBLAS"
local gpu=""
for u in ${IUSE_AMDGPU} ; do
if use ${u} ; then
gpu="${u/amdgpu_/}"
break
gpu="${gpu},${u/amdgpu_/}"
fi
done
#remove first character (,)
gpu="${gpu:1}"
local mycmakeargs=(
-DBUILD_SHARED_LIBS=ON
-DCMAKE_CXX_COMPILER=hipcc