Installing Amber11 And Ambertools 1.5

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)

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 11 and AmberTools 1.5

Before you start building Amber11 and AmberTools 1.5, 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 MMPBSA.py and other various utilities)
  • 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.

Updating with Bug Fixes and Patches

Because Amber and AmberTools are very large projects (together, the two of them have over 3 million lines of code) that have a wide range of functionality that is constantly evolving, I can guarantee that there will be bugs in it. As they are found and fixed, developers upload bug fixes to http://ambermd.org/bugfixes.html. Check this site for bug fixes that you haven't yet applied.

Fixing AmberTools 1.5

To patch AmberTools 1.5, download the bugfix.all file from here: http://ambermd.org/bugfixes/AmberTools/1.5/bugfix.all and apply it using patch from $AMBERHOME like this:

cd $AMBERHOME
wget http://ambermd.org/bugfixes/AmberTools/1.5/bugfix.all
patch -p0 -N < bugfix.all

Note some operating systems, like Mac OS X, don't come with wget. You can use curl or just download the file instead. Just make sure that you specify the location of bugfix.all if it's not in your current directory (which has to be AMBERHOME for this step!)

Fixing Amber 11

If you have any problems with the following instructions, your best bet is to start with a completely fresh copy of Amber 11 and AmberTools 1.5 (from the tarballs), and follow these instructions:

cd $AMBERHOME
cd ../
wget http://ambermd.org/bugfixes/11.0/apply_bugfix.x
wget http://ambermd.org/bugfixes/11.0/bugfix.all.tar.bz2
chmod +x apply_bugfix.x
./apply_bugfix.x ./bugfix.all.tar.bz2

Basic AmberTools 1.5 + Amber 11 install (Serial)

NOTE: You can just install AmberTools if you want to. If this is the case, then you can ignore the bullet points marked as (Amber 11 only). Make sure you have an up-to-date installation of Amber 11 (see the section above for applying all of the updates).

Go to $AMBERHOME/AmberTools/src and configure and build the installation

  • cd $AMBERHOME/AmberTools/src
  • ./configure [Options] gnu
    • In the above command, there may be options you want to use. If you are using Mac OS X, you can use -macAccelerate. If you're installing with Windows, you need the -cygwin flag. If you're using Mac OS X 10.7 (Lion), you'll also need the -nopython flag.
    • Also in the above command, you can replace gnu with intel or pgi if you have either the Intel compiler suite or PGI compiler suite available. These commercial compilers tend to produce faster executables for the Fortran code, especially for pmemd

Here is where you should get any errors regarding missing dependencies, like the X11 libraries, Fortran compiler, etc. Also, you should see the message

Running $AMBERHOME/AT15_Amber11.py to patch config.h for building Amber 11.
Check Amber11_Conversion.log for details of what was done. Running this script
a second time has no effect (positive or negative)

at the bottom.

Now, build AmberTools 1.5 and Amber 11:

  • make install
  • cd $AMBERHOME/src && make install * (Amber11 only)

You should be done, however, if you see the following error (or something similar):

ifort: error #10236: File not found:  '/opt/intel/composerxe/mkl/lib/em64t/libmkl_intel_lp64.a'
ifort: error #10236: File not found:  '/opt/intel/composerxe/mkl/lib/em64t/libmkl_sequential.a'
ifort: error #10236: File not found:  '/opt/intel/composerxe/mkl/lib/em64t/libmkl_core.a'
make[1]: *** [pbsa] Error 1

This is caused by Intel changing their directory structure around for their Math Kernel Library between releases. The directory em64t no longer exists, and must be replaced with intel64 in the config.h file. If you just do a global replacement of em64t with intel64, this should fix your issue. You can avoid this altogether by getting rid of the MKL_HOME environment variable and just not compiling with Intel MKL support.

Building AmberTools and Amber11 in parallel

Building in parallel requires a working MPI installation. AmberTools includes a configure_openmpi and 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).

Also be sure that you've completed the serial installation as described above.

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.

First, make sure that AmberTools and Amber are properly "cleaned", since you don't want to re-use any files from the previous, serial build.

  • cd $AMBERHOME/AmberTools/src && make clean
  • cd $AMBERHOME/src && make clean (Amber 11 only)

Next, configure in parallel and build parallel AmberTools and Amber11. You need the -mpi configure flag to trigger a parallel build, and can include any other option you had before (like you need -cygwin for Windows installs, still, and can still make use of -macAccelerate). The -nopython flag is implied by -mpi, so you don't need this anymore.

  • cd $AMBERHOME/AmberTools/src
  • ./configure [Options] -mpi gnu
    • Like the serial build, you can use the options mentioned above for your platform, or change gnu to intel or pgi
  • make parallel (This is needed for parallel MMPBSA.py)
  • cd $AMBERHOME/src && make parallel (Amber 11 only)

Amber 11 and AmberTools 1.5 should now be built in parallel. Note that these are advanced options, and you should be comfortable with the serial versions of these programs before trying to tackle the parallel versions.

Building CUDA-enabled Amber11 (pmemd.cuda) * (Amber 11 only)

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 http://ambermd.org/gpus/).

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

First, clean any previous installations you may have done. Make sure you've at least done all of the bug fix steps in the serial build first! (It'd be easier to just say that serial building is a prerequisite, even though it is not, technically).

  • cd $AMBERHOME/AmberTools/src && make clean
  • cd $AMBERHOME/src && make clean

Now configure for CUDA

  • cd $AMBERHOME/AmberTools/src
  • ./configure -cuda gnu
    • You can use the intel compilers here as well, and conceivably the pgi compilers too, though I've never tried them.

Now build pmemd.cuda

  • cd $AMBERHOME/src && make cuda

That was easy enough…

Building CUDA-enabled Amber in parallel

This will allow you to run pmemd.cuda.MPI to utilize multiple GPUs for a single calculation. To do this, make sure you've already compiled the serial version and have that working.

Then, configure for CUDA and MPI

  • cd $AMBERHOME/AmberTools/src
  • ./configure -cuda -mpi gnu
    • As before, you can swap the GNU compilers out for the intel or pgi compilers as well, and add any other relevant command-line flags you may have.
  • cd $AMBERHOME/src && make clean
  • make cuda_parallel

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 (http://developer.nvidia.com/cuda-downloads). 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/amber11

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

setenv AMBERHOME "/path/to/amber11"

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.):

export PATH=$PATH\:$AMBERHOME/bin

~/.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