diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index d9cf4e5760d88..576e6b1bfac9c 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -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 ''