/[gentoo-x86]/dev-python/pycuda/pycuda-2012.1.ebuild
Gentoo

Contents of /dev-python/pycuda/pycuda-2012.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Apr 8 08:05:18 2015 UTC (5 years, 3 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +3 -3 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/pycuda/pycuda-2012.1.ebuild,v 1.2 2013/07/07 19:15:38 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8
9 inherit cuda distutils-r1 multilib
10
11 DESCRIPTION="Python wrapper for NVIDIA CUDA"
12 HOMEPAGE="http://mathema.tician.de/software/pycuda/ http://pypi.python.org/pypi/pycuda"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="examples opengl test"
19
20 RDEPEND="
21 dev-libs/boost[python,${PYTHON_USEDEP}]
22 dev-python/decorator[${PYTHON_USEDEP}]
23 dev-python/mako[${PYTHON_USEDEP}]
24 dev-python/numpy[${PYTHON_USEDEP}]
25 >=dev-python/pytools-2011.2[${PYTHON_USEDEP}]
26 dev-util/nvidia-cuda-toolkit
27 x11-drivers/nvidia-drivers
28 opengl? ( virtual/opengl )"
29 DEPEND="${RDEPEND}
30 test? (
31 dev-python/mako[${PYTHON_USEDEP}]
32 dev-python/pytest[${PYTHON_USEDEP}] )"
33
34 # We need write acccess /dev/nvidia0 and /dev/nvidiactl and the portage
35 # user is (usually) not in the video group
36 RESTRICT="userpriv"
37
38 python_prepare_all() {
39 cuda_sanitize
40 sed \
41 -e "s:'--preprocess':\'--preprocess\', \'--compiler-bindir=$(cuda_gccdir)\':g" \
42 -e "s:\"--cubin\":\'--cubin\', \'--compiler-bindir=$(cuda_gccdir)\':g" \
43 -e "s:/usr/include/pycuda:${S}/src/cuda:g" \
44 -i pycuda/compiler.py || die
45
46 touch siteconf.py || die
47
48 distutils-r1_python_prepare_all
49 }
50
51 python_configure() {
52 local myopts=()
53 use opengl && myopts+=( --cuda-enable-gl )
54
55 mkdir "${BUILD_DIR}" || die
56 cd "${BUILD_DIR}" || die
57 [[ -e ./siteconf.py ]] && rm -f ./siteconf.py
58 "${EPYTHON}" "${S}"/configure.py \
59 --boost-inc-dir="${EPREFIX}/usr/include" \
60 --boost-lib-dir="${EPREFIX}/usr/$(get_libdir)" \
61 --boost-python-libname=boost_python-$(echo ${EPYTHON} | sed 's/python//')-mt \
62 --boost-thread-libname=boost_thread-mt \
63 --cuda-root="${EPREFIX}/opt/cuda" \
64 --cudadrv-lib-dir="${EPREFIX}/usr/$(get_libdir)" \
65 --cudart-lib-dir="${EPREFIX}/opt/cuda/$(get_libdir)" \
66 --cuda-inc-dir="${EPREFIX}/opt/cuda/include" \
67 --no-use-shipped-boost \
68 "${myopts[@]}"
69 }
70
71 src_test() {
72 # we need write access to this to run the tests
73 addwrite /dev/nvidia0
74 addwrite /dev/nvidiactl
75 python_test() {
76 py.test --debug -v -v -v || die "Tests fail with ${EPYTHON}"
77 }
78 distutils-r1_src_test
79 }
80
81 python_install_all() {
82 distutils-r1_python_install_all
83
84 if use examples; then
85 insinto /usr/share/doc/${PF}
86 doins -r examples
87 fi
88 }

  ViewVC Help
Powered by ViewVC 1.1.20