aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-10-18 16:32:00 +0000
committerKatharina Fey <kookie@spacekookie.de>2019-10-18 16:32:00 +0000
commit0f74f62ee25ac2d21bd67c29b8efc3ad079a72a8 (patch)
treebd701e982d896952f4291e4b795c85bb581593b8 /nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix
parentdae1ae41b3a575e87d411e0cd9daa42a85c5aa89 (diff)
parent1c40ee6fc44f7eb474c69ea070a43247a1a2c83c (diff)
Merge commit '1c40ee6fc44f7eb474c69ea070a43247a1a2c83c'
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix b/nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix
index e46d0298953..db2308a0be8 100644
--- a/nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix
+++ b/nixpkgs/pkgs/development/python-modules/tensorflow/bin.nix
@@ -26,6 +26,7 @@
, symlinkJoin
, keras-applications
, keras-preprocessing
+, addOpenGLRunpath
}:
# We keep this binary build for two reasons:
@@ -76,6 +77,8 @@ in buildPythonPackage {
] ++ lib.optional (!isPy3k) mock
++ lib.optionals (pythonOlder "3.4") [ backports_weakref ];
+ nativeBuildInputs = lib.optional cudaSupport addOpenGLRunpath;
+
# Upstream has a pip hack that results in bin/tensorboard being in both tensorflow
# and the propageted input tensorflow-tensorboard which causes environment collisions.
# another possibility would be to have tensorboard only in the buildInputs
@@ -94,7 +97,12 @@ in buildPythonPackage {
lib.optionalString stdenv.isLinux ''
rrPath="$out/${python.sitePackages}/tensorflow/:$out/${python.sitePackages}/tensorflow/contrib/tensor_forest/:${rpath}"
internalLibPath="$out/${python.sitePackages}/tensorflow/python/_pywrap_tensorflow_internal.so"
- find $out \( -name '*.so' -or -name '*.so.*' \) -exec patchelf --set-rpath "$rrPath" {} \;
+ find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
+ patchelf --set-rpath "$rrPath" "$lib"
+ ${lib.optionalString cudaSupport ''
+ addOpenGLRunpath "$lib"
+ ''}
+ done
'';