openblas: Allow setting DYNAMIC_ARCH

This commit is contained in:
Mateusz Kowalczyk 2021-04-28 14:40:23 +09:00
parent e424c9118b
commit 60ed2deee5

@ -15,6 +15,8 @@
# Select a specific optimization target (other than the default)
# See https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
, target ? null
# Select whether DYNAMIC_ARCH is enabled or not.
, dynamicArch ? null
, enableStatic ? stdenv.hostPlatform.isStatic
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@ -25,27 +27,28 @@ let blas64_ = blas64; in
let
setTarget = x: if target == null then x else target;
setDynamicArch = x: if dynamicArch == null then x else dynamicArch;
# To add support for a new platform, add an element to this set.
configs = {
armv6l-linux = {
BINARY = 32;
TARGET = setTarget "ARMV6";
DYNAMIC_ARCH = false;
DYNAMIC_ARCH = setDynamicArch false;
USE_OPENMP = true;
};
armv7l-linux = {
BINARY = 32;
TARGET = setTarget "ARMV7";
DYNAMIC_ARCH = false;
DYNAMIC_ARCH = setDynamicArch false;
USE_OPENMP = true;
};
aarch64-darwin = {
BINARY = 64;
TARGET = setTarget "VORTEX";
DYNAMIC_ARCH = true;
DYNAMIC_ARCH = setDynamicArch true;
USE_OPENMP = false;
MACOSX_DEPLOYMENT_TARGET = "11.0";
};
@ -53,21 +56,21 @@ let
aarch64-linux = {
BINARY = 64;
TARGET = setTarget "ARMV8";
DYNAMIC_ARCH = true;
DYNAMIC_ARCH = setDynamicArch true;
USE_OPENMP = true;
};
i686-linux = {
BINARY = 32;
TARGET = setTarget "P2";
DYNAMIC_ARCH = true;
DYNAMIC_ARCH = setDynamicArch true;
USE_OPENMP = true;
};
x86_64-darwin = {
BINARY = 64;
TARGET = setTarget "ATHLON";
DYNAMIC_ARCH = true;
DYNAMIC_ARCH = setDynamicArch true;
USE_OPENMP = false;
MACOSX_DEPLOYMENT_TARGET = "10.7";
};
@ -75,14 +78,14 @@ let
x86_64-linux = {
BINARY = 64;
TARGET = setTarget "ATHLON";
DYNAMIC_ARCH = true;
DYNAMIC_ARCH = setDynamicArch true;
USE_OPENMP = !stdenv.hostPlatform.isMusl;
};
powerpc64le-linux = {
BINARY = 64;
TARGET = setTarget "POWER5";
DYNAMIC_ARCH = true;
DYNAMIC_ARCH = setDynamicArch true;
USE_OPENMP = !stdenv.hostPlatform.isMusl;
};
};