about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix19
1 files changed, 11 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
index c66e4ba44ef9..f464a755f6e4 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/nixpkgs/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;
     };
   };