2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
2021-02-05 17:12:51 +00:00
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, gfortran
|
|
|
|
, blas
|
|
|
|
, lapack
|
2020-11-06 00:33:48 +00:00
|
|
|
, which
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "qrupdate";
|
|
|
|
version = "1.1.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2020-11-06 00:33:48 +00:00
|
|
|
url = "mirror://sourceforge/qrupdate/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "024f601685phcm1pg8lhif3lpy5j9j0k6n0r46743g4fvh8wg8g2";
|
|
|
|
};
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
preBuild =
|
|
|
|
# Check that blas and lapack are compatible
|
|
|
|
assert (blas.isILP64 == lapack.isILP64);
|
|
|
|
# We don't have structuredAttrs yet implemented, and we need to use space
|
|
|
|
# seprated values in makeFlags, so only this works.
|
|
|
|
''
|
|
|
|
makeFlagsArray+=(
|
|
|
|
"LAPACK=-L${lapack}/lib -llapack"
|
|
|
|
"BLAS=-L${blas}/lib -lblas"
|
|
|
|
"PREFIX=${placeholder "out"}"
|
2022-04-27 09:35:20 +00:00
|
|
|
"FFLAGS=${toString ([
|
|
|
|
"-std=legacy"
|
|
|
|
] ++ lib.optionals blas.isILP64 [
|
|
|
|
# If another application intends to use qrupdate compiled with blas with
|
|
|
|
# 64 bit support, it should add this to it's FFLAGS as well. See (e.g):
|
|
|
|
# https://savannah.gnu.org/bugs/?50339
|
|
|
|
"-fdefault-integer-8"
|
|
|
|
])}"
|
2020-11-06 00:33:48 +00:00
|
|
|
)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkTarget = "test";
|
|
|
|
|
|
|
|
buildFlags = [ "lib" "solib" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
installTargets = lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
nativeBuildInputs = [ which gfortran ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library for fast updating of qr and cholesky decompositions";
|
|
|
|
homepage = "https://sourceforge.net/projects/qrupdate/";
|
2020-11-06 00:33:48 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ doronbehar ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|