openblas: downgrade to 0.2.12, build generic target

This commit is contained in:
Thomas Tuegel 2015-04-17 07:35:19 -05:00
parent 9d3f02c5de
commit c90744fcb5

View File

@ -1,42 +1,35 @@
{ stdenv, fetchurl, gfortran, perl, liblapack, config }: { stdenv, fetchurl, gfortran, perl, liblapack, config }:
# Minimum CPU requirements: with stdenv.lib;
# 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; let local = config.openblas.preferLocalBuild or false;
localTarget = config.openblas.target or ""; genericFlags =
[
"DYNAMIC_ARCH=1"
"TARGET=GENERIC"
"NUM_THREADS=64"
];
localFlags = config.openblas.flags or
optionals (hasAttr "target" config.openblas) [ "TARGET=${config.openblas.target}" ];
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.2.13"; version = "0.2.12";
name = "openblas-${version}"; name = "openblas-${version}";
src = fetchurl { src = fetchurl {
url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}"; url = "https://github.com/xianyi/OpenBLAS/tarball/v${version}";
sha256 = "1asg5mix13ipxgj5h2yj2p0r8km1di5jbcjkn5gmhb37nx7qfv6k"; sha256 = "0389dnybfvag8zms5w1xlwcknq2l2am1vcfssjkax49r1rq2f5qg";
name = "openblas-${version}.tar.gz"; name = "openblas-${version}.tar.gz";
}; };
preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz"; preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz";
buildInputs = [gfortran perl]; nativeBuildInputs = [gfortran perl];
cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system); makeFlags =
(if local then localFlags else genericFlags)
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" "FC=gfortran"
"CC=gcc" "CC=gcc"
''PREFIX="''$(out)"'' ''PREFIX="''$(out)"''