Unverified Commit c4c4a4c2 authored by Someone's avatar Someone Committed by GitHub
Browse files

python3Packages.torch: ensure torch compile can find and use gcc from… (#446105)

parents 5d25ebea e32b31c7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
  MPISupport ? false,
  mpi,
  buildDocs ? false,
  targetPackages,

  # tests.cudaAvailable:
  callPackage,
@@ -368,6 +369,12 @@ buildPythonPackage rec {
    substituteInPlace torch/csrc/profiler/unwind/unwind.cpp \
      --replace-fail 'addr2line_binary_ = "addr2line"' 'addr2line_binary_ = "${lib.getExe' binutils "addr2line"}"'
  ''
  # Ensures torch compile can find and use compilers from nix.
  + ''
    substituteInPlace torch/_inductor/config.py \
      --replace-fail '"clang++" if sys.platform == "darwin" else "g++"' \
      '"${lib.getExe' targetPackages.stdenv.cc "${targetPackages.stdenv.cc.targetPrefix}c++"}"'
  ''
  + lib.optionalString rocmSupport ''
    # https://github.com/facebookincubator/gloo/pull/297
    substituteInPlace third_party/gloo/cmake/Hipify.cmake \