Merge pull request #144814 from kevinmehall/pytorch

PyTorch: Reduce closure size by ~500MB

authored by Rick van Schijndel and committed by GitHub 59ae32d2 7a10d6f2

+6 -2
+6 -2
pkgs/development/python-modules/pytorch/default.nix
··· 6 cudaArchList ? null, 7 8 # Native build inputs 9 - cmake, util-linux, linkFarm, symlinkJoin, which, pybind11, 10 11 # Build inputs 12 numactl, ··· 220 which 221 ninja 222 pybind11 223 ] ++ lib.optionals cudaSupport [ cudatoolkit_joined ]; 224 225 buildInputs = [ blas blas.provider ] ··· 259 ]) 260 ]; 261 postInstall = '' 262 mkdir $dev 263 cp -r $out/${python.sitePackages}/torch/include $dev/include 264 cp -r $out/${python.sitePackages}/torch/share $dev/share ··· 273 --replace \''${_IMPORT_PREFIX}/lib "$lib/lib" 274 275 mkdir $lib 276 - cp -r $out/${python.sitePackages}/torch/lib $lib/lib 277 ''; 278 279 postFixup = lib.optionalString stdenv.isDarwin ''
··· 6 cudaArchList ? null, 7 8 # Native build inputs 9 + cmake, util-linux, linkFarm, symlinkJoin, which, pybind11, removeReferencesTo, 10 11 # Build inputs 12 numactl, ··· 220 which 221 ninja 222 pybind11 223 + removeReferencesTo 224 ] ++ lib.optionals cudaSupport [ cudatoolkit_joined ]; 225 226 buildInputs = [ blas blas.provider ] ··· 260 ]) 261 ]; 262 postInstall = '' 263 + find "$out/${python.sitePackages}/torch/include" "$out/${python.sitePackages}/torch/lib" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + 264 + 265 mkdir $dev 266 cp -r $out/${python.sitePackages}/torch/include $dev/include 267 cp -r $out/${python.sitePackages}/torch/share $dev/share ··· 276 --replace \''${_IMPORT_PREFIX}/lib "$lib/lib" 277 278 mkdir $lib 279 + mv $out/${python.sitePackages}/torch/lib $lib/lib 280 + ln -s $lib/lib $out/${python.sitePackages}/torch/lib 281 ''; 282 283 postFixup = lib.optionalString stdenv.isDarwin ''