about summary refs log tree commit diff
path: root/pkgs/development/libraries/science
diff options
context:
space:
mode:
authorWill Dietz <github@wdtz.org>2019-01-15 09:36:07 -0600
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-01-15 16:36:07 +0100
commit1f0467005dd43c3c0f57c87da1c298aed7ea8b46 (patch)
tree60a7d553bd57a88659c6cbf9acf10a87c4f1a510 /pkgs/development/libraries/science
parentbefac4ae4bdb84c81086f60a2bd63a96ad8106e4 (diff)
downloadnixlib-1f0467005dd43c3c0f57c87da1c298aed7ea8b46.tar
nixlib-1f0467005dd43c3c0f57c87da1c298aed7ea8b46.tar.gz
nixlib-1f0467005dd43c3c0f57c87da1c298aed7ea8b46.tar.bz2
nixlib-1f0467005dd43c3c0f57c87da1c298aed7ea8b46.tar.lz
nixlib-1f0467005dd43c3c0f57c87da1c298aed7ea8b46.tar.xz
nixlib-1f0467005dd43c3c0f57c87da1c298aed7ea8b46.tar.zst
nixlib-1f0467005dd43c3c0f57c87da1c298aed7ea8b46.zip
openblas: 0.3.4 -> 0.3.5, rework a bit (#53972)
* openblas: simplify a bit, fix doCheck so tests are enabled non-cross.

* doCheck should be 'true' in (at least) the non-cross case,
  this looks like an inverted check that's largely benign
* doCheck will be set to 'false' in the cross case anyway,
  makeDerivation does this IIRC
* targetPrefix can be used without checking, probably by design

Derivation hash does change but no "real" functionality change intended.

* openblas: nix types for config attrs (hash-preserving)

* openblas: more nix-ification, merge in cross attrs, prefer to always set

(but set appropriately for cross and non-cross cases both)

* I'm not sure what NO_BINARY_MODE does,
  this change now sets explicitly false in the non-cross scenario
  (previously unset unless cross).
* Drop musl NO_AFFINITY case, will be removed in upgrade shortly

* openblas: 0.3.4 -> 0.3.5
Diffstat (limited to 'pkgs/development/libraries/science')
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix76
1 files changed, 33 insertions, 43 deletions
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index e4c05896125e..3d516fb5d9dd 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -14,46 +14,46 @@ let
   # To add support for a new platform, add an element to this set.
   configs = {
     armv6l-linux = {
-      BINARY = "32";
+      BINARY = 32;
       TARGET = "ARMV6";
-      DYNAMIC_ARCH = "0";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = false;
+      USE_OPENMP = true;
     };
 
     armv7l-linux = {
-      BINARY = "32";
+      BINARY = 32;
       TARGET = "ARMV7";
-      DYNAMIC_ARCH = "0";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = false;
+      USE_OPENMP = true;
     };
 
     aarch64-linux = {
-      BINARY = "64";
+      BINARY = 64;
       TARGET = "ARMV8";
-      DYNAMIC_ARCH = "1";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = true;
     };
 
     i686-linux = {
-      BINARY = "32";
+      BINARY = 32;
       TARGET = "P2";
-      DYNAMIC_ARCH = "1";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = true;
     };
 
     x86_64-darwin = {
-      BINARY = "64";
+      BINARY = 64;
       TARGET = "ATHLON";
-      DYNAMIC_ARCH = "1";
-      USE_OPENMP = "0";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = false;
       MACOSX_DEPLOYMENT_TARGET = "10.7";
     };
 
     x86_64-linux = {
-      BINARY = "64";
+      BINARY = 64;
       TARGET = "ATHLON";
-      DYNAMIC_ARCH = "1";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = true;
     };
   };
 in
@@ -72,25 +72,16 @@ let
 in
 stdenv.mkDerivation rec {
   name = "openblas-${version}";
-  version = "0.3.4";
+  version = "0.3.5";
   src = fetchFromGitHub {
     owner = "xianyi";
     repo = "OpenBLAS";
     rev = "v${version}";
-    sha256 = "1jdq4msfyg13pdmwwfqpixf4fshss68qzls820lmn0i6y7h4aix3";
+    sha256 = "0hwfplr6ciqjvfqkya5vz92z2rx8bhdg5mkh923z246ylhs6d94k";
   };
 
   inherit blas64;
 
-  patches = [
-    # Fixes build on x86_64-darwin. See:
-    # https://github.com/xianyi/OpenBLAS/issues/1926
-    (fetchpatch {
-      url = https://github.com/xianyi/OpenBLAS/commit/701ea88347461e4c5d896765438dc870281b3834.patch;
-      sha256 = "18rcfgkjsijl9d2510jn961wqvz7zdlz2fgy1yjmax29kvv8fqd9";
-    })
-  ];
-
   # Some hardening features are disabled due to sporadic failures in
   # OpenBLAS-based programs. The problem may not be with OpenBLAS itself, but
   # with how these flags interact with hardening measures used downstream.
@@ -115,20 +106,19 @@ stdenv.mkDerivation rec {
     coreutils
   ];
 
-  makeFlags =
-    [
-      "FC=${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) stdenv.cc.targetPrefix}gfortran"
-      "CC=${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) stdenv.cc.targetPrefix}cc"
-      ''PREFIX="''$(out)"''
-      "NUM_THREADS=64"
-      "INTERFACE64=${if blas64 then "1" else "0"}"
-      "NO_STATIC=1"
-    ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "musl") "NO_AFFINITY=1"
-    ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "NO_BINARY_MODE=1" "HOSTCC=cc" "CROSS=1" ]
-    ++ mapAttrsToList (var: val: var + "=" + val) config;
-
-  doCheck = stdenv.hostPlatform != stdenv.buildPlatform;
+  makeFlags = mapAttrsToList (var: val: "${var}=${toString val}") (config // {
+    FC = "${stdenv.cc.targetPrefix}gfortran";
+    CC = "${stdenv.cc.targetPrefix}cc";
+    PREFIX = placeholder "out";
+    NUM_THREADS = 64;
+    INTERFACE64 = blas64;
+    NO_STATIC = true;
+    CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
+    HOSTCC = "${buildPackages.stdenv.cc.targetPrefix}cc";
+    NO_BINARY_MODE = stdenv.hostPlatform != stdenv.buildPlatform;
+  });
+
+  doCheck = true;
   checkTarget = "tests";
 
   postInstall = ''