Skip to content

[GROMACS] [package list]

GROMACS/2024.6-cpeCray-25.03-CPU (GROMACS-2024.6-cpeCray-25.03-CPU.eb)

Install with the EasyBuild-user module:

eb GROMACS-2024.6-cpeCray-25.03-CPU.eb -r
To access module help after installation and get reminded for which stacks and partitions the module is installed, use module spider GROMACS/2024.6-cpeCray-25.03-CPU.

EasyConfig:

# Contributed by Luca Marsella and Victor Holanda Rusu (CSCS)
#
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2012-2013 University of Luxembourg / LCSB, Cyprus Institute / CaSToRC, Ghent University
# Authors::   Wiktor Jurkowski <wiktor.jurkowski@uni.lu>, Fotis Georgatos <fotis.georgatos@uni.lu>, \
# George Tsouloupas <g.tsouloupas@cyi.ac.cy>, Kenneth Hoste
# License::   MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS project and is a component of the policy:
# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-93.html
#
# Adapted by Kurt Lust (kurt.lust@uantwerpen.be) for the LUMI consortium
#
easyblock = 'CMakeMake'

# Somehow the configure phase really, really wants to find a valid Python...
local_craypython_version =   '3.11.7'

name =          'GROMACS'
version =       '2024.6'
versionsuffix = '-CPU'

homepage = 'http://www.gromacs.org'

whatis = [
    'Description: 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.',
]

description = """
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.

Binaries included:
* gmx: Compiled with support for OpenMP
* gmx_mpi: Compiled with support for MPI and OpenMP.
* gmx_d: Compiled with support for OpenMP and using double precision arithmetic.
* gmx_mpi_d: Compiled with support for MPI and OpenMP and using double precision
  arithmetic.

The module sets the environment variables that would otherwise be set by running
the script $EBROOTGROMACS/bin/GMXRC. So running this script snould not be
necessary in most cases.

The module also defines the shell function gromacs-completion that can be used to
turn bash command completion on for GROMACS. Note that unloading the module will
not turn this off, so it may have consequences for things you do later on or
conflict with the command completion of a different version of GROMACS.

Contrary to previous versions, hugepages support has been disabled as it causes
stability issues on SUSE 15SP6, the OS on LUMI after the January 2026 update.
"""

docurls = [
    f'Web-based documentation on https://manual.gromacs.org/{version}/index.html'
]

toolchain = {'name': 'cpeCray', 'version': '25.03'}
toolchainopts = {'opt': True, 'usempi': True, 'verbose': False, 'pic': True, 'openmp': True}

source_urls = ['https://ftp.gromacs.org/pub/gromacs/']
sources =     [SOURCELOWER_TAR_GZ]
checksums =   ['7cbad81f51c71a144d646515a7249aa74940b3f68071f51410e3a9473f05b339']

builddependencies = [
    ('buildtools',         '%(toolchain_version)s', '', True), # For CMake
    # ('craype-hugepages8M', EXTERNAL_MODULE), # Hugepages causes issues on SUSE 15SP6.
    (f'cray-python/{local_craypython_version}', EXTERNAL_MODULE), # Simply to make the configure phase happy.
]

local_common_opts= ' '.join( [
    '-DCMAKE_BUILD_TYPE=Release',    # General CMake option: Release build
    '-DCMAKE_INSTALL_LIBDIR=lib',    # General CMake option: Use lib instead of lib64 for consistency
    '-DGMX_OPENMP=ON -DGMX_GPU=OFF', # Build type: No GPU, OpenMP for CPU, MPI specified elsewhere
    '-DBUILD_SHARED_LIBS=ON',        # Required to be able to build GMXAPI
    '-DGMX_SIMD=AVX2_256',
    '-DGMX_CYCLE_SUBCOUNTERS=ON',
    '-DGMX_BUILD_OWN_FFTW=ON',
    '-DGMX_DEFAULT_SUFFIX=ON',
    '-DGMX_PYTHON_PACKAGE=OFF',      # Default but trying to figure out why CMake goes looking for Python.
])

configopts = [
    # single precision
    local_common_opts + '-DGMX_MPI=OFF',
    local_common_opts + '-DGMX_MPI=ON',
    # double precision
    local_common_opts + '-DGMX_MPI=OFF -DGMX_DOUBLE=ON',
    local_common_opts + '-DGMX_MPI=ON  -DGMX_DOUBLE=ON',
]

#onlytcmod = True
skipsteps = ['test']

# This does what GMXRC.bash does except that it does not enable the command completion.
modextravars = {
    'GROMACS_DIR':     '%(installdir)s',
    'GMXBIN':          '%(installdir)s/bin',
    'GMXLDLIB':        '%(installdir)s/lib64',
    'GMXMAN':          '%(installdir)s/share/man',
    'GMXDATA':         '%(installdir)s/share/data',
    'GMXTOOLCHAINDIR': '%(installdir)s/share/cmake', # Defined in the standard script but not exported.
}

local_bash_completion = """
[==[
  if test -n "${BASH_VERSION+set}" && (complete) > /dev/null 2>&1; then
    if (shopt -s extglob) > /dev/null 2>&1; then
      shopt -s extglob ;
      if [ -f $GMXBIN/gmx-completion.bash ]; then
        source $GMXBIN/gmx-completion.bash ;
        for cfile in $GMXBIN/gmx-completion-*.bash ; do
          source $cfile ;
        done ;
      fi ;
    fi ;
  elif test -n "${ZSH_VERSION+set}" > /dev/null 2>&1 ; then
    autoload bashcompinit ;
    if (bashcompinit) > /dev/null 2>&1; then
      bashcompinit ;
      if [ -f $GMXBIN/gmx-completion.bash ]; then
        source $GMXBIN/gmx-completion.bash ;
        for cfile in $GMXBIN/gmx-completion-*.bash ; do
          source $cfile ;
        done ;
      fi ;
    fi ;
  fi
]==]
"""

local_csh_completion = '"echo \'Not implemented\'"'

modluafooter = """
set_shell_function( 'gromacs-completion', %(bash_completion)s, %(csh_completion)s )
""" % {
    'bash_completion': local_bash_completion,
    'csh_completion':  local_csh_completion,
}

moduleclass = 'bio'

[GROMACS] [package list]