openblas: Enable & honour parallel building

This commit is contained in:
OPNA2608 2022-09-25 18:06:39 +02:00
parent 6fcaded221
commit abcaa92123

View File

@ -174,6 +174,8 @@ stdenv.mkDerivation rec {
buildPackages.stdenv.cc
];
enableParallelBuilding = true;
makeFlags = mkMakeFlagsFromConfig (config // {
FC = "${stdenv.cc.targetPrefix}gfortran";
CC = "${stdenv.cc.targetPrefix}${if stdenv.cc.isClang then "clang" else "cc"}";
@ -191,6 +193,10 @@ stdenv.mkDerivation rec {
NO_BINARY_MODE = if stdenv.isx86_64
then toString (stdenv.hostPlatform != stdenv.buildPlatform)
else stdenv.hostPlatform != stdenv.buildPlatform;
# This disables automatic build job count detection (which honours neither enableParallelBuilding nor NIX_BUILD_CORES)
# and uses the main make invocation's job count, falling back to 1 if no parallelism is used.
# https://github.com/xianyi/OpenBLAS/blob/v0.3.20/getarch.c#L1781-L1792
MAKE_NB_JOBS = 0;
} // (lib.optionalAttrs singleThreaded {
# As described on https://github.com/xianyi/OpenBLAS/wiki/Faq/4bded95e8dc8aadc70ce65267d1093ca7bdefc4c#multi-threaded
USE_THREAD = false;