Merge pull request #105772 from danieldk/pytorch-fixup-cmake

python3Packages.pytorch: Fix CMake files for split outputs
This commit is contained in:
Daniël de Kok 2020-12-04 06:53:21 +01:00 committed by GitHub
commit ac5bd14ce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,6 +254,15 @@ in buildPythonPackage rec {
cp -r $out/${python.sitePackages}/torch/include $dev/include
cp -r $out/${python.sitePackages}/torch/share $dev/share
# Fix up library paths for split outputs
substituteInPlace \
$dev/share/cmake/Torch/TorchConfig.cmake \
--replace \''${TORCH_INSTALL_PREFIX}/lib "$lib/lib"
substituteInPlace \
$dev/share/cmake/Caffe2/Caffe2Targets-release.cmake \
--replace \''${_IMPORT_PREFIX}/lib "$lib/lib"
mkdir $lib
cp -r $out/${python.sitePackages}/torch/lib $lib/lib
'';