Merge pull request #84382 from nh2/openblas-add-singleThreaded-option

openblas: Add `singleThreaded` option. Off by default.
This commit is contained in:
Niklas Hambüchen 2020-04-08 13:49:32 +02:00 committed by GitHub
commit f3cf0f074a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,14 @@
# pointer width, but some expect to use 32-bit integers always
# (for compatibility with reference BLAS).
, blas64 ? null
# Multi-threaded applications must not call a threaded OpenBLAS
# (the only exception is when an application uses OpenMP as its
# *only* form of multi-threading). See
# https://github.com/xianyi/OpenBLAS/wiki/Faq/4bded95e8dc8aadc70ce65267d1093ca7bdefc4c#multi-threaded
# https://github.com/xianyi/OpenBLAS/issues/2543
# This flag builds a single-threaded OpenBLAS using the flags
# stated in thre.
, singleThreaded ? false
, buildPackages
# Select a specific optimization target (other than the default)
# See https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
@ -146,7 +154,12 @@ stdenv.mkDerivation rec {
NO_BINARY_MODE = if stdenv.isx86_64
then toString (stdenv.hostPlatform != stdenv.buildPlatform)
else stdenv.hostPlatform != stdenv.buildPlatform;
});
} // (stdenv.lib.optionalAttrs singleThreaded {
# As described on https://github.com/xianyi/OpenBLAS/wiki/Faq/4bded95e8dc8aadc70ce65267d1093ca7bdefc4c#multi-threaded
USE_THREAD = false;
USE_LOCKING = true; # available with openblas >= 0.3.7
USE_OPENMP = false; # openblas will refuse building with both USE_OPENMP=1 and USE_THREAD=0
}));
doCheck = true;
checkTarget = "tests";