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.
This commit is contained in:
Tyson Whitehead 2018-08-02 12:20:21 -04:00
parent 6aab63d610
commit 8413a541d5
No known key found for this signature in database
GPG Key ID: B22199763A27997B

View File

@ -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 = ''