about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix
blob: 5343f102b249c814f24f85fb16e3d094324fa7f9 (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
{ lib, stdenv, fetchurl, blas, lapack } :

stdenv.mkDerivation rec {
  pname = "ergoscf";
  version = "3.8.2";

  src = fetchurl {
    url = "http://www.ergoscf.org/source/tarfiles/ergo-${version}.tar.gz";
    sha256 = "sha256-U0NVREEZ8HI0Q0ZcbwvZsYA76PWMh7bqgDG1uaUc01c=";
  };

  buildInputs = [ blas lapack ];

  patches = [ ./math-constants.patch ];

  postPatch = ''
    patchShebangs ./test
  '';

  configureFlags = [
    "--enable-linalgebra-templates"
    "--enable-performance"
  ] ++ lib.optional stdenv.isx86_64 "--enable-sse-intrinsics";

  LDFLAGS = "-lblas -llapack";

  enableParallelBuilding = true;

  OMP_NUM_THREADS = 2; # required for check phase

  # With "fortify3", there are test failures, such as:
  # Testing cnof CAMB3LYP/6-31G using FMM
  # *** buffer overflow detected ***: terminated
  # ./test_fmm_camb3lyp.sh: line 81: 1061289 Aborted                 (core dumped) ./ergo <<EOINPUT > /dev/null
  hardeningDisable = [ "fortify3" ];

  doCheck = true;

  meta = with lib; {
    description = "Quantum chemistry program for large-scale self-consistent field calculations";
    homepage = "http://www.ergoscf.org";
    license = licenses.gpl3Plus;
    maintainers = [ maintainers.markuskowa ];
    platforms = platforms.linux;
  };
}