-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathrocALUTION-4.0.0-r1.ebuild
66 lines (50 loc) · 1.82 KB
/
rocALUTION-4.0.0-r1.ebuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake
DESCRIPTION="Next generation library for iterative sparse solvers for ROCm platform"
HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocALUTION"
SRC_URI="https://github.com/ROCmSoftwarePlatform/rocALUTION/archive/rocm-${PV}.tar.gz -> rocALUTION-${PV}.tar.gz"
LICENSE="MIT"
KEYWORDS="~amd64"
SLOT="0"
IUSE="hip +openmp mpi samples"
REQUIRED_USE="|| ( hip openmp mpi )"
RDEPEND="hip? ( =dev-util/hip-$(ver_cut 1-2)* )
hip? ( =sci-libs/rocSPARSE-$(ver_cut 1-2)* )
hip? ( =sci-libs/rocBLAS-$(ver_cut 1-2)* )
mpi? ( virtual/mpi )
openmp? ( sys-devel/gcc[openmp] )"
DEPEND="${RDEPEND}
dev-util/cmake"
CMAKE_BUILD_TYPE="RelWithDebInfo"
S="${WORKDIR}/${PN}-rocm-${PV}"
src_prepare() {
sed -e "s:/opt/rocm/hip/cmake:\${EPREFIX}/usr/lib/hip/cmake:" -i "${S}/CMakeLists.txt" || die
sed -e "s: PREFIX rocalution):):" -i "${S}/src/CMakeLists.txt" || die
sed -e "s:PREFIX rocalution:#PREFIX rocalution:" -i "${S}/src/CMakeLists.txt" || die
sed -e "s:rocm_install_symlink_subdir(rocalution):#rocm_install_symlink_subdir(rocalution):" -i "${S}/src/CMakeLists.txt" || die
cmake_src_prepare
}
src_configure() {
# Grant access to the device to omit a sandbox violation
addwrite /dev/kfd
addpredict /dev/dri/
# Compiler to use
export CXX="/usr/lib/hip/bin/hipcc";
local mycmakeargs=(
-DCMAKE_CXX_FLAGS="--rocm-path=/usr"
-DSUPPORT_OMP=$(usex openmp ON OFF)
-DSUPPORT_HIP=$(usex hip ON OFF)
-DSUPPORT_MPI=$(usex mpi ON OFF)
-DBUILD_CLIENTS_SAMPLES=$(usex samples ON OFF)
-DBUILD_CLIENTS_BENCHMARKS=OFF
-DBUILD_CLIENTS_TESTS=OFF
-DCMAKE_INSTALL_INCLUDEDIR="include/rocALUTION"
)
cmake_src_configure
}
src_install() {
cmake_src_install
chrpath --delete "${D}/usr/lib64/librocalution.so.0.1"
}