dev-libs/libxml2: arm64 stable (bug #701020)
[gentoo.git] / dev-libs / libgpuarray / libgpuarray-0.6.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cmake-utils cuda
7
8 MYPV=${PV/_/-}
9
10 DESCRIPTION="Library to manipulate tensors on the GPU"
11 HOMEPAGE="http://deeplearning.net/software/libgpuarray/"
12 SRC_URI="https://github.com/Theano/${PN}/archive/v${MYPV}.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="cuda doc opencl static-libs test"
18 RESTRICT="!test? ( test )"
19
20 # cuda/opencl loaded dynamically at runtime, no compile time dep
21 RDEPEND="
22         cuda? ( amd64? ( >=dev-util/nvidia-cuda-toolkit-7 ) )
23         opencl? (
24            virtual/opencl
25            || ( sci-libs/clblast sci-libs/clblas )
26         )
27 "
28 DEPEND="
29         doc? ( app-doc/doxygen )
30         test? ( ${RDEPEND}
31            dev-libs/check
32            virtual/pkgconfig
33         )
34 "
35 S="${WORKDIR}/${PN}-${MYPV}"
36
37 src_prepare() {
38         sed -e 's/DESTINATION lib/DESTINATION ${CMAKE_INSTALL_LIBDIR}/g' \
39                 -i src/CMakeLists.txt || die
40         use cuda && cuda_src_prepare
41         cmake-utils_src_prepare
42 }
43
44 src_configure() {
45         local mycmakeargs=()
46         cmake-utils_src_configure
47         use doc && emake -C doc doxy
48 }
49
50 src_test() {
51         local dev=cuda
52         use opencl && dev=opencl
53         DEVICE=${dev} cmake-utils_src_test
54         # if !cuda or !opencl: no testing because tests fail
55 }
56
57 src_install() {
58         use doc && HTML_DOCS=( doc/_doxybuild/html/. )
59         cmake-utils_src_install
60         use static-libs || rm "${ED}/usr/$(get_libdir)/libgpuarray-static.a"
61 }