halide: 18.0.0 -> 19.0.0
This commit is contained in:
parent
041c867bad
commit
2fa5a892d9
@ -4,6 +4,7 @@
|
|||||||
lib,
|
lib,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
cmake,
|
cmake,
|
||||||
|
fetchpatch2,
|
||||||
flatbuffers,
|
flatbuffers,
|
||||||
libffi,
|
libffi,
|
||||||
libpng,
|
libpng,
|
||||||
@ -14,69 +15,114 @@
|
|||||||
openblas,
|
openblas,
|
||||||
blas,
|
blas,
|
||||||
lapack,
|
lapack,
|
||||||
|
removeReferencesTo,
|
||||||
|
ninja,
|
||||||
pythonSupport ? false,
|
pythonSupport ? false,
|
||||||
python3Packages ? null,
|
python3Packages,
|
||||||
|
wasmSupport ? false,
|
||||||
|
wabt,
|
||||||
|
doCheck ? true,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "halide";
|
pname = "halide";
|
||||||
version = "18.0.0";
|
version = "19.0.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "halide";
|
owner = "halide";
|
||||||
repo = "Halide";
|
repo = "Halide";
|
||||||
rev = "v${version}";
|
tag = "v${finalAttrs.version}";
|
||||||
hash = "sha256-BPalUh9EgdCqVaWC1HoreyyRcPQc4QMIYnLrRoNDDCI=";
|
hash = "sha256-0SFGX4G6UR8NS4UsdFOb99IBq2/hEkr/Cm2p6zkIh/8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
patches = [
|
||||||
# See https://github.com/halide/Halide/issues/7785
|
# The following two patches fix cmake/HalidePackageConfigHelpers.cmake to
|
||||||
substituteInPlace 'src/runtime/HalideRuntime.h' \
|
# support specifying an absolute library install path (which is what Nix
|
||||||
--replace '#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
|
# does when "lib" is included as a separate output)
|
||||||
#define HALIDE_CPP_COMPILER_HAS_FLOAT16' \
|
(fetchpatch2 {
|
||||||
'#if defined(__x86_64__) || defined(__i386__)
|
url = "https://github.com/halide/Halide/commit/ac2cd23951aff9ac3b765e51938f1e576f1f0ee9.diff?full_index=1";
|
||||||
#define HALIDE_CPP_COMPILER_HAS_FLOAT16'
|
hash = "sha256-JTktOTSyReDUEHTaPPMoi+/K/Gzg39i6MI97cO3654k=";
|
||||||
|
})
|
||||||
|
(fetchpatch2 {
|
||||||
|
url = "https://github.com/halide/Halide/commit/59f4fff30f4ab628da9aa7e5f77a7f1bb218a779.diff?full_index=1";
|
||||||
|
hash = "sha256-yOzE+1jai1w1GQisLYfu8F9pbTE/bYg0MTLq8rPXdGk=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch =
|
||||||
|
''
|
||||||
|
substituteInPlace src/runtime/CMakeLists.txt --replace-fail \
|
||||||
|
'-isystem "''${VulkanHeaders_INCLUDE_DIR}"' \
|
||||||
|
'-isystem "''${VulkanHeaders_INCLUDE_DIR}"
|
||||||
|
-isystem "${llvmPackages.clang}/resource-root/include"'
|
||||||
|
''
|
||||||
|
# Upstream Halide include a check in their CMake files that forces Halide to
|
||||||
|
# link LLVM dynamically because of WebAssembly. It unnecessarily increases
|
||||||
|
# the closure size in cases when the WebAssembly target is not used. Hence,
|
||||||
|
# the following hack
|
||||||
|
+ lib.optionalString (!wasmSupport) ''
|
||||||
|
substituteInPlace cmake/FindHalide_LLVM.cmake --replace-fail \
|
||||||
|
'if (comp STREQUAL "WebAssembly")' \
|
||||||
|
'if (FALSE)'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DWARNINGS_AS_ERRORS=OFF"
|
|
||||||
"-DWITH_PYTHON_BINDINGS=${if pythonSupport then "ON" else "OFF"}"
|
"-DWITH_PYTHON_BINDINGS=${if pythonSupport then "ON" else "OFF"}"
|
||||||
"-DTARGET_WEBASSEMBLY=OFF"
|
(lib.cmakeBool "WITH_TESTS" doCheck)
|
||||||
|
(lib.cmakeBool "WITH_TUTORIALS" doCheck)
|
||||||
# Disable performance tests since they may fail on busy machines
|
# Disable performance tests since they may fail on busy machines
|
||||||
"-DWITH_TEST_PERFORMANCE=OFF"
|
"-DWITH_TEST_PERFORMANCE=OFF"
|
||||||
# Disable fuzzing tests -- this has become the default upstream after the
|
# Disable fuzzing tests -- this has become the default upstream after the
|
||||||
# v16 release (See https://github.com/halide/Halide/commit/09c5d1d19ec8e6280ccbc01a8a12decfb27226ba)
|
# v16 release (See https://github.com/halide/Halide/commit/09c5d1d19ec8e6280ccbc01a8a12decfb27226ba)
|
||||||
# These tests also fail to compile on Darwin because of some missing command line options...
|
# These tests also fail to compile on Darwin because of some missing command line options...
|
||||||
"-DWITH_TEST_FUZZ=OFF"
|
"-DWITH_TEST_FUZZ=OFF"
|
||||||
# Disable FetchContent for flatbuffers and use the version from nixpkgs instead
|
# Disable FetchContent and use versions from nixpkgs instead
|
||||||
"-DFLATBUFFERS_USE_FETCHCONTENT=OFF"
|
"-DHalide_USE_FETCHCONTENT=OFF"
|
||||||
"-DPYBIND11_USE_FETCHCONTENT=OFF"
|
"-DHalide_WASM_BACKEND=${if wasmSupport then "wabt" else "OFF"}"
|
||||||
|
(lib.cmakeBool "Halide_LLVM_SHARED_LIBS" wasmSupport)
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = true;
|
outputs = [
|
||||||
|
"out"
|
||||||
|
"lib"
|
||||||
|
];
|
||||||
|
|
||||||
preCheck =
|
inherit doCheck;
|
||||||
let
|
|
||||||
disabledTests = lib.strings.concatStringsSep "|" [
|
disabledTests = [
|
||||||
# Requires too much parallelism for remote builders.
|
# Requires too much parallelism for remote builders.
|
||||||
"mullapudi2016_fibonacci"
|
"mullapudi2016_fibonacci"
|
||||||
|
# Tests performance---flaky in CI
|
||||||
|
"mullapudi2016_reorder"
|
||||||
# Take too long---we don't want to run these in CI.
|
# Take too long---we don't want to run these in CI.
|
||||||
"adams2019_test_apps_autoscheduler"
|
"adams2019_test_apps_autoscheduler"
|
||||||
"anderson2021_test_apps_autoscheduler"
|
"anderson2021_test_apps_autoscheduler"
|
||||||
"correctness_cross_compilation"
|
"correctness_cross_compilation"
|
||||||
"correctness_simd_op_check_hvx"
|
"correctness_simd_op_check_hvx"
|
||||||
];
|
];
|
||||||
in
|
# ninja's setup-hook doesn't let us specify custom flags for the checkPhase, see
|
||||||
''
|
# https://discourse.nixos.org/t/building-only-specific-targets-with-cmake/31545/4
|
||||||
checkFlagsArray+=("ARGS=-E '${disabledTests}'")
|
# so we resort to overriding the whole checkPhase
|
||||||
|
dontUseNinjaCheck = true;
|
||||||
|
checkPhase = ''
|
||||||
|
runHook preCheck
|
||||||
|
ctest --exclude-regex '^(${lib.strings.concatStringsSep "|" finalAttrs.disabledTests})$'
|
||||||
|
runHook postCheck
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = lib.optionalString pythonSupport ''
|
postInstall =
|
||||||
mkdir -p $out/${builtins.dirOf python3Packages.python.sitePackages}
|
lib.optionalString pythonSupport ''
|
||||||
mv -v $out/lib/python3/site-packages $out/${python3Packages.python.sitePackages}
|
mkdir -p $lib/lib/${python3Packages.python.libPrefix}
|
||||||
rmdir $out/lib/python3/
|
mv -v $lib/lib/python3/site-packages $lib/lib/${python3Packages.python.libPrefix}
|
||||||
|
rmdir $lib/lib/python3/
|
||||||
|
''
|
||||||
|
# Debug symbols in the runtime include references to clang, but they're not
|
||||||
|
# required for running the code. llvmPackages.clang increases the runtime
|
||||||
|
# closure by at least a GB which is a waste, so we remove references to clang.
|
||||||
|
+ lib.optionalString (stdenv != llvmPackages.stdenv) ''
|
||||||
|
remove-references-to -t ${llvmPackages.clang} $lib/lib/libHalide*
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Note: only openblas and not atlas part of this Nix expression
|
# Note: only openblas and not atlas part of this Nix expression
|
||||||
@ -97,12 +143,15 @@ stdenv.mkDerivation rec {
|
|||||||
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
||||||
libgbm
|
libgbm
|
||||||
libGL
|
libGL
|
||||||
];
|
]
|
||||||
|
++ lib.optionals wasmSupport [ wabt ];
|
||||||
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
[
|
[
|
||||||
cmake
|
cmake
|
||||||
flatbuffers
|
flatbuffers
|
||||||
|
removeReferencesTo
|
||||||
|
ninja
|
||||||
]
|
]
|
||||||
++ lib.optionals pythonSupport [
|
++ lib.optionals pythonSupport [
|
||||||
python3Packages.python
|
python3Packages.python
|
||||||
@ -124,5 +173,6 @@ stdenv.mkDerivation rec {
|
|||||||
atila
|
atila
|
||||||
twesterhout
|
twesterhout
|
||||||
];
|
];
|
||||||
|
broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|||||||
@ -3621,7 +3621,7 @@ with pkgs;
|
|||||||
hal-hardware-analyzer = libsForQt5.callPackage ../applications/science/electronics/hal-hardware-analyzer { };
|
hal-hardware-analyzer = libsForQt5.callPackage ../applications/science/electronics/hal-hardware-analyzer { };
|
||||||
|
|
||||||
halide = callPackage ../development/compilers/halide {
|
halide = callPackage ../development/compilers/halide {
|
||||||
llvmPackages = llvmPackages_18;
|
llvmPackages = llvmPackages_19;
|
||||||
};
|
};
|
||||||
|
|
||||||
hareThirdParty = recurseIntoAttrs (callPackage ./hare-third-party.nix { });
|
hareThirdParty = recurseIntoAttrs (callPackage ./hare-third-party.nix { });
|
||||||
|
|||||||
@ -5769,7 +5769,7 @@ self: super: with self; {
|
|||||||
|
|
||||||
hakuin = callPackage ../development/python-modules/hakuin { };
|
hakuin = callPackage ../development/python-modules/hakuin { };
|
||||||
|
|
||||||
halide = toPythonModule (pkgs.halide.override { pythonSupport = true; python3Packages = self; });
|
halide = toPythonModule (pkgs.halide.override { pythonSupport = true; python3Packages = self; }).lib;
|
||||||
|
|
||||||
halo = callPackage ../development/python-modules/halo { };
|
halo = callPackage ../development/python-modules/halo { };
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user