summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2016-06-16 10:45:24 +0200
committerGitHub <noreply@github.com>2016-06-16 10:45:24 +0200
commit2f019896d29cb83a6f82454b0855ea816ef4cba1 (patch)
tree70c84446e92eeae382cf27c663ee86566d01b85c /pkgs/development
parentf4a4af9a9d544e38352dacc81b9f5f8d204b5c30 (diff)
parent1a55add4ca363ba2099dcd8edf47684d212903da (diff)
downloadnixlib-2f019896d29cb83a6f82454b0855ea816ef4cba1.tar
nixlib-2f019896d29cb83a6f82454b0855ea816ef4cba1.tar.gz
nixlib-2f019896d29cb83a6f82454b0855ea816ef4cba1.tar.bz2
nixlib-2f019896d29cb83a6f82454b0855ea816ef4cba1.tar.lz
nixlib-2f019896d29cb83a6f82454b0855ea816ef4cba1.tar.xz
nixlib-2f019896d29cb83a6f82454b0855ea816ef4cba1.tar.zst
nixlib-2f019896d29cb83a6f82454b0855ea816ef4cba1.zip
Merge pull request #16236 from artuuge/pycuda
pycuda: init at 2016.1
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/pycuda/compyte.nix21
-rw-r--r--pkgs/development/python-modules/pycuda/default.nix69
2 files changed, 90 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 000000000000..50bd81ac462c
--- /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 000000000000..c8be20bbe0a9
--- /dev/null
+++ b/pkgs/development/python-modules/pycuda/default.nix
@@ -0,0 +1,69 @@
+{ buildPythonPackage 
+, fetchFromGitHub
+, boost
+, numpy
+, pytools
+, pytest
+, decorator
+, appdirs
+, six
+, cudatoolkit
+, python
+, mkDerivation
+, stdenv
+, pythonOlder
+}:
+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 
+  '';
+
+  doCheck = pythonOlder "3.5";
+
+  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 ];
+  };
+
+}