18 pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
19 srcs = import ./binary-hashes.nix version;
20 unsupported = throw "Unsupported system";
22 in buildPythonPackage {
26 # Don't forget to update pytorch to the same version.
30 disabled = !(isPy37 || isPy38 || isPy39);
32 src = fetchurl srcs."${stdenv.system}-${pyVerNoDot}" or unsupported;
39 propagatedBuildInputs = [
53 rpath = lib.makeLibraryPath [ stdenv.cc.cc.lib ];
55 find $out/${python.sitePackages}/torch/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
56 echo "setting rpath for $lib..."
57 patchelf --set-rpath "${rpath}:$out/${python.sitePackages}/torch/lib" "$lib"
58 addOpenGLRunpath "$lib"
62 pythonImportsCheck = [ "torch" ];
65 description = "Open source, prototype-to-production deep learning platform";
66 homepage = "https://pytorch.org/";
67 license = licenses.unfree; # Includes CUDA and Intel MKL.
68 platforms = platforms.linux;
69 maintainers = with maintainers; [ danieldk ];