summaryrefslogtreecommitdiff
blob: 59f05f82ded7592830ec0dcb00981c1cf8d7766a (plain)
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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

MYPN="CLBlast"

DESCRIPTION="Tuned OpenCL BLAS"
HOMEPAGE="https://github.com/CNugteren/CLBlast"
SRC_URI="https://github.com/CNugteren/${MYPN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${MYPN}-${PV}"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
# Cuda is still beta, default to opencl
IUSE="client cuda examples +opencl test"
REQUIRED_USE="
	^^ ( cuda opencl )
	test? ( client )
"
# Tests require write access to /dev/dri/renderD...
RESTRICT="test"
# RESTRICT="!test? ( test )"

RDEPEND="
	cuda? ( dev-util/nvidia-cuda-toolkit:= )
	client? ( virtual/cblas )
	opencl? ( virtual/opencl )
"

DEPEND="${RDEPEND}"

src_prepare() {
	# no forced optimisation, libdir
	sed -e 's/-O3//g' \
		-e 's/DESTINATION lib/DESTINATION ${CMAKE_INSTALL_LIBDIR}/g' \
		-i CMakeLists.txt || die
	cmake_src_prepare
}

src_configure() {
	mycmakeargs+=(
		-DBUILD_SHARED_LIBS=ON
		-DSAMPLES="$(usex examples)"
		-DCLIENTS="$(usex client)"
		-DNETLIB="$(usex client)"
		-DTESTS="$(usex test)"
		-DOPENCL="$(usex opencl)"
		-DCUDA="$(usex cuda)"
	)
	cmake_src_configure
}

src_install() {
	cmake_src_install
	dodoc README.md ROADMAP.md CONTRIBUTING.md CHANGELOG
	dodoc -r doc
}