2015-05-28 18:56:29 +02:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
gfortran,
|
|
|
|
cmake,
|
|
|
|
python,
|
|
|
|
atlas ? null,
|
2015-05-29 04:46:09 +02:00
|
|
|
shared ? false
|
2015-05-28 18:56:29 +02:00
|
|
|
}:
|
2013-07-04 13:26:34 +02:00
|
|
|
let
|
2015-05-28 18:56:29 +02:00
|
|
|
atlasMaybeShared = if atlas != null then atlas.override { inherit shared; }
|
|
|
|
else null;
|
2012-04-05 14:18:56 +02:00
|
|
|
usedLibExtension = if shared then ".so" else ".a";
|
2015-05-28 18:56:29 +02:00
|
|
|
inherit (stdenv.lib) optional optionals concatStringsSep;
|
|
|
|
inherit (builtins) hasAttr attrNames;
|
2014-08-23 22:24:46 +02:00
|
|
|
version = "3.4.1";
|
2012-04-05 14:18:56 +02:00
|
|
|
in
|
2015-05-28 18:56:29 +02:00
|
|
|
|
2014-08-23 22:24:46 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "liblapack-${version}";
|
2008-10-05 11:01:59 +02:00
|
|
|
src = fetchurl {
|
2014-08-23 22:24:46 +02:00
|
|
|
url = "http://www.netlib.org/lapack/lapack-${version}.tgz";
|
2012-08-01 17:03:52 +02:00
|
|
|
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"
|
|
|
|
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
2012-04-05 14:18:56 +02:00
|
|
|
]
|
2015-05-28 18:56:29 +02:00
|
|
|
++ (optionals (atlas != null) [
|
|
|
|
"-DBLAS_ATLAS_f77blas_LIBRARY=${atlasMaybeShared}/lib/libf77blas${usedLibExtension}"
|
|
|
|
"-DBLAS_ATLAS_atlas_LIBRARY=${atlasMaybeShared}/lib/libatlas${usedLibExtension}"
|
|
|
|
])
|
2015-05-27 21:40:44 +02:00
|
|
|
++ (optional shared "-DBUILD_SHARED_LIBS=ON")
|
|
|
|
# If we're on darwin, CMake will automatically detect impure paths. This switch
|
|
|
|
# prevents that.
|
|
|
|
++ (optional stdenv.isDarwin "-DCMAKE_OSX_SYSROOT:PATH=''")
|
2012-04-05 14:18:56 +02:00
|
|
|
;
|
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;
|
|
|
|
};
|
|
|
|
|
2015-05-27 21:56:04 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-23 22:24:46 +02:00
|
|
|
inherit version;
|
2010-01-26 15:53:13 +01:00
|
|
|
description = "Linear Algebra PACKage";
|
|
|
|
homepage = "http://www.netlib.org/lapack/";
|
2015-05-28 19:20:29 +02:00
|
|
|
license = licenses.bsd3;
|
2013-08-16 22:45:12 +02:00
|
|
|
|
2015-05-27 21:56:04 +02:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.simons ];
|
2008-10-05 11:01:59 +02:00
|
|
|
};
|
|
|
|
}
|