summary refs log tree commit diff
path: root/pkgs/development/libraries/science/math/openblas
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/science/math/openblas')
-rw-r--r--pkgs/development/libraries/science/math/openblas/0.2.10.nix13
-rw-r--r--pkgs/development/libraries/science/math/openblas/0.2.2.nix37
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix41
3 files changed, 77 insertions, 14 deletions
diff --git a/pkgs/development/libraries/science/math/openblas/0.2.10.nix b/pkgs/development/libraries/science/math/openblas/0.2.10.nix
index a8db0631911..ec4422ce895 100644
--- a/pkgs/development/libraries/science/math/openblas/0.2.10.nix
+++ b/pkgs/development/libraries/science/math/openblas/0.2.10.nix
@@ -1,5 +1,8 @@
-{ stdenv, fetchurl, gfortran, perl, liblapack }:
+{ stdenv, fetchurl, gfortran, perl, liblapack, config }:
 
+let local = config.openblas.preferLocalBuild or false;
+    localTarget = config.openblas.target or "";
+in
 stdenv.mkDerivation rec {
   version = "0.2.10";
 
@@ -16,17 +19,19 @@ stdenv.mkDerivation rec {
 
   cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system);
 
-  target = if cpu == "i686" then "P2" else 
+  target = if local then localTarget else
+    if cpu == "i686" then "P2" else
     if cpu == "x86_64" then "CORE2" else
      # allow autodetect
       "";
 
   makeFlags = "${if target != "" then "TARGET=" else ""}${target} FC=gfortran CC=cc PREFIX=\"\$(out)\" INTERFACE64=1";
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Basic Linear Algebra Subprograms";
-    license = stdenv.lib.licenses.bsd3;
+    license = licenses.bsd3;
     homepage = "https://github.com/xianyi/OpenBLAS";
     platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ ttuegel ];
   };
 }
diff --git a/pkgs/development/libraries/science/math/openblas/0.2.2.nix b/pkgs/development/libraries/science/math/openblas/0.2.2.nix
new file mode 100644
index 00000000000..c476dac955a
--- /dev/null
+++ b/pkgs/development/libraries/science/math/openblas/0.2.2.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, gfortran, perl, liblapack, config }:
+
+let local = config.openblas.preferLocalBuild or false;
+    localTarget = config.openblas.target or "";
+in
+stdenv.mkDerivation rec {
+  version = "0.2.2";
+
+  name = "openblas-${version}";
+  src = fetchurl {
+    url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
+    sha256 = "13kdx3knff5ajnmgn419g0dnh83plin07p7akwamr3v7z5qfrzqr";
+    name = "openblas-${version}.tar.gz";
+  };
+
+  preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz";
+
+  buildInputs = [gfortran perl];
+
+  cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system);
+
+  target = if local then localTarget else
+    if cpu == "i686" then "P2" else
+    if cpu == "x86_64" then "CORE2" else
+     # allow autodetect
+      "";
+
+  makeFlags = "${if target != "" then "TARGET=" else ""}${target} FC=gfortran CC=cc PREFIX=\"\$(out)\"";
+
+  meta = with stdenv.lib; {
+    description = "Basic Linear Algebra Subprograms";
+    license = licenses.bsd3;
+    homepage = "https://github.com/xianyi/OpenBLAS";
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ ttuegel ];
+  };
+}
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index c535b1a39db..8dc2b542be7 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -1,12 +1,25 @@
-{ stdenv, fetchurl, gfortran, perl, liblapack }:
-
+{ stdenv, fetchurl, gfortran, perl, liblapack, config }:
+
+# Minimum CPU requirements:
+# x86: Pentium 4 (Prescott, circa 2004)
+# x86_64: Opteron (circa 2003)
+# These are the settings used for the generic builds. Performance will
+# be poor on modern systems. The goal of the Hydra builds is simply to
+# support as many systems as possible. OpenBLAS may support older
+# CPU architectures, but you will need to set 'config.openblas.target'
+# and 'config.openblas.preferLocalBuild', which will build it on your
+# local machine.
+
+let local = config.openblas.preferLocalBuild or false;
+    localTarget = config.openblas.target or "";
+in
 stdenv.mkDerivation rec {
-  version = "0.2.2";
+  version = "0.2.13";
 
   name = "openblas-${version}";
   src = fetchurl {
     url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
-    sha256 = "13kdx3knff5ajnmgn419g0dnh83plin07p7akwamr3v7z5qfrzqr";
+    sha256 = "1asg5mix13ipxgj5h2yj2p0r8km1di5jbcjkn5gmhb37nx7qfv6k";
     name = "openblas-${version}.tar.gz";
   };
 
@@ -16,17 +29,25 @@ stdenv.mkDerivation rec {
 
   cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system);
 
-  target = if cpu == "i686" then "P2" else 
-    if cpu == "x86_64" then "CORE2" else
+  target = if local then localTarget else
+    if cpu == "i686" then "PRESCOTT" else
+    if cpu == "x86_64" then "OPTERON" else
      # allow autodetect
       "";
 
-  makeFlags = "${if target != "" then "TARGET=" else ""}${target} FC=gfortran CC=cc PREFIX=\"\$(out)\"";
+  makeFlags = [
+    "${if target != "" then "TARGET=" else ""}${target}"
+    "FC=gfortran"
+    "CC=gcc"
+    ''PREFIX="''$(out)"''
+    "INTERFACE64=1"
+  ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Basic Linear Algebra Subprograms";
-    license = stdenv.lib.licenses.bsd3;
+    license = licenses.bsd3;
     homepage = "https://github.com/xianyi/OpenBLAS";
-    platforms = [ "x86_64-linux" ];
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ ttuegel ];
   };
 }