2012-04-05 14:18:56 +02:00
|
|
|
{ stdenv, fetchurl, gfortran, atlas, cmake, python, shared ? false }:
|
2013-07-04 13:26:34 +02:00
|
|
|
let
|
|
|
|
atlasMaybeShared = atlas.override { inherit shared; };
|
2012-04-05 14:18:56 +02:00
|
|
|
usedLibExtension = if shared then ".so" else ".a";
|
|
|
|
in
|
2008-10-05 11:01:59 +02:00
|
|
|
stdenv.mkDerivation {
|
2012-08-01 17:03:52 +02:00
|
|
|
name = "liblapack-3.4.1";
|
2008-10-05 11:01:59 +02:00
|
|
|
src = fetchurl {
|
2012-08-01 17:03:52 +02:00
|
|
|
url = "http://www.netlib.org/lapack/lapack-3.4.1.tgz";
|
|
|
|
sha256 = "93b910f94f6091a2e71b59809c4db4a14655db527cfc5821ade2e8c8ab75380f";
|
2008-10-05 11:01:59 +02:00
|
|
|
};
|
|
|
|
|
2012-04-05 14:18:56 +02:00
|
|
|
propagatedBuildInputs = [ atlasMaybeShared ];
|
2012-02-21 22:43:44 +01:00
|
|
|
buildInputs = [ gfortran cmake ];
|
2012-12-28 19:20:09 +01:00
|
|
|
nativeBuildInputs = [ python ];
|
2010-01-26 15:53:13 +01:00
|
|
|
|
2012-02-21 22:43:44 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_OPTIMIZED_BLAS=ON"
|
2012-04-05 14:18:56 +02:00
|
|
|
"-DBLAS_ATLAS_f77blas_LIBRARY=${atlasMaybeShared}/lib/libf77blas${usedLibExtension}"
|
|
|
|
"-DBLAS_ATLAS_atlas_LIBRARY=${atlasMaybeShared}/lib/libatlas${usedLibExtension}"
|
2012-02-21 22:43:44 +01:00
|
|
|
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
2012-04-05 14:18:56 +02:00
|
|
|
]
|
|
|
|
++ (stdenv.lib.optional shared "-DBUILD_SHARED_LIBS=ON")
|
|
|
|
;
|
2008-10-05 11:01:59 +02:00
|
|
|
|
2012-04-05 14:18:56 +02:00
|
|
|
doCheck = ! shared;
|
2012-02-22 23:41:27 +01:00
|
|
|
|
|
|
|
checkPhase = "
|
|
|
|
sed -i 's,^#!.*,#!${python}/bin/python,' lapack_testing.py
|
|
|
|
ctest
|
|
|
|
";
|
|
|
|
|
2012-02-21 22:43:44 +01:00
|
|
|
enableParallelBuilding = true;
|
2010-01-26 15:53:13 +01:00
|
|
|
|
2012-02-22 23:41:27 +01:00
|
|
|
passthru = {
|
|
|
|
blas = atlas;
|
|
|
|
};
|
|
|
|
|
2008-10-05 11:01:59 +02:00
|
|
|
meta = {
|
2010-01-26 15:53:13 +01:00
|
|
|
description = "Linear Algebra PACKage";
|
|
|
|
homepage = "http://www.netlib.org/lapack/";
|
2013-08-16 22:45:12 +02:00
|
|
|
license = "revised-BSD";
|
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.simons ];
|
2008-10-05 11:01:59 +02:00
|
|
|
};
|
|
|
|
}
|