2014-08-29 01:34:41 +02:00
|
|
|
{ stdenv, fetchurl, gfortran, perl, liblapack, config }:
|
2014-08-23 22:24:46 +02:00
|
|
|
|
2014-08-29 01:34:41 +02:00
|
|
|
let local = config.openblas.preferLocalBuild or false;
|
|
|
|
localTarget = config.openblas.target or "";
|
|
|
|
in
|
2014-08-23 22:24:46 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "0.2.10";
|
|
|
|
|
|
|
|
name = "openblas-${version}";
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
|
|
|
|
sha256 = "06i0q4qnd5q5xljzrgvda0gjsczc6l2pl9hw6dn2qjpw38al73za";
|
|
|
|
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);
|
|
|
|
|
2014-08-29 01:34:41 +02:00
|
|
|
target = if local then localTarget else
|
|
|
|
if cpu == "i686" then "P2" else
|
2014-08-23 22:24:46 +02:00
|
|
|
if cpu == "x86_64" then "CORE2" else
|
|
|
|
# allow autodetect
|
|
|
|
"";
|
|
|
|
|
|
|
|
makeFlags = "${if target != "" then "TARGET=" else ""}${target} FC=gfortran CC=cc PREFIX=\"\$(out)\" INTERFACE64=1";
|
|
|
|
|
2014-08-29 17:02:39 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-23 22:24:46 +02:00
|
|
|
description = "Basic Linear Algebra Subprograms";
|
2014-08-29 17:02:39 +02:00
|
|
|
license = licenses.bsd3;
|
2014-08-23 22:24:46 +02:00
|
|
|
homepage = "https://github.com/xianyi/OpenBLAS";
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2014-08-29 17:02:39 +02:00
|
|
|
maintainers = with maintainers; [ ttuegel ];
|
2014-08-23 22:24:46 +02:00
|
|
|
};
|
|
|
|
}
|