From 6aab63d6108b382e15bd378b922484d606319a77 Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Thu, 2 Aug 2018 12:09:47 -0400 Subject: Theano: libgpuarray needs to use the same version of cudatoolkit --- pkgs/development/python-modules/Theano/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/Theano/default.nix b/pkgs/development/python-modules/Theano/default.nix index e2b31cdda794..2c7345716f60 100644 --- a/pkgs/development/python-modules/Theano/default.nix +++ b/pkgs/development/python-modules/Theano/default.nix @@ -36,7 +36,7 @@ let exec ${gcc}/bin/g++ "$@" ''; - libgpuarray_ = libgpuarray.override { inherit cudaSupport; }; + libgpuarray_ = libgpuarray.override { inherit cudaSupport cudatoolkit; }; in buildPythonPackage rec { pname = "Theano"; -- cgit 1.4.1 From 8413a541d524268412d2d88822c376b3b1eb6f36 Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Thu, 2 Aug 2018 12:20:21 -0400 Subject: Theano: cleaner setting of g++, cuda, and dnn paths Original was a mix of config changes and code changes with a search and replace that also changed unintended bits such as messages. --- pkgs/development/python-modules/Theano/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/Theano/default.nix b/pkgs/development/python-modules/Theano/default.nix index 2c7345716f60..4341302f33a9 100644 --- a/pkgs/development/python-modules/Theano/default.nix +++ b/pkgs/development/python-modules/Theano/default.nix @@ -50,12 +50,15 @@ in buildPythonPackage rec { }; postPatch = '' - sed -i 's,g++,${gcc_}/bin/g++,g' theano/configdefaults.py - '' + lib.optionalString cudnnSupport '' - sed -i \ - -e "s,ctypes.util.find_library('cudnn'),'${cudnn}/lib/libcudnn.so',g" \ - -e "s/= _dnn_check_compile()/= (True, None)/g" \ - theano/gpuarray/dnn.py + substituteInPlace theano/configdefaults.py \ + --replace 'StrParam(param, is_valid=warn_cxx)' 'StrParam('\'''${gcc_}/bin/g++'\''', is_valid=warn_cxx)' \ + --replace 'rc == 0 and config.cxx != ""' 'config.cxx != ""' + '' + stdenv.lib.optionalString cudaSupport '' + substituteInPlace theano/configdefaults.py \ + --replace 'StrParam(get_cuda_root)' 'StrParam('\'''${cudatoolkit}'\''')' + '' + stdenv.lib.optionalString cudnnSupport '' + substituteInPlace theano/configdefaults.py \ + --replace 'StrParam(default_dnn_base_path)' 'StrParam('\'''${cudnn}'\''')' ''; preCheck = '' -- cgit 1.4.1 From 303a3f972eabd1eda0b3fbd4051d31d258402ad3 Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Thu, 2 Aug 2018 15:20:24 -0400 Subject: Theano: get theano to use a captured build environment --- pkgs/development/python-modules/Theano/default.nix | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/Theano/default.nix b/pkgs/development/python-modules/Theano/default.nix index 4341302f33a9..793488f0b136 100644 --- a/pkgs/development/python-modules/Theano/default.nix +++ b/pkgs/development/python-modules/Theano/default.nix @@ -1,8 +1,8 @@ { stdenv +, runCommandCC , lib , fetchPypi , gcc -, writeScriptBin , buildPythonPackage , isPyPy , pythonOlder @@ -24,17 +24,22 @@ assert cudaSupport -> nvidia_x11 != 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 cudaSupport [ "-I ${libgpuarray}/include" "-L ${libgpuarray}/lib" ]; + wrapped = command: buildTop: buildInputs: + runCommandCC "${command}-wrapped" { inherit buildInputs; } '' + type -P '${command}' || { echo '${command}: not found'; exit 1; } + cat > "$out" <