Unverified Commit 8a9a8113 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #225646 from Et7f3/fix_python3Packages.pytorch_darwin

python3Packages.pytorch: repair for darwin
parents b743df0f 0da59730
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -182,6 +182,13 @@ in buildPythonPackage rec {
    substituteInPlace cmake/public/LoadHIP.cmake \
      --replace "set(ROCM_PATH \$ENV{ROCM_PATH})" \
        "set(ROCM_PATH \$ENV{ROCM_PATH})''\nset(ROCM_VERSION ${lib.concatStrings (lib.intersperse "0" (lib.splitString "." hip.version))})"
  ''
  # error: no member named 'aligned_alloc' in the global namespace; did you mean simply 'aligned_alloc'
  # This lib overrided aligned_alloc hence the error message. Tltr: his function is linkable but not in header.
  + lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0") ''
    substituteInPlace third_party/pocketfft/pocketfft_hdronly.h --replace '#if __cplusplus >= 201703L
    inline void *aligned_alloc(size_t align, size_t size)' '#if __cplusplus >= 201703L && 0
    inline void *aligned_alloc(size_t align, size_t size)'
  '';

  preConfigure = lib.optionalString cudaSupport ''