about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
blob: 12531286d33d31e13f2227e0e16f4dcbd2eb56bc (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
44
45
46
47
48
49
50
51
52
{ stdenv
, lib
, fetchFromGitHub
, cmake
, lapack
, which
, gfortran
, blas
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "qrupdate";
  version = "1.1.5";

  src = fetchFromGitHub {
    owner = "mpimd-csc";
    repo = "qrupdate-ng";
    rev = "v${finalAttrs.version}";
    hash = "sha256-dHxLPrN00wwozagY2JyfZkD3sKUD2+BcnbjNgZepzFg=";
  };

  cmakeFlags = assert (blas.isILP64 == lapack.isILP64); [
    "-DCMAKE_Fortran_FLAGS=${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"
    ])}"
  ];

  doCheck = true;

  nativeBuildInputs = [
    cmake
    which
    gfortran
  ];
  buildInputs = [
    blas
    lapack
  ];

  meta = with lib; {
    description = "Library for fast updating of qr and cholesky decompositions";
    homepage = "https://github.com/mpimd-csc/qrupdate-ng";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ doronbehar ];
    platforms = platforms.unix;
  };
})