summary refs log tree commit diff
path: root/pkgs/development/libraries/qrupdate/default.nix
blob: 85e45d3fad030a34e5f685cd038c526e388939b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv
, fetchurl
, gfortran
, openblas
}:
stdenv.mkDerivation {
  name = "qrupdate-1.1.2";
  src = fetchurl {
    url = mirror://sourceforge/qrupdate/qrupdate-1.1.2.tar.gz ;
    sha256 = "024f601685phcm1pg8lhif3lpy5j9j0k6n0r46743g4fvh8wg8g2";
  };

  configurePhase =
    ''
      export PREFIX=$out
      sed -i -e 's,^BLAS=.*,BLAS=-L${openblas}/lib -lopenblas,' \
          -e 's,^LAPACK=.*,LAPACK=-L${openblas}/lib -lopenblas,' \
          Makeconf
    ''
    + stdenv.lib.optionalString openblas.blas64
    ''
      sed -i Makeconf -e '/^FFLAGS=.*/ s/$/-fdefault-integer-8/'
    '';

  doCheck = true;

  checkTarget = "test";

  buildFlags = [ "lib" "solib" ];

  installTargets = if stdenv.isDarwin
                   then ["install-staticlib" "install-shlib"]
                   else "install";

  buildInputs = [ gfortran openblas ];

  meta = with stdenv.lib; {
    description = "Library for fast updating of qr and cholesky decompositions";
    homepage = https://sourceforge.net/projects/qrupdate/;
    license = licenses.gpl3;
    platforms = platforms.unix;
  };
}