about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libint/default.nix
blob: 330fe8eac26b1daad43317a0c89b2ed114c6f323 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool
, python3, perl, gmpxx, mpfr, boost, eigen, gfortran
, enableFMA ? false
}:

stdenv.mkDerivation rec {
  pname = "libint2";
  version = "2.6.0";

  src = fetchFromGitHub {
    owner = "evaleev";
    repo = "libint";
    rev = "v${version}";
    sha256 = "0pbc2j928jyffhdp4x5bkw68mqmx610qqhnb223vdzr0n2yj5y19";
  };

  patches = [
    ./fix-paths.patch
  ];

  nativeBuildInputs = [
    autoconf
    automake
    libtool
    gfortran
    mpfr
    python3
    perl
    gmpxx
  ];

  buildInputs = [ boost ];

  enableParallelBuilding = true;

  doCheck = true;

  configureFlags = [
    "--enable-eri=2"
    "--enable-eri3=2"
    "--enable-eri2=2"
    "--with-eri-max-am=7,5,4"
    "--with-eri-opt-am=3"
    "--with-eri3-max-am=7"
    "--with-eri2-max-am=7"
    "--with-g12-max-am=5"
    "--with-g12-opt-am=3"
    "--with-g12dkh-max-am=5"
    "--with-g12dkh-opt-am=3"
    "--enable-contracted-ints"
    "--enable-shared"
   ] ++ lib.optional enableFMA "--enable-fma";

  preConfigure = ''
    ./autogen.sh
  '';

  postBuild = ''
    # build the fortran interface file
    cd export/fortran
    make libint_f.o ENABLE_FORTRAN=yes
    cd ../..
  '';

  postInstall = ''
    cp export/fortran/libint_f.mod $out/include/
  '';

  meta = with lib; {
    description = "Library for the evaluation of molecular integrals of many-body operators over Gaussian functions";
    homepage = "https://github.com/evaleev/libint";
    license = with licenses; [ lgpl3Only gpl3Only ];
    maintainers = [ maintainers.markuskowa ];
    platforms = [ "x86_64-linux" ];
  };
}