summary refs log tree commit diff
path: root/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
blob: d345827ed4eb6054e4fde9fff7277b9a4f813a60 (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
{ stdenv
, fetchurl
, cmake
, singlePrec ? true
, mpiEnabled ? false
, fftw
, openmpi
, perl
}:

stdenv.mkDerivation {
  name = "gromacs-2020.2";

  src = fetchurl {
    url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-2020.2.tar.gz";
    sha256 = "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl";
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [ fftw perl ]
  ++ (stdenv.lib.optionals mpiEnabled [ openmpi ]);

  cmakeFlags = (
    if singlePrec then [
      "-DGMX_DOUBLE=OFF"
    ] else [
      "-DGMX_DOUBLE=ON"
      "-DGMX_DEFAULT_SUFFIX=OFF"
    ]
  ) ++ (
    if mpiEnabled then [
      "-DGMX_MPI:BOOL=TRUE"
      "-DGMX_CPU_ACCELERATION:STRING=SSE4.1"
      "-DGMX_OPENMP:BOOL=TRUE"
      "-DGMX_THREAD_MPI:BOOL=FALSE"
    ] else [
      "-DGMX_MPI:BOOL=FALSE"
    ]
  );

  meta = with stdenv.lib; {
    homepage = "http://www.gromacs.org";
    license = licenses.gpl2;
    description = "Molecular dynamics software package";
    longDescription = ''
      GROMACS is a versatile package to perform molecular dynamics,
      i.e. simulate the Newtonian equations of motion for systems
      with hundreds to millions of particles.

      It is primarily designed for biochemical molecules like
      proteins, lipids and nucleic acids that have a lot of
      complicated bonded interactions, but since GROMACS is
      extremely fast at calculating the nonbonded interactions (that
      usually dominate simulations) many groups are also using it
      for research on non-biological systems, e.g. polymers.

      GROMACS supports all the usual algorithms you expect from a
      modern molecular dynamics implementation, (check the online
      reference or manual for details), but there are also quite a
      few features that make it stand out from the competition.

      See: http://www.gromacs.org/About_Gromacs for details.
    '';
    platforms = platforms.unix;
  };
}