2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2010-08-02 12:20:39 +01:00
|
|
|
, fetchurl
|
|
|
|
, gfortran
|
2020-03-31 15:47:18 +01:00
|
|
|
, blas
|
|
|
|
, lapack
|
2020-09-21 11:21:13 +01:00
|
|
|
, which
|
2010-08-02 12:20:39 +01:00
|
|
|
}:
|
2020-09-22 22:20:47 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "qrupdate";
|
|
|
|
version = "1.1.2";
|
2010-08-02 12:20:39 +01:00
|
|
|
src = fetchurl {
|
2020-09-22 22:20:47 +01:00
|
|
|
url = "mirror://sourceforge/qrupdate/${pname}-${version}.tar.gz";
|
2015-06-07 19:44:24 +01:00
|
|
|
sha256 = "024f601685phcm1pg8lhif3lpy5j9j0k6n0r46743g4fvh8wg8g2";
|
2010-08-02 12:20:39 +01:00
|
|
|
};
|
2015-06-07 19:44:24 +01:00
|
|
|
|
2020-09-22 22:20:47 +01: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"}"
|
2021-01-21 17:00:13 +00:00
|
|
|
${lib.optionalString blas.isILP64
|
2020-12-10 17:58:49 +00:00
|
|
|
# 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
|
|
|
|
"FFLAGS=-fdefault-integer-8"
|
2020-09-22 22:20:47 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
'';
|
2012-02-22 22:41:44 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkTarget = "test";
|
|
|
|
|
2015-06-07 19:44:24 +01:00
|
|
|
buildFlags = [ "lib" "solib" ];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
installTargets = lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
|
2012-02-22 22:41:44 +00:00
|
|
|
|
2020-09-22 22:20:47 +01:00
|
|
|
buildInputs = [ gfortran ];
|
2016-08-02 17:06:29 +01:00
|
|
|
|
2020-09-21 11:21:13 +01:00
|
|
|
nativeBuildInputs = [ which ];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-10-27 13:59:39 +01:00
|
|
|
description = "Library for fast updating of qr and cholesky decompositions";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://sourceforge.net/projects/qrupdate/";
|
2020-09-22 22:20:47 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2020-09-21 11:24:04 +01:00
|
|
|
maintainers = with maintainers; [ doronbehar ];
|
2018-10-27 13:59:39 +01:00
|
|
|
platforms = platforms.unix;
|
2016-08-02 17:06:29 +01:00
|
|
|
};
|
2010-08-02 12:20:39 +01:00
|
|
|
}
|