libtorch-bin: add missing runtime dependencies (#474676)
This commit is contained in:
@@ -3,15 +3,17 @@
|
||||
stdenv,
|
||||
fetchzip,
|
||||
lib,
|
||||
libcxx,
|
||||
llvmPackages,
|
||||
config,
|
||||
|
||||
addDriverRunpath,
|
||||
autoAddDriverRunpath,
|
||||
autoPatchelfHook,
|
||||
patchelf,
|
||||
fixDarwinDylibNames,
|
||||
|
||||
cudaSupport ? config.cudaSupport,
|
||||
cudaPackages_13,
|
||||
libz,
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -35,7 +37,11 @@ stdenv.mkDerivation {
|
||||
if stdenv.hostPlatform.isDarwin then
|
||||
[ fixDarwinDylibNames ]
|
||||
else
|
||||
[ patchelf ] ++ lib.optionals cudaSupport [ addDriverRunpath ];
|
||||
[
|
||||
patchelf
|
||||
autoPatchelfHook
|
||||
]
|
||||
++ lib.optionals cudaSupport [ autoAddDriverRunpath ];
|
||||
|
||||
dontBuild = true;
|
||||
dontConfigure = true;
|
||||
@@ -63,7 +69,17 @@ stdenv.mkDerivation {
|
||||
|
||||
postFixup =
|
||||
let
|
||||
rpath = lib.makeLibraryPath [ stdenv.cc.cc ];
|
||||
rpath = lib.makeLibraryPath (
|
||||
[ stdenv.cc.cc ]
|
||||
++ lib.optionals cudaSupport [
|
||||
cudaPackages_13.cuda_cudart # libcuda.so
|
||||
cudaPackages_13.libcufft
|
||||
cudaPackages_13.libcurand
|
||||
cudaPackages_13.libcusolver
|
||||
cudaPackages_13.libcusparse
|
||||
libz
|
||||
]
|
||||
);
|
||||
in
|
||||
lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
find $out/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
|
||||
|
||||
Reference in New Issue
Block a user