2012-04-05 13:18:08 +01:00
|
|
|
{ stdenv, fetchurl, gfortran, tolerateCpuTimingInaccuracy ? true, shared ? false }:
|
2012-02-23 11:33:26 +00:00
|
|
|
|
|
|
|
let
|
2013-02-06 10:31:49 +00:00
|
|
|
version = "3.10.1";
|
|
|
|
|
2012-02-23 11:33:26 +00:00
|
|
|
optionalString = stdenv.lib.optionalString;
|
2013-02-06 10:31:49 +00:00
|
|
|
optional = stdenv.lib.optional;
|
2012-02-23 11:33:26 +00:00
|
|
|
in
|
2008-10-05 10:01:59 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-02-06 10:31:49 +00:00
|
|
|
name = "atlas-${version}";
|
2012-02-23 11:33:26 +00:00
|
|
|
|
2008-10-05 10:01:59 +01:00
|
|
|
src = fetchurl {
|
2013-02-06 10:31:49 +00:00
|
|
|
url = "mirror://sourceforge/math-atlas/atlas${version}.tar.bz2";
|
|
|
|
sha256 = "11ncgdc7kzb2y2gqb3sgarm5saj9fr07r3h2yh2h5bja429b85d2";
|
2008-10-05 10:01:59 +01:00
|
|
|
};
|
|
|
|
|
2013-02-06 10:31:49 +00:00
|
|
|
# Atlas aborts the build if it detects that some kind of CPU frequency
|
|
|
|
# scaling is active on the build machine because that feature offsets the
|
|
|
|
# performance timings. We ignore that check, however, because with binaries
|
|
|
|
# being pre-built on Hydra those timings aren't accurate for the local
|
|
|
|
# machine in the first place.
|
|
|
|
patches = optional tolerateCpuTimingInaccuracy ./disable-timing-accuracy-check.patch;
|
|
|
|
|
2012-02-23 11:33:26 +00:00
|
|
|
# Configure outside of the source directory.
|
2008-12-02 22:55:33 +00:00
|
|
|
preConfigure = '' mkdir build; cd build; configureScript=../configure; '';
|
|
|
|
|
2012-04-13 19:46:24 +01:00
|
|
|
# * -fPIC allows to build atlas inside shared objects, as octave does.
|
2012-02-23 11:33:26 +00:00
|
|
|
#
|
2012-04-13 19:46:24 +01:00
|
|
|
# * Atlas detects the cpu and does some tricks. For example, notices the
|
|
|
|
# hydra AMD Family 10h computer, and uses a SSE trick for it (bit 17 of MXCSR)
|
|
|
|
# available, for what I know, only in that family. So we hardcode K7
|
|
|
|
# -A 31 = Athlon K7
|
|
|
|
# -A 18 = Pentium II
|
|
|
|
# -V 192 = SSE1|SSE2 (Or it takes SSE3 somehow in my machine without SSE3)
|
2012-04-15 13:44:48 +01:00
|
|
|
# -V 1 = No SIMD (Pentium II does not have any SSE)
|
2012-04-13 19:46:24 +01:00
|
|
|
# -t 0 = No threading
|
2012-04-15 09:11:12 +01:00
|
|
|
configureFlags = "-Fa alg -fPIC -t 0"
|
2012-04-15 13:44:48 +01:00
|
|
|
+ optionalString stdenv.isi686 " -b 32 -A 18 -V 1"
|
2012-04-14 19:58:30 +01:00
|
|
|
+ optionalString stdenv.isx86_64 " -A 31 -V 192"
|
2012-04-05 13:18:08 +01:00
|
|
|
+ optionalString shared " --shared "
|
|
|
|
;
|
2008-12-02 22:55:33 +00:00
|
|
|
|
2010-07-28 12:55:54 +01:00
|
|
|
buildInputs = [ gfortran ];
|
2008-10-05 10:01:59 +01:00
|
|
|
|
2012-02-22 22:40:35 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2008-10-05 10:01:59 +01:00
|
|
|
meta = {
|
2012-02-23 11:33:26 +00:00
|
|
|
homepage = "http://math-atlas.sourceforge.net/";
|
|
|
|
description = "Automatically Tuned Linear Algebra Software (ATLAS)";
|
2010-07-28 12:55:54 +01:00
|
|
|
license = "GPL";
|
2012-02-23 11:33:26 +00:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
The ATLAS (Automatically Tuned Linear Algebra Software) project is an ongoing
|
|
|
|
research effort focusing on applying empirical techniques in order to provide
|
|
|
|
portable performance. At present, it provides C and Fortran77 interfaces to a
|
|
|
|
portably efficient BLAS implementation, as well as a few routines from LAPACK.
|
|
|
|
'';
|
2008-10-05 10:01:59 +01:00
|
|
|
};
|
|
|
|
}
|