diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix index 810460a30ade..0d42c8e6dcc1 100644 --- a/pkgs/development/python-modules/pytorch/default.nix +++ b/pkgs/development/python-modules/pytorch/default.nix @@ -6,7 +6,7 @@ cudaArchList ? null, # Native build inputs - cmake, util-linux, linkFarm, symlinkJoin, which, pybind11, + cmake, util-linux, linkFarm, symlinkJoin, which, pybind11, removeReferencesTo, # Build inputs numactl, @@ -220,6 +220,7 @@ in buildPythonPackage rec { which ninja pybind11 + removeReferencesTo ] ++ lib.optionals cudaSupport [ cudatoolkit_joined ]; buildInputs = [ blas blas.provider ] @@ -259,6 +260,8 @@ in buildPythonPackage rec { ]) ]; postInstall = '' + find "$out/${python.sitePackages}/torch/include" "$out/${python.sitePackages}/torch/lib" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + + mkdir $dev cp -r $out/${python.sitePackages}/torch/include $dev/include cp -r $out/${python.sitePackages}/torch/share $dev/share