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 = "2018.1";
26
27 src = fetchPypi {
28 inherit pname version;
29 sha256 = "7079f7738e83ee79ae26f0827ada29fe55921fec9760201199cc2bfb69446c92";
30 };
31
32 preConfigure = ''
33 ${python.interpreter} configure.py --boost-inc-dir=${boost.dev}/include \
34 --boost-lib-dir=${boost}/lib \
35 --no-use-shipped-boost \
36 --boost-python-libname=boost_python${stdenv.lib.optionalString isPy3k "3"}
37 '';
38
39 postInstall = ''
40 ln -s ${compyte} $out/${python.sitePackages}/pycuda/compyte
41 '';
42
43 # Requires access to libcuda.so.1 which is provided by the driver
44 doCheck = false;
45
46 checkPhase = ''
47 py.test
48 '';
49
50 propagatedBuildInputs = [
51 numpy
52 pytools
53 pytest
54 decorator
55 appdirs
56 six
57 cudatoolkit
58 compyte
59 python
60 Mako
61 ];
62
63 meta = with stdenv.lib; {
64 homepage = https://github.com/inducer/pycuda/;
65 description = "CUDA integration for Python.";
66 license = licenses.mit;
67 maintainers = with maintainers; [ artuuge ];
68 };
69
70}