summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorartuuge <artuuge@gmail.com>2016-06-15 00:47:55 +0200
committerartuuge <artuuge@gmail.com>2016-06-15 00:47:55 +0200
commitbe0ade9d0343905ae3ca439eae8d3b179592eb2e (patch)
tree4252f6db6380d4bc1538480f763e774f127e758d /pkgs/development/python-modules
parentdd5a46f85d811f8b62dcd87d6f2a23a57b4f9c9c (diff)
downloadnixpkgs-be0ade9d0343905ae3ca439eae8d3b179592eb2e.tar
nixpkgs-be0ade9d0343905ae3ca439eae8d3b179592eb2e.tar.gz
nixpkgs-be0ade9d0343905ae3ca439eae8d3b179592eb2e.tar.bz2
nixpkgs-be0ade9d0343905ae3ca439eae8d3b179592eb2e.tar.lz
nixpkgs-be0ade9d0343905ae3ca439eae8d3b179592eb2e.tar.xz
nixpkgs-be0ade9d0343905ae3ca439eae8d3b179592eb2e.tar.zst
nixpkgs-be0ade9d0343905ae3ca439eae8d3b179592eb2e.zip
pycuda: init at 2016.1
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/pycuda/compyte.nix21
-rw-r--r--pkgs/development/python-modules/pycuda/default.nix66
2 files changed, 87 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pycuda/compyte.nix b/pkgs/development/python-modules/pycuda/compyte.nix
new file mode 100644
index 00000000000..50bd81ac462
--- /dev/null
+++ b/pkgs/development/python-modules/pycuda/compyte.nix
@@ -0,0 +1,21 @@
+{ mkDerivation 
+, fetchFromGitHub
+}:
+
+mkDerivation rec {
+  name = "compyte-${version}";
+  version = "git-20150817"; 
+
+  src = fetchFromGitHub {
+    owner = "inducer";
+    repo = "compyte";
+    rev = "ac1c71d46428c14aa1bd1c09d7da19cd0298d5cc";
+    sha256 = "1980h017qi52b7fqwm75m481xs2napgdd3fbrzkfc29k085cbign";
+  };
+
+  installPhase = '' 
+    mkdir -p $out
+    cp -r * $out
+  '';
+
+}
diff --git a/pkgs/development/python-modules/pycuda/default.nix b/pkgs/development/python-modules/pycuda/default.nix
new file mode 100644
index 00000000000..df507f9b6ad
--- /dev/null
+++ b/pkgs/development/python-modules/pycuda/default.nix
@@ -0,0 +1,66 @@
+{ buildPythonPackage 
+, fetchFromGitHub
+, boost
+, numpy
+, pytools
+, pytest
+, decorator
+, appdirs
+, six
+, cudatoolkit
+, python
+, mkDerivation
+, stdenv
+}:
+let
+  compyte = import ./compyte.nix {
+    inherit mkDerivation fetchFromGitHub;
+  };
+in
+buildPythonPackage rec {
+  name = "pycuda-${version}"; 
+  version = "2016.1"; 
+
+  src = fetchFromGitHub {
+    owner = "inducer"; 
+    repo = "pycuda";
+    rev = "609817e22c038249f5e9ddd720b3ca5a9d58ca11"; 
+    sha256 = "0kg6ayxsw2gja9rqspy6z8ihacf9jnxr8hzywjwmj1izkv24cff7"; 
+  }; 
+
+  preConfigure = ''
+    findInputs ${boost} boost_dirs propagated-native-build-inputs
+
+    export BOOST_INCLUDEDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep '\-dev')/include
+    export BOOST_LIBRARYDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep -v '\-dev')/lib
+    
+    ${python.interpreter} configure.py --boost-inc-dir=$BOOST_INCLUDEDIR \
+                            --boost-lib-dir=$BOOST_LIBRARYDIR \
+                            --no-use-shipped-boost \
+                            --boost-python-libname=boost_python
+  '';
+
+  postInstall = ''
+    ln -s ${compyte} $out/${python.sitePackages}/pycuda/compyte 
+  '';
+
+  propagatedBuildInputs = [
+    numpy
+    pytools
+    pytest
+    decorator
+    appdirs
+    six
+    cudatoolkit
+    compyte
+    python
+  ]; 
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/inducer/pycuda/;
+    description = "CUDA integration for Python.";
+    license = licenses.mit;
+    maintainers = with maintainers; [ artuuge ];
+  };
+
+}