1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-utils cuda
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"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="cuda doc opencl static-libs test"
18 RESTRICT="!test? ( test )"
20 # cuda/opencl loaded dynamically at runtime, no compile time dep
22 cuda? ( amd64? ( >=dev-util/nvidia-cuda-toolkit-7 ) )
25 || ( sci-libs/clblast sci-libs/clblas )
29 doc? ( app-doc/doxygen )
35 S="${WORKDIR}/${PN}-${MYPV}"
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
46 cmake-utils_src_configure
47 use doc && emake -C doc doxy
52 use opencl && dev=opencl
53 DEVICE=${dev} cmake-utils_src_test
54 # if !cuda or !opencl: no testing because tests fail
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"