python3Packages.tensorflowWithCuda: fix patchelf failures

This commit is contained in:
Thomas Watson 2021-11-26 02:27:30 +00:00
parent 449c0a1d22
commit f5798c8f3d
2 changed files with 6 additions and 3 deletions

View File

@ -22,6 +22,7 @@
, cudaSupport ? false
, cudatoolkit
, cudnn
, patchelfUnstable
, zlib
, python
, keras-applications
@ -78,7 +79,8 @@ in buildPythonPackage {
] ++ lib.optional (!isPy3k) mock
++ lib.optionals (pythonOlder "3.4") [ backports_weakref ];
nativeBuildInputs = [ wheel ] ++ lib.optional cudaSupport addOpenGLRunpath;
# remove patchelfUnstable once patchelf 0.14 with https://github.com/NixOS/patchelf/pull/256 becomes the default
nativeBuildInputs = [ wheel ] ++ lib.optional cudaSupport [ addOpenGLRunpath patchelfUnstable ];
preConfigure = ''
unset SOURCE_DATE_EPOCH

View File

@ -1,5 +1,5 @@
{ stdenv, bazel_3, buildBazelPackage, isPy3k, lib, fetchFromGitHub, symlinkJoin
, addOpenGLRunpath, fetchpatch
, addOpenGLRunpath, fetchpatch, patchelfUnstable
# Python deps
, buildPythonPackage, pythonOlder, python
# Python libraries
@ -465,7 +465,8 @@ in buildPythonPackage {
tensorflow-tensorboard
];
nativeBuildInputs = lib.optional cudaSupport addOpenGLRunpath;
# remove patchelfUnstable once patchelf 0.14 with https://github.com/NixOS/patchelf/pull/256 becomes the default
nativeBuildInputs = lib.optional cudaSupport [ addOpenGLRunpath patchelfUnstable ];
postFixup = lib.optionalString cudaSupport ''
find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do