1 { lib, stdenv, fetchurl, cmake, hwloc, fftw, perl, blas, lapack, mpi, cudatoolkit
5 , enableCuda ? config.cudaSupport
6 , cpuAcceleration ? null
10 # Select reasonable defaults for all major platforms
11 # The possible values are defined in CMakeLists.txt:
12 # AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256
13 # AVX2_128 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD
14 SIMD = x: if (cpuAcceleration != null) then x else
15 if stdenv.hostPlatform.system == "i686-linux" then "SSE2" else
16 if stdenv.hostPlatform.system == "x86_64-linux" then "SSE4.1" else
17 if stdenv.hostPlatform.system == "x86_64-darwin" then "SSE4.1" else
18 if stdenv.hostPlatform.system == "aarch64-linux" then "ARM_NEON_ASIMD" else
21 in stdenv.mkDerivation rec {
26 url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-${version}.tar.gz";
27 sha256 = "sha256-Tsj40MevdrE/j9FtuOLBIOdJ3kOa6VVNn2U/gS140cs=";
30 patches = [ ./pkgconfig.patch ];
32 outputs = [ "out" "dev" "man" ];
34 nativeBuildInputs = [ cmake ];
42 ] ++ lib.optional enableMpi mpi
43 ++ lib.optional enableCuda cudatoolkit
46 propagatedBuildInputs = lib.optional enableMpi mpi;
47 propagatedUserEnvPkgs = lib.optional enableMpi mpi;
50 "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}"
51 "-DGMX_OPENMP:BOOL=TRUE"
52 "-DBUILD_SHARED_LIBS=ON"
58 "-DGMX_DEFAULT_SUFFIX=OFF"
64 "-DGMX_THREAD_MPI:BOOL=FALSE"
67 "-DGMX_MPI:BOOL=FALSE"
69 ) ++ lib.optional enableCuda "-DGMX_GPU=CUDA";
72 moveToOutput share/cmake $dev
76 homepage = "https://www.gromacs.org";
77 license = licenses.lgpl21Plus;
78 description = "Molecular dynamics software package";
80 GROMACS is a versatile package to perform molecular dynamics,
81 i.e. simulate the Newtonian equations of motion for systems
82 with hundreds to millions of particles.
84 It is primarily designed for biochemical molecules like
85 proteins, lipids and nucleic acids that have a lot of
86 complicated bonded interactions, but since GROMACS is
87 extremely fast at calculating the nonbonded interactions (that
88 usually dominate simulations) many groups are also using it
89 for research on non-biological systems, e.g. polymers.
91 GROMACS supports all the usual algorithms you expect from a
92 modern molecular dynamics implementation, (check the online
93 reference or manual for details), but there are also quite a
94 few features that make it stand out from the competition.
96 See: https://www.gromacs.org/about.html for details.
98 platforms = platforms.unix;
99 maintainers = with maintainers; [ sheepforce markuskowa ];