Merge pull request #138875 from r-burns/theano

pythonPackages.Theano: don't reference nvidia_x11
This commit is contained in:
r-burns 2021-09-23 00:06:50 -07:00 committed by GitHub
commit 0d481f7286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 15 deletions

View file

@ -8,19 +8,15 @@
, nose
, numpy
, scipy
, setuptools
, six
, libgpuarray
, cudaSupport ? false, cudatoolkit
, cudnnSupport ? false, cudnn
, nvidia_x11
}:
assert cudnnSupport -> cudaSupport;
assert cudaSupport -> nvidia_x11 != null
&& cudatoolkit != null
&& cudnn != null;
let
wrapped = command: buildTop: buildInputs:
runCommandCC "${command}-wrapped" { inherit buildInputs; } ''
@ -81,7 +77,15 @@ in buildPythonPackage rec {
# keep Nose around since running the tests by hand is possible from Python or bash
checkInputs = [ nose ];
propagatedBuildInputs = [ numpy numpy.blas scipy six libgpuarray_ ];
# setuptools needed for cuda support
propagatedBuildInputs = [
libgpuarray_
numpy
numpy.blas
scipy
setuptools
six
];
pythonImportsCheck = [ "theano" ];

View file

@ -1,5 +1,6 @@
{ stdenv
, lib
, addOpenGLRunpath
, buildPythonPackage
, fetchFromGitHub
, cmake
@ -8,13 +9,10 @@
, six
, nose
, Mako
, cudaSupport ? false, cudatoolkit , nvidia_x11
, cudaSupport ? false, cudatoolkit
, openclSupport ? true, ocl-icd, clblas
}:
assert cudaSupport -> nvidia_x11 != null
&& cudatoolkit != null;
buildPythonPackage rec {
pname = "libgpuarray";
version = "0.7.6";
@ -32,8 +30,7 @@ buildPythonPackage rec {
configurePhase = "cmakeConfigurePhase";
libraryPath = lib.makeLibraryPath (
[]
++ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out nvidia_x11 ]
lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out ]
++ lib.optionals openclSupport ([ clblas ] ++ lib.optional (!stdenv.isDarwin) ocl-icd)
);
@ -55,6 +52,8 @@ buildPythonPackage rec {
}
fixRunPath $out/lib/libgpuarray.so
'' + lib.optionalString cudaSupport ''
addOpenGLRunpath $out/lib/libgpuarray.so
'';
propagatedBuildInputs = [
@ -63,7 +62,12 @@ buildPythonPackage rec {
Mako
];
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [
cmake
] ++ lib.optionals cudaSupport [
addOpenGLRunpath
];
buildInputs = [
cython

View file

@ -4148,7 +4148,6 @@ 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;
};
libiio = (toPythonModule (pkgs.libiio.override { inherit python; })).python;
@ -8924,7 +8923,6 @@ in {
Theano = callPackage ../development/python-modules/Theano rec {
cudaSupport = pkgs.config.cudaSupport or false;
cudnnSupport = cudaSupport;
inherit (pkgs.linuxPackages) nvidia_x11;
};
TheanoWithCuda = self.Theano.override {