From 0da597302cd18b88e9f6f8242a2c9dc6fa9891a5 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Mon, 10 Apr 2023 02:02:21 +0200 Subject: [PATCH] python3Packages.pytorch: repair for darwin --- pkgs/development/python-modules/torch/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) 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 ''