Installing Amber Development

As a note, this tutorial is written for bash. The only places where it really doesn't apply to csh and its derivatives are in the setting of environment variables. In this case, use setenv instead of export (and omit the = sign). Also, this does not tell you how to go about getting access to the git repository or anything. Just how to install it once you have it.

If you have not set your computer up yet, and you have one of the following systems, make sure you set up your computer so you have the necessary prerequisites before trying to build Amber from the git checkout.

Before you start building Amber 12 and AmberTools 12, make sure that you've set your computer up properly, including the necessary prerequisite packages. In particular, make sure you have

  • A working Fortran compiler (gfortran, ifort, or pgf90)
  • A working C compiler (gcc, icc, or pgcc)
  • A working C++ compiler (g++, icpc, or pgCC)
  • flex
  • X11 development files (for xleap)
  • Python (for and other various utilities)
  • Tkinter (for GUI to work)
  • patch (to apply bugfixes)
  • csh (C-shell, or some variant, like tcsh, that provides a csh executable in /bin)
  • GZ-compression libraries (for MTK++ and cpptraj to handle gzip-compressed files)
  • BZ2-compression libraries (for cpptraj to handle bzip2-compressed files)

Most of the above pre-requisites are checked for during the configure stage, so if you don't know whether you have it or not, it's not a very big deal.

For those of you that have been used to Amber 11 and AmberTools 1.5 or earlier, the building process for now should be considerably easier.

Updating with Bug Fixes and Patches

There are no bug fixes or patches for the developer version — the fixes are pushed to git and you pull them :)

Basic serial install

Installing is very easy now. This also assumes you have your amber git repository directory set to AMBERHOME:

./configure gnu
make install

For advanced users:

Also, you can use parallel make to get the installation to finish faster by using make -j. If you don't know what I'm talking about, just ignore it. For those that do, this now works, though it didn't for Amber 11 and AmberTools 1.5.

You can specify the python distribution to use via the --with-python /path/to/python command-line flag (there must be a space between them).

You can specify the NetCDF distribution to use via the @@—with-netcdf /path/to/netcdf/prefix command-line flag (there must be a space between them). Also, the NetCDF module file must be made with a compatible compiler. If it's not, the configure step will fail. This is due to the use of the netcdf.mod file which is compiler dependent.

Building in parallel

Building in parallel requires a working MPI installation. AmberTools includes a configure_openmpi and a configure_mpich2 script to help with this, although it may be better to just let your package manager deal with it (or build your own if you know what you're doing). Remember that Amber needs the Fortran MPI libraries and routines.

Common sources of error: Make sure that your MPI installation uses the same compilers that you used to build the serial versions. You can use the commands mpif90 -show and mpicc -show to see which compilers are being used. Later, you'll need to make sure that the mpirun or mpiexec you are using to run MPI versions of Amber programs are from the same package as the MPI compilers you're about to use now.

The sequence of commands below assumes that you have already set AMBERHOME properly.

./configure -mpi gnu
make install

Building CUDA-enabled Amber (pmemd.cuda)

I have never tried building pmemd.cuda or pmemd.cuda.MPI on Windows, so there will be nothing about that here. I think it is possible.

I have, however, tried building it on Mac OS X some time ago. I couldn't do it (the code has changed a lot since then, so it might be possible now). However, Apple doesn't use NVIDIA hardware much, and this will not run on ATI hardware. Thus, if you are one of those few people that have a Mac with qualifying hardware, I'm sorry.

As a result of the above eliminations, this section deals with the Linux operating system only. And likewise, since this only deals with pmemd.cuda.

pmemd has been highly optimized to run very efficiently on NVIDIA hardware that supports the CUDA programming language (and has hardware double-precision support). For a run-down on this capability, see

If you need to install the NVIDIA developer driver, see the section dedicated to it below.

./configure -cuda gnu
make install

Building CUDA-enabled Amber in parallel

This will allow you to run pmemd.cuda.MPI to utilize multiple GPUs for a single calculation.
Then, configure for CUDA and MPI

./configure -cuda -mpi gnu
make install

You should now have pmemd.cuda.MPI in $AMBERHOME/bin.

Tips for Installing NVIDIA Developer Driver and CUDA Toolkit

Before installing pmemd.cuda, you need to install both the CUDA Toolkit and the CUDA developer driver for your hardware. They can be found on NVIDIA's website ( Make sure you download and install the driver, too.

You may have to stop the X-server to install it. A quick tip to do this: press ALT-CTRL-1 to go to tty1 (this will close out the GUI, which resides on tty7). Log in, and obtain root privileges, then kill your X session. Then run the installer scripts given to you by NVIDIA.

bash$ sudo /etc/init.d/gdm stop

The above should work for Ubuntu (or anything running GNOME, really, since gdm is the Gnome Desktop Manager). If you have Kubuntu (or something running KDE), you may need to use kdm instead of gdm. If you have an /etc/init.d/xdm script, you can try using that instead of gdm instead.

After this is done, you can re-open gdm/kdm/xdm if you want, or just reboot.

bash$ sudo /etc/init.d/gdm start

Adding Amber to your Environment

This step assumes that you have already compiled every part of AmberTools and Amber that you want to use. Many programs in AmberTools require that the AMBERHOME environment variable be set, which you can do in your shell resource file (e.g. .cshrc or .bashrc).

To do this in bash, put the following in your ~/.bashrc file:

export AMBERHOME=/path/to/amber

To do this in csh, put the following in your ~/.cshrc file:

setenv AMBERHOME "/path/to/amber"

Furthermore, if you want to load the Amber and AmberTools programs into your current path (so that you can run pmemd by the command pmemd rather than $AMBERHOME/bin/pmemd), then add the following commands to your:

~/.bashrc (for bash, sh, etc.):


~/.cshrc (for csh, tcsh, etc.):

setenv PATH "$PATH:$AMBERHOME/bin"

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License