1{ buildPythonPackage
2, fetchPypi
3, fetchFromGitHub
4, Mako
5, boost
6, numpy
7, pytools
8, pytest
9, decorator
10, appdirs
11, six
12, cudatoolkit
13, python
14, mkDerivation
15, stdenv
16, isPy3k
17}:
18let
19 compyte = import ./compyte.nix {
20 inherit mkDerivation fetchFromGitHub;
21 };
22in
23buildPythonPackage rec {
24 pname = "pycuda";
25 version = "2017.1.1";
26 name = "${pname}-${version}";
27
28 src = fetchPypi {
29 inherit pname version;
30 sha256 = "0qxmcjax32p1ywicw9sha2rvfbak4kjbx9pq57j3wq4cwf296nkb";
31 };
32
33 preConfigure = ''
34 ${python.interpreter} configure.py --boost-inc-dir=${boost.dev}/include \
35 --boost-lib-dir=${boost}/lib \
36 --no-use-shipped-boost \
37 --boost-python-libname=boost_python${stdenv.lib.optionalString isPy3k "3"}
38 '';
39
40 postInstall = ''
41 ln -s ${compyte} $out/${python.sitePackages}/pycuda/compyte
42 '';
43
44 # Requires access to libcuda.so.1 which is provided by the driver
45 doCheck = false;
46
47 checkPhase = ''
48 py.test
49 '';
50
51 propagatedBuildInputs = [
52 numpy
53 pytools
54 pytest
55 decorator
56 appdirs
57 six
58 cudatoolkit
59 compyte
60 python
61 Mako
62 ];
63
64 meta = with stdenv.lib; {
65 homepage = https://github.com/inducer/pycuda/;
66 description = "CUDA integration for Python.";
67 license = licenses.mit;
68 maintainers = with maintainers; [ artuuge ];
69 };
70
71}