about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-18 01:12:31 +0000
committerAlyssa Ross <hi@alyssa.is>2019-02-18 01:12:31 +0000
commit50053cda79099c9a0b2a7803aef61f730a54848f (patch)
tree6413bbed5cbdd3f58d26d54cbf1b37d54a8c3a22 /nixpkgs/pkgs/development/libraries/science
parent7fbd32a525182f2089e1098723219a1a4ef264bb (diff)
parent36f316007494c388df1fec434c1e658542e3c3cc (diff)
downloadnixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.gz
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.bz2
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.lz
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.xz
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.tar.zst
nixlib-50053cda79099c9a0b2a7803aef61f730a54848f.zip
Merge commit '36f316007494c388df1fec434c1e658542e3c3cc'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix94
1 files changed, 41 insertions, 53 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
index 8bba26efd35f..68439f5921d8 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchFromGitHub, fetchpatch, gfortran, perl, which, config, coreutils
+{ stdenv, fetchFromGitHub, fetchpatch, gfortran, perl, which, config
 # Most packages depending on openblas expect integer width to match
 # pointer width, but some expect to use 32-bit integers always
 # (for compatibility with reference BLAS).
 , blas64 ? null
-
-# Select a specifc optimization target (other than the default)
+, buildPackages
+# Select a specific optimization target (other than the default)
 # See https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
 , target ? null
 }:
@@ -19,54 +19,46 @@ let
   # To add support for a new platform, add an element to this set.
   configs = {
     armv6l-linux = {
-      BINARY = "32";
+      BINARY = 32;
       TARGET = setTarget "ARMV6";
-      DYNAMIC_ARCH = "0";
-      CC = "gcc";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = false;
+      USE_OPENMP = true;
     };
 
     armv7l-linux = {
-      BINARY = "32";
+      BINARY = 32;
       TARGET = setTarget "ARMV7";
-      DYNAMIC_ARCH = "0";
-      CC = "gcc";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = false;
+      USE_OPENMP = true;
     };
 
     aarch64-linux = {
-      BINARY = "64";
+      BINARY = 64;
       TARGET = setTarget "ARMV8";
-      DYNAMIC_ARCH = "1";
-      CC = "gcc";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = true;
     };
 
     i686-linux = {
-      BINARY = "32";
+      BINARY = 32;
       TARGET = setTarget "P2";
-      DYNAMIC_ARCH = "1";
-      CC = "gcc";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = true;
     };
 
     x86_64-darwin = {
-      BINARY = "64";
+      BINARY = 64;
       TARGET = setTarget "ATHLON";
-      DYNAMIC_ARCH = "1";
-      # Note that clang is available through the stdenv on OSX and
-      # thus is not an explicit dependency.
-      CC = "clang";
-      USE_OPENMP = "0";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = false;
       MACOSX_DEPLOYMENT_TARGET = "10.7";
     };
 
     x86_64-linux = {
-      BINARY = "64";
+      BINARY = 64;
       TARGET = setTarget "ATHLON";
-      DYNAMIC_ARCH = "1";
-      CC = "gcc";
-      USE_OPENMP = "1";
+      DYNAMIC_ARCH = true;
+      USE_OPENMP = true;
     };
   };
 in
@@ -85,25 +77,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.
@@ -119,19 +102,24 @@ stdenv.mkDerivation rec {
     "relro" "bindnow"
   ];
 
-  nativeBuildInputs =
-    [gfortran perl which]
-    ++ optionals stdenv.isDarwin [coreutils];
-
-  makeFlags =
-    [
-      "FC=gfortran"
-      ''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"
-    ++ mapAttrsToList (var: val: var + "=" + val) config;
+  nativeBuildInputs = [
+    perl
+    which
+    buildPackages.gfortran
+    buildPackages.stdenv.cc
+  ];
+
+  makeFlags = mapAttrsToList (var: val: "${var}=${toString val}") (config // {
+    FC = "${stdenv.cc.targetPrefix}gfortran";
+    CC = "${stdenv.cc.targetPrefix}${if stdenv.cc.isClang then "clang" else "cc"}";
+    PREFIX = placeholder "out";
+    NUM_THREADS = 64;
+    INTERFACE64 = blas64;
+    NO_STATIC = true;
+    CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
+    HOSTCC = "cc";
+    NO_BINARY_MODE = stdenv.hostPlatform != stdenv.buildPlatform;
+  });
 
   doCheck = true;
   checkTarget = "tests";