openmpCheckPhaseHook: init

This commit is contained in:
Grimmauld 2026-06-26 17:40:20 +02:00
commit 8ff970916b
No known key found for this signature in database
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,11 @@
preCheckHooks+=('setupOmpCheck')
preInstallCheckHooks+=('setupOmpCheck')
setupOmpCheck() {
# Limit number of OpenMP threads. Default is "all cores".
# Using all cores causes high load on builders if checks are executed with NIX_BUILD_CORE parallelism.
# This gets even worse if multiple builds are scheduled on the same machine, potentially growing O(n^3) without explicit core limits.
export OMP_NUM_THREADS="${OMP_NUM_THREADS:-1}"
}

View file

@ -0,0 +1,12 @@
{
lib,
makeSetupHook,
}:
makeSetupHook {
name = "omp-checkPhase-hook";
__structuredAttrs = true;
meta.license = lib.licenses.mit;
} ./omp-check-hook.sh