diff options
author | Tyson Whitehead <twhitehead@gmail.com> | 2018-08-02 12:20:21 -0400 |
---|---|---|
committer | Tyson Whitehead <twhitehead@gmail.com> | 2018-08-02 14:24:51 -0400 |
commit | 8413a541d524268412d2d88822c376b3b1eb6f36 (patch) | |
tree | 4d00a98fd5e83e72795a3ecd1f469735c382be27 | |
parent | 6aab63d6108b382e15bd378b922484d606319a77 (diff) | |
download | nixlib-8413a541d524268412d2d88822c376b3b1eb6f36.tar nixlib-8413a541d524268412d2d88822c376b3b1eb6f36.tar.gz nixlib-8413a541d524268412d2d88822c376b3b1eb6f36.tar.bz2 nixlib-8413a541d524268412d2d88822c376b3b1eb6f36.tar.lz nixlib-8413a541d524268412d2d88822c376b3b1eb6f36.tar.xz nixlib-8413a541d524268412d2d88822c376b3b1eb6f36.tar.zst nixlib-8413a541d524268412d2d88822c376b3b1eb6f36.zip |
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.
-rw-r--r-- | pkgs/development/python-modules/Theano/default.nix | 15 |
1 files 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 = '' |