summary refs log tree commit diff
path: root/pkgs/development/python-modules/Theano/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/Theano/default.nix')
-rw-r--r--pkgs/development/python-modules/Theano/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/Theano/default.nix b/pkgs/development/python-modules/Theano/default.nix
index 03dc825218e2..9eb04782d6f8 100644
--- a/pkgs/development/python-modules/Theano/default.nix
+++ b/pkgs/development/python-modules/Theano/default.nix
@@ -15,17 +15,24 @@
 , libgpuarray
 , cudaSupport ? false, cudatoolkit
 , cudnnSupport ? false, cudnn
+, nvidia_x11
 }:
 
 assert cudnnSupport -> cudaSupport;
 
+assert cudaSupport -> nvidia_x11 != null
+                   && cudatoolkit != null
+                   && cudnn != null;
+
 let
   extraFlags =
     lib.optionals cudaSupport [ "-I ${cudatoolkit}/include" "-L ${cudatoolkit}/lib" ]
-    ++ lib.optionals cudnnSupport [ "-I ${cudnn}/include" "-L ${cudnn}/lib" ];
+    ++ lib.optionals cudnnSupport [ "-I ${cudnn}/include" "-L ${cudnn}/lib" ]
+    ++ lib.optionals cudaSupport [ "-I ${libgpuarray}/include" "-L ${libgpuarray}/lib" ];
 
   gcc_ = writeScriptBin "g++" ''
     #!${stdenv.shell}
+    export NIX_CC_WRAPPER_${stdenv.cc.infixSalt}_TARGET_HOST=1
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${toString extraFlags}"
     exec ${gcc}/bin/g++ "$@"
   '';