2015-05-28 11:56:29 -05:00
|
|
|
{
|
2021-01-22 00:00:13 +07:00
|
|
|
lib, stdenv,
|
2019-11-22 23:22:11 +01:00
|
|
|
fetchFromGitHub,
|
2015-05-28 11:56:29 -05:00
|
|
|
gfortran,
|
|
|
|
|
cmake,
|
2020-03-26 20:03:02 -04:00
|
|
|
shared ? true
|
2015-05-28 11:56:29 -05:00
|
|
|
}:
|
2013-07-04 13:26:34 +02:00
|
|
|
let
|
2021-01-22 00:00:13 +07:00
|
|
|
inherit (lib) optional;
|
2019-11-22 23:22:11 +01:00
|
|
|
version = "3.9.0";
|
2012-04-05 12:18:56 +00:00
|
|
|
in
|
2015-05-28 11:56:29 -05:00
|
|
|
|
2021-03-06 14:08:29 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "liblapack";
|
|
|
|
|
inherit version;
|
2019-11-22 23:22:11 +01:00
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "Reference-LAPACK";
|
|
|
|
|
repo = "lapack";
|
|
|
|
|
rev = "v${version}";
|
|
|
|
|
sha256 = "0sxnc97z67i7phdmcnq8f8lmxgw10wdwvr8ami0w3pb179cgrbpb";
|
2008-10-05 09:01:59 +00:00
|
|
|
};
|
|
|
|
|
|
2021-02-13 18:34:22 +01:00
|
|
|
nativeBuildInputs = [ gfortran cmake ];
|
2010-01-26 14:53:13 +00:00
|
|
|
|
2021-03-06 14:08:29 -08:00
|
|
|
# Configure stage fails on aarch64-darwin otherwise, due to either clang 11 or gfortran 10.
|
|
|
|
|
hardeningDisable = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "stackprotector" ];
|
|
|
|
|
|
2012-02-21 21:43:44 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
|
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
2019-09-15 11:33:09 +02:00
|
|
|
"-DLAPACKE=ON"
|
2020-03-26 20:03:02 -04:00
|
|
|
"-DCBLAS=ON"
|
2021-02-13 18:34:22 +01:00
|
|
|
"-DBUILD_TESTING=ON"
|
2012-04-05 12:18:56 +00:00
|
|
|
]
|
2020-03-26 20:03:02 -04:00
|
|
|
++ optional shared "-DBUILD_SHARED_LIBS=ON";
|
2008-10-05 09:01:59 +00:00
|
|
|
|
2020-03-26 20:03:02 -04:00
|
|
|
doCheck = true;
|
2012-02-22 22:41:27 +00:00
|
|
|
|
2021-03-06 14:08:29 -08:00
|
|
|
# Some CBLAS related tests fail on Darwin:
|
|
|
|
|
# 14 - CBLAS-xscblat2 (Failed)
|
|
|
|
|
# 15 - CBLAS-xscblat3 (Failed)
|
|
|
|
|
# 17 - CBLAS-xdcblat2 (Failed)
|
|
|
|
|
# 18 - CBLAS-xdcblat3 (Failed)
|
|
|
|
|
# 20 - CBLAS-xccblat2 (Failed)
|
|
|
|
|
# 21 - CBLAS-xccblat3 (Failed)
|
|
|
|
|
# 23 - CBLAS-xzcblat2 (Failed)
|
|
|
|
|
# 24 - CBLAS-xzcblat3 (Failed)
|
|
|
|
|
#
|
|
|
|
|
# Upstream issue to track:
|
|
|
|
|
# * https://github.com/Reference-LAPACK/lapack/issues/440
|
|
|
|
|
ctestArgs = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-E '^(CBLAS-(x[sdcz]cblat[23]))$'";
|
|
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
|
runHook preCheck
|
|
|
|
|
ctest ${ctestArgs}
|
|
|
|
|
runHook postCheck
|
|
|
|
|
'';
|
|
|
|
|
|
2021-01-22 00:00:13 +07:00
|
|
|
meta = with lib; {
|
2014-08-24 00:24:46 +04:00
|
|
|
inherit version;
|
2010-01-26 14:53:13 +00:00
|
|
|
description = "Linear Algebra PACKage";
|
2020-03-31 21:11:51 -04:00
|
|
|
homepage = "http://www.netlib.org/lapack/";
|
2015-05-28 19:20:29 +02:00
|
|
|
license = licenses.bsd3;
|
2015-05-27 21:56:04 +02:00
|
|
|
platforms = platforms.all;
|
2008-10-05 09:01:59 +00:00
|
|
|
};
|
|
|
|
|
}
|