From 60ed2deee53be29ab25fa994059adfc6906d013d Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Wed, 28 Apr 2021 14:40:23 +0900 Subject: [PATCH] openblas: Allow setting DYNAMIC_ARCH --- .../science/math/openblas/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index c66e4ba44ef9..f464a755f6e4 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -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; }; };