From b55f063caf98b12852f33d159d8fbb6b3dfc6646 Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Mon, 21 Aug 2023 22:36:44 +0200 Subject: [PATCH] halide: patch to remove dependency on Apple SDK --- pkgs/development/compilers/halide/default.nix | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkgs/development/compilers/halide/default.nix b/pkgs/development/compilers/halide/default.nix index b508433bf94b..9e04c5a2424b 100644 --- a/pkgs/development/compilers/halide/default.nix +++ b/pkgs/development/compilers/halide/default.nix @@ -34,6 +34,18 @@ stdenv.mkDerivation rec { #define HALIDE_CPP_COMPILER_HAS_FLOAT16' \ '#if defined(__x86_64__) || defined(__i386__) #define HALIDE_CPP_COMPILER_HAS_FLOAT16' + + # AvailabilityVersions.h is part of Apple SDK, and we do not want to depend on it + substituteInPlace 'src/runtime/HalideBuffer.h' \ + --replace '#ifdef __APPLE__ + #include + #include + #endif' \ + ' ' \ + --replace 'TARGET_OS_OSX && (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15)' \ + '0' \ + --replace 'TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_14_0)' \ + '0' ''; cmakeFlags = [ @@ -46,6 +58,15 @@ stdenv.mkDerivation rec { doCheck = true; + # Note: disable mullapudi2016_fibonacci because it requires too much + # parallelism for remote builders + ctestArgs = "--output-on-failure -E 'mullapudi2016_fibonacci'"; + checkPhase = '' + runHook preCheck + ctest ${ctestArgs} + runHook postCheck + ''; + # Note: only openblas and not atlas part of this Nix expression # see pkgs/development/libraries/science/math/liblapack/3.5.0.nix # to get a hint howto setup atlas instead of openblas