Table of Contents

Amber MD

From Ambermd.org:

Amber is a suite of biomolecular simulation programs. It began in the late 1970's, and is maintained by an active development community; see our history page and our contributors page for more information.

The term “Amber” refers to two things. First, it is a set of molecular mechanical force fields for the simulation of biomolecules; these force fields are in the public domain, and are used in a variety of simulation programs. Second, it is a package of molecular simulation programs which includes source code and demos.

Amber is distributed in two parts: AmberTools and Amber.

This software page is a work in progress - it is not yet available for use.


Running Amber MD on Comet

Amber - Serial

Amber - Parallel / MPI

Amber - CUDA

Amber - Interactive Desktop GUI

Amber Configuration

If you require configuration details, Amber was built with the following options:

--                           3rd Party Libraries 
-- ---building bundled: ----------------------------------------------------- 
-- netcdf - for creating trajectory data files 
-- netcdf-fortran - for creating trajectory data files from Fortran 
-- kmmd - Machine-learning molecular dynamics 
-- ---using installed: ------------------------------------------------------ 
-- blas - for fundamental linear algebra calculations 
-- lapack - for fundamental linear algebra calculations 
-- zlib - for various compression and decompression tasks 
-- libbz2 - for various compression and decompression tasks 
-- libm - for fundamental math routines if they are not contained in the C library 
-- ---disabled: ------------------------------------------------ 
-- libtorch - for fundamental math routines if they are not contained in the C library 

--                                Features: 
-- MPI:                               ON 
-- MVAPICH2-GDR for GPU-GPU comm.:    OFF 
-- OpenMP:                            ON 
-- CUDA:                              ON 
-- NCCL:                              OFF 
-- Build Shared Libraries:            ON 
-- Build GUI Interfaces:              ON 
-- Build Python Programs:             ON 
--  -Python Interpreter:              /usr/bin/python3 (version 3.12) 
-- Build Perl Programs:               ON 
-- Build configuration:               RELEASE 
-- Target Processor:                  x86_64 
-- Build Documentation:               ON 
-- Sander Variants:                   normal LES API LES-API MPI LES-MPI QUICK-MPI QUICK-CUDA 
-- Install location:                  /opt/pmemd24/ 
-- Installation of Tests:             ON 

--                               Compilers: 
--         C: GNU 13.3.0 (/usr/bin/gcc) 
--       CXX: GNU 13.3.0 (/usr/bin/g++) 
--   Fortran: GNU 13.3.0 (/usr/bin/gfortran) 

--                              Building Tools: 
-- emil etc gpu_utils kmmd lib pmemd

In addition, all CFLAGS variables are set per the amber.def container definition, below. These are, per our standards for images which have GCC 14 included: CFLAGS=-O3 -march=znver5 -pipe.


Building Amber MD on Comet

Important!

This section is intended for RSE HPC staff, or users who are interested in how the software is configured. If you only need to use the software, stop reading here.

Amber appears to have few dependencies at first, but as you configure the source it looks for a lot of additional libraries. At least the following build tools are required:

It, or its dependencies, then also need these further system libraries and tools, which makes it quite a complex install:

It also then uses these third party packages which are not available as part of any OS install, and so must be downloaded, built or installed through more manual means (untar, configure, make, make install):

Package Link Wanted By Type Status Notes
MBX https://github.com/paesanilab/MBX Ambertools Optional Installed Takes more time to compile than every other step of the container build added together. We warn against parallel builds (i.e. make -j2 or higher) as each build task can grow to 20GBytes in size and quickly lead to out-of-memory errors on your build/compile host.
PLUMED https://github.com/plumed/plumed2 Ambertools Optional Installed
XBLAS http://www.netlib.org/xblas Ambertools Optional Installed
Torchani https://github.com/aiqm/torchani Ambertools Optional Installed
tng_io https://gitlab.com/gromacs/tng/ Ambertools Optional Installed
apbs https://github.com/Electrostatics/apbs Ambertools Optional Installed
umfpack https://github.com/DrTimothyAldenDavis/SuiteSparse Ambertools Optional Installed
LIO https://github.com/MALBECC/lio Ambertools Optional - LIO will not compile against CUDA SDK 12 and was not included in the build of Amber
Intel MKL Ambertools Optional - Not used on Comet due to AMD Epyc CPU architecture.
PUPIL https://pupil.sourceforge.net/ Ambertools Optional - Not installed - an optional user interface for Ambertools.
libtorch https://docs.pytorch.org/cppdocs/installing.html Ambertools Optional Installed Binary only libtorch components of PyTorch.
MVAPICH2-GDR Amber, Ambertools Optional - Used for GPU-GPU communication. Not installed on Comet.
NCCL https://github.com/NVIDIA/nccl Amber, Ambertools Optional - Used for efficient GPU communications such as in IB connected multiple GPU cards and/or NVLink. Not installed on Comet or L40S cards.

Build script:

Note that you must download the files ambertools25.tar.bz2 and pmemd24.tar.bz2 from https://ambermd.org/GetAmber.php - these are behind a download form - and they should be placed in the same directory as the build script.

#!/bin/bash

echo "Loading modules..."
module load apptainer

echo ""
echo "Building container..."
export APPTAINER_TMPDIR=/scratch

# You must supply a copy of AMBERMD tar files 
# in this SOURCE_DIR
SOURCE_DIR=`pwd`

AM24="pmemd24.tar.bz2"
AM25="ambertools25.tar.bz2"

echo ""
echo "Checking source files..."
if [ -s "$SOURCE_DIR/$AM24" ]
then
	echo "- Found - $SOURCE_DIR/$AM24"
else
	echo "- WARNING - $SOURCE_DIR/$AM24 is MISSING"
	echo ""
	echo "Press return to continue or Control+C to exit and fix"
	read	
fi

if [ -s "$SOURCE_DIR/$AM25" ]
then
    echo "- Found - $SOURCE_DIR/$AM25"
else
    echo "- WARNING - $SOURCE_DIR/$AM25 is MISSING"
    echo ""
    echo "Press return to continue or Control+C to exit and fix"
    read
fi

apptainer build --bind $SOURCE_DIR:/mnt ambermd.24.25.sif ambermd.def 2>&1 | tee ambermd.log

Container Definition:

Bootstrap: docker
From: nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04

####################################################################
#
# Amber MD container
# ==================
# This is a runtime environment for the Ambder MD tools.
# Please see: 
#	https://hpc.researchcomputing.ncl.ac.uk/dokuwiki/dokuwiki/doku.php?id=advanced:software:ambermd
#
####################################################################

%post
    # Prevent interactive prompts
    export DEBIAN_FRONTEND=noninteractive

####################################################################
#
# Basic system packages
#
####################################################################

    # Update & install only necessary packages
    apt-get update
	# Base stuff everything will need
	apt-get install -y apt-utils wget build-essential aptitude gcc g++ gfortran cmake automake autoconf vim less git

	# These are specifically needed by Amber MD
	apt-get install -y \
		libopenmpi-dev \
		python3 \
		flex \
		bison \
		m4 \
		liblapack-dev \
		libblas-dev \
		libarpack2-dev \
		libucpp-dev \
		libnlopt-dev \
		libz-dev \
		libbz2-dev \
		libapbs-dev \
		libfftw3-mpi-dev \
		libfftw3-dev \
		libprotobuf-dev \
		xorg-dev \
		libxext-dev \
		libxt-dev \
		libx11-dev \
		libice-dev \
		libsm-dev \
		libgomp1 \
		devscripts \
		debhelper \
		fakeroot

	# Python 3 modules needed by Amber MD
	apt-get install -y \
		python3-pip \
		python3-numpy \
		python3-tk \
		python3-scipy \
		python3-matplotlib

    # Clean up APT cache to save space
    apt-get clean

	# Clean out Python pip cache
	pip3 cache purge 

#################################################################################
#
# This is all the custom stuff needed to build the various bioinformatics tools
#
#################################################################################

	# This flag needs to be set to indicate which CPU architecture we
	# are optimising for.
	AMD_ARCH=1

	if [ "$AMD_ARCH" = "1" ]
	then
		# Compiling on AMD Epyc
		export BASE_CFLAGS="-O3 -march=native -pipe"
		export BASE_CFLAGS_ALT="-O3 -march=native -pipe"
		export MAKE_JOBS=8
	else
		# Compiling on generic system
		export BASE_CFLAGS="-O"
		export BASE_CFLAGS_ALT="-O"
		export MAKE_JOBS=8
	fi
	
	export CFLAGS="$BASE_CFLAGS"
	export CPPFLAGS=""
	export CXXFLAGS="$CFLAGS"
	export LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH
	export PATH=/opt/bin:$PATH

	echo ""
	echo "Post-OS-install setup for Bio apps container"
	echo "============================================"

	# A download place for external libraries
	mkdir -p /src/zipped
	
	# Where installations go
	mkdir -p /opt/pmemd24

	echo ""
	echo "1. Install Amber MD 24"
	echo "======================"
	cd /src
	if [ -s /mnt/pmemd24.tar.bz2 ]
	then
		tar -jxf /mnt/pmemd24.tar.bz2
		cd /src/pmemd24_src/build
		cmake /src/pmemd24_src \
			-DCMAKE_INSTALL_PREFIX=/opt/pmemd24 \
			-DCOMPILER=GNU  \
			-DMPI=TRUE \
			-DCUDA=TRUE \
			-DINSTALL_TESTS=TRUE \
			-DDOWNLOAD_MINICONDA=FALSE \
			-DBUILD_PYTHON=TRUE \
			-DBUILD_PERL=TRUE \
			-DBUILD_GUI=TRUE \
			-DPMEMD_ONLY=TRUE \
			-DCHECK_UPDATES=FALSE
		make -j$MAKE_JOBS
		make install
	else
		echo "Amber MD 24 source file not found"
		exit 1
	fi

	echo ""
    echo "2. Install Amber MD 25"
    echo "======================"
    cd /src
    if [ -s /mnt/ambertools25.tar.bz2 ]
    then
        tar -jxf /mnt/ambertools25.tar.bz2
		cd /src/ambertools25_src
		cmake /src/ambertools25_src \
			-DCMAKE_INSTALL_PREFIX=/opt/ambertools25 \
			-DCOMPILER=GNU  \
			-DMPI=TRUE \
			-DCUDA=TRUE \
			-DINSTALL_TESTS=TRUE \
			-DDOWNLOAD_MINICONDA=TRUE
		make -j$MAKE_JOBS
		make install
	else
        echo "Amber MD 25 source file not found"
        exit 1
    fi

	# Remove all src packages
	echo ""
	echo "Cleaning up downloaded src tree"
	echo "=================================="
	cd
	rm -rf /src
	
	echo ""
	echo "All done"

%environment
	export PATH=/opt/bin:$PATH
	export LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH
	export CFLAGS="-O3 -march=native -pipe"
	export CXXFLAGS="$CFLAGS"
	export MANPATH=/opt/man

%runscript



Run Script:

#!/bin/bash

module load apptainer

IMAGE_NAME=/nobackup/shared/containers/ambermd.24.25.sif

container.run() {
    # Run a command inside the container...
    # automatically bind the /scratch and /nobackup dirs
    # pass through any additional parameters given on the command line
    apptainer exec --nv --bind /scratch:/scratch --bind /nobackup:/nobackup ${IMAGE_NAME} $@
}


Back to Software