From df731f151faafc4e68f4504d60be0968faecd6bd Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 28 Aug 2014 16:39:01 -0500 Subject: [PATCH] openblas: add version 0.2.11 --- .../science/math/openblas/default.nix | 36 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/science/math/openblas/default.nix diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix new file mode 100644 index 00000000000..a1811a4209c --- /dev/null +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -0,0 +1,36 @@ +{ 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.11"; + + name = "openblas-${version}"; + src = fetchurl { + url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}"; + sha256 = "1va4yhzgj2chcj6kaxgfbzirajp1zgvkic61959aka2xq2c5igms"; + 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)\" INTERFACE64=1"; + + meta = { + description = "Basic Linear Algebra Subprograms"; + license = stdenv.lib.licenses.bsd3; + homepage = "https://github.com/xianyi/OpenBLAS"; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6cea37064cc..1942be80a7c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10919,7 +10919,9 @@ let # julia is pinned to specific versions of openblas, so keep old versions # until they aren't needed. The un-versioned attribute may continue to track # upstream development. - openblas = openblas_0_2_10; + openblas = callPackage ../development/libraries/science/math/openblas { + liblapack = liblapack_3_5_0; + }; openblas_0_2_10 = callPackage ../development/libraries/science/math/openblas/0.2.10.nix { liblapack = liblapack_3_5_0; };