1{ buildPythonPackage
2, fetchFromGitHub
3, boost
4, numpy
5, pytools
6, pytest
7, decorator
8, appdirs
9, six
10, cudatoolkit
11, python
12, mkDerivation
13, stdenv
14, pythonOlder
15}:
16let
17 compyte = import ./compyte.nix {
18 inherit mkDerivation fetchFromGitHub;
19 };
20in
21buildPythonPackage rec {
22 name = "pycuda-${version}";
23 version = "2016.1";
24
25 src = fetchFromGitHub {
26 owner = "inducer";
27 repo = "pycuda";
28 rev = "609817e22c038249f5e9ddd720b3ca5a9d58ca11";
29 sha256 = "0kg6ayxsw2gja9rqspy6z8ihacf9jnxr8hzywjwmj1izkv24cff7";
30 };
31
32 preConfigure = ''
33 findInputs ${boost.dev} boost_dirs propagated-native-build-inputs
34
35 export BOOST_INCLUDEDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep '\-dev')/include
36 export BOOST_LIBRARYDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep -v '\-dev')/lib
37
38 ${python.interpreter} configure.py --boost-inc-dir=$BOOST_INCLUDEDIR \
39 --boost-lib-dir=$BOOST_LIBRARYDIR \
40 --no-use-shipped-boost \
41 --boost-python-libname=boost_python
42 '';
43
44 postInstall = ''
45 ln -s ${compyte} $out/${python.sitePackages}/pycuda/compyte
46 '';
47
48 doCheck = pythonOlder "3.5";
49
50 propagatedBuildInputs = [
51 numpy
52 pytools
53 pytest
54 decorator
55 appdirs
56 six
57 cudatoolkit
58 compyte
59 python
60 ];
61
62 meta = with stdenv.lib; {
63 homepage = https://github.com/inducer/pycuda/;
64 description = "CUDA integration for Python.";
65 license = licenses.mit;
66 maintainers = with maintainers; [ artuuge ];
67 };
68
69}