Merge pull request #38851 from smatting/fixtheano

Add nvidia_x11 as a dependency in Theano
This commit is contained in:
Frederik Rietdijk 2018-05-13 14:42:09 +02:00 committed by GitHub
commit 91e9f1d737
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View file

@ -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++ "$@"
'';

View file

@ -9,10 +9,13 @@
, nose
, Mako
, python
, cudaSupport ? false, cudatoolkit
, cudaSupport ? false, cudatoolkit , nvidia_x11
, openclSupport ? true, ocl-icd, clblas
}:
assert cudaSupport -> nvidia_x11 != null
&& cudatoolkit != null;
buildPythonPackage rec {
pname = "libgpuarray";
version = "0.7.5";
@ -32,7 +35,7 @@ buildPythonPackage rec {
libraryPath = lib.makeLibraryPath (
[]
++ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out ]
++ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out nvidia_x11 ]
++ lib.optionals openclSupport ([ clblas ] ++ lib.optional (!stdenv.isDarwin) ocl-icd)
);

View file

@ -7114,6 +7114,7 @@ in {
libgpuarray = callPackage ../development/python-modules/libgpuarray {
clblas = pkgs.clblas.override { boost = self.boost; };
cudaSupport = pkgs.config.cudaSupport or false;
inherit (pkgs.linuxPackages) nvidia_x11;
};
librepo = toPythonModule (pkgs.librepo.override {
@ -12985,6 +12986,7 @@ in {
Theano = callPackage ../development/python-modules/Theano rec {
cudaSupport = pkgs.config.cudaSupport or false;
cudnnSupport = cudaSupport;
inherit (pkgs.linuxPackages) nvidia_x11;
};
TheanoWithoutCuda = self.Theano.override {