2015-05-28 16:56:29 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
gfortran,
|
|
|
|
cmake,
|
2016-10-18 08:10:42 +00:00
|
|
|
python2,
|
2015-05-28 16:56:29 +00:00
|
|
|
atlas ? null,
|
2015-05-29 02:46:09 +00:00
|
|
|
shared ? false
|
2015-05-28 16:56:29 +00:00
|
|
|
}:
|
2013-07-04 11:26:34 +00:00
|
|
|
let
|
2015-05-28 16:56:29 +00:00
|
|
|
atlasMaybeShared = if atlas != null then atlas.override { inherit shared; }
|
|
|
|
else null;
|
2012-04-05 12:18:56 +00:00
|
|
|
usedLibExtension = if shared then ".so" else ".a";
|
2018-07-20 19:36:12 +00:00
|
|
|
inherit (stdenv.lib) optional optionals;
|
2018-05-06 19:09:56 +00:00
|
|
|
version = "3.8.0";
|
2012-04-05 12:18:56 +00:00
|
|
|
in
|
2015-05-28 16:56:29 +00:00
|
|
|
|
2014-08-23 20:24:46 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "liblapack-${version}";
|
2008-10-05 09:01:59 +00:00
|
|
|
src = fetchurl {
|
2018-05-06 19:09:56 +00:00
|
|
|
url = "http://www.netlib.org/lapack/lapack-${version}.tar.gz";
|
|
|
|
sha256 = "1xmwi2mqmipvg950gb0rhgprcps8gy8sjm8ic9rgy2qjlv22rcny";
|
2008-10-05 09:01:59 +00:00
|
|
|
};
|
|
|
|
|
2012-04-05 12:18:56 +00:00
|
|
|
propagatedBuildInputs = [ atlasMaybeShared ];
|
2012-02-21 21:43:44 +00:00
|
|
|
buildInputs = [ gfortran cmake ];
|
2016-10-18 08:10:42 +00:00
|
|
|
nativeBuildInputs = [ python2 ];
|
2010-01-26 14:53:13 +00:00
|
|
|
|
2012-02-21 21:43:44 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_OPTIMIZED_BLAS=ON"
|
|
|
|
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
2012-04-05 12:18:56 +00:00
|
|
|
]
|
2015-05-28 16:56:29 +00:00
|
|
|
++ (optionals (atlas != null) [
|
|
|
|
"-DBLAS_ATLAS_f77blas_LIBRARY=${atlasMaybeShared}/lib/libf77blas${usedLibExtension}"
|
|
|
|
"-DBLAS_ATLAS_atlas_LIBRARY=${atlasMaybeShared}/lib/libatlas${usedLibExtension}"
|
|
|
|
])
|
2015-05-27 19:40:44 +00: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 12:18:56 +00:00
|
|
|
;
|
2008-10-05 09:01:59 +00:00
|
|
|
|
2012-04-05 12:18:56 +00:00
|
|
|
doCheck = ! shared;
|
2012-02-22 22:41:27 +00:00
|
|
|
|
|
|
|
checkPhase = "
|
|
|
|
ctest
|
|
|
|
";
|
|
|
|
|
2012-02-21 21:43:44 +00:00
|
|
|
enableParallelBuilding = true;
|
2010-01-26 14:53:13 +00:00
|
|
|
|
2012-02-22 22:41:27 +00:00
|
|
|
passthru = {
|
|
|
|
blas = atlas;
|
|
|
|
};
|
|
|
|
|
2015-05-27 19:56:04 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-23 20:24:46 +00:00
|
|
|
inherit version;
|
2010-01-26 14:53:13 +00:00
|
|
|
description = "Linear Algebra PACKage";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = http://www.netlib.org/lapack/;
|
2015-05-28 17:20:29 +00:00
|
|
|
license = licenses.bsd3;
|
2015-05-27 19:56:04 +00:00
|
|
|
platforms = platforms.all;
|
2008-10-05 09:01:59 +00:00
|
|
|
};
|
|
|
|
}
|