Saturday, April 23, 2011

Building AmberTools 1.5 on a 10.5.x or 10.6.x with gcc/gfortran 4.3

I'll be using BASH environment in my examples here. Although I am a die-hard TCSH fan, I also speak BASH. I envision this document is for first time users who are somehow macports savvy. To learn more about macports, see http://guide.macports.org/ .

10.5.x / 10.6.x

Macports gcc45 is a set of stable compilers that you should be trying first. You are also advised to unset MKL_HOME since MKL gives some bad results for certain tests.

Supposed that you downloaded the source code of AmberTools 1.5 with your web-browser, the normal place of the source code archive file was saved is probably your own Downloads folder. ( ~/Downloads )

Now uncompress the archive and put it into the /opt directory. The reason that I chose this path is that I can always remove the whole contents of /opt folder without interfering your daily operations with your Macintosh.

 $ tar jxvf ~/Download/AmberTools-1.5.tar.bz2 -C /opt

Set up the environment variable, if these variables have already been set in your ~/.bashrc file, please just verify the values of variable and modify accordingly, and then open a new terminal session.

        $ export AMBERHOME=/opt/amber11
        $ export PATH="$AMBERHOME/bin:$PATH"
        $ export MPI_HOME=$AMBERHOME
        $ unset MKL_HOME
        (note: "unset" doesn't work on CSH, please use "unsetenv" instead)
        $ echo 'export AMBERHOME=/opt/amber11' >> ~/.bashrc
        $ echo 'export PATH="$AMBERHOME/bin:$PATH"' >> ~/.bashrc
        $ echo 'export MPI_HOME=$AMBERHOME' >> ~/.bashrc
        $ cd /opt/amber11/AmberTools/src

Configure for building serial amber

        $ ./configure -macAccelerate gnu

Build the serial AT15

        $ make

Test the serial build

        $ cd ../test

Clean the file after the serial build is finished.

        $ cd ../src
        $ make clean

Download the openmpi source code from open-mpi.org

        $ cd ~/Downloads
        $ curl -O http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.3.tar.bz2

Uncompress this source archive

        $ cd /opt/amber11/AmberTools/src
        $ tar jxvf ~/Downloads/openmpi-1.4.3.tar.bz2

Build amber's own openmpi

        $ ./configure_openmpi
( If you use TCSH/CSH as your login shell, you'd need to run "rehash" command before continue following procedures. )

Configure parallel ambertools

        $ ./configure -mpi -macAccelerate gnu

Build some parallel components of ambertools

        $ make

Test parallel set

        $ cd ../test
        $ export DO_PARALLEL='mpirun -np 2'
        $ ./test_at_parallel.sh