1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-29 17:10:48 +00:00
nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix

54 lines
1.6 KiB
Nix
Raw Normal View History

2014-08-28 22:39:01 +01:00
{ stdenv, fetchurl, gfortran, perl, liblapack, config }:
2015-02-26 12:44:03 +00:00
# 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.
2014-08-28 22:39:01 +01:00
let local = config.openblas.preferLocalBuild or false;
localTarget = config.openblas.target or "";
in
stdenv.mkDerivation rec {
2014-12-15 17:14:07 +00:00
version = "0.2.13";
2014-08-28 22:39:01 +01:00
name = "openblas-${version}";
src = fetchurl {
url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
2014-12-15 17:14:07 +00:00
sha256 = "1asg5mix13ipxgj5h2yj2p0r8km1di5jbcjkn5gmhb37nx7qfv6k";
2014-08-28 22:39:01 +01:00
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
2015-02-26 12:44:03 +00:00
if cpu == "i686" then "PRESCOTT" else
if cpu == "x86_64" then "OPTERON" else
2014-08-28 22:39:01 +01:00
# allow autodetect
"";
2015-02-26 12:44:03 +00:00
makeFlags = [
"${if target != "" then "TARGET=" else ""}${target}"
"FC=gfortran"
"CC=gcc"
''PREFIX="''$(out)"''
"INTERFACE64=1"
];
2014-08-28 22:39:01 +01:00
2014-08-29 16:02:39 +01:00
meta = with stdenv.lib; {
2014-08-28 22:39:01 +01:00
description = "Basic Linear Algebra Subprograms";
2014-08-29 16:02:39 +01:00
license = licenses.bsd3;
2014-08-28 22:39:01 +01:00
homepage = "https://github.com/xianyi/OpenBLAS";
2015-02-26 12:44:03 +00:00
platforms = with platforms; linux;
2014-08-29 16:02:39 +01:00
maintainers = with maintainers; [ ttuegel ];
2014-08-28 22:39:01 +01:00
};
}