nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

2014-08-28 23:39:01 +02:00
{ stdenv, fetchurl, gfortran, perl, liblapack, config }:
with stdenv.lib;
2015-02-26 13:44:03 +01:00
2014-08-28 23:39:01 +02:00
let local = config.openblas.preferLocalBuild or false;
2015-04-25 01:21:20 +02:00
binary =
{
i686-linux = "32";
x86_64-linux = "64";
}."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
genericFlags =
[
"DYNAMIC_ARCH=1"
"NUM_THREADS=64"
2015-04-25 01:21:20 +02:00
"BINARY=${binary}"
];
localFlags = config.openblas.flags or
optionals (hasAttr "target" config.openblas) [ "TARGET=${config.openblas.target}" ];
2014-08-28 23:39:01 +02:00
in
stdenv.mkDerivation rec {
2015-04-25 01:21:20 +02:00
version = "0.2.14";
2014-08-28 23:39:01 +02:00
name = "openblas-${version}";
src = fetchurl {
url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
2015-04-25 01:21:20 +02:00
sha256 = "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db";
2014-08-28 23:39:01 +02:00
name = "openblas-${version}.tar.gz";
};
preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz";
nativeBuildInputs = [gfortran perl];
makeFlags =
(if local then localFlags else genericFlags)
++
[
"FC=gfortran"
"CC=gcc"
''PREFIX="''$(out)"''
"INTERFACE64=1"
];
2014-08-28 23:39:01 +02:00
2014-08-29 17:02:39 +02:00
meta = with stdenv.lib; {
2014-08-28 23:39:01 +02:00
description = "Basic Linear Algebra Subprograms";
2014-08-29 17:02:39 +02:00
license = licenses.bsd3;
2014-08-28 23:39:01 +02:00
homepage = "https://github.com/xianyi/OpenBLAS";
2015-02-26 13:44:03 +01:00
platforms = with platforms; linux;
2014-08-29 17:02:39 +02:00
maintainers = with maintainers; [ ttuegel ];
2014-08-28 23:39:01 +02:00
};
}