3.5. Building of CHARMM/APBS module

Currently, building of CHARMM/APBS module is supported on i386 and x64 Linux platforms only (gnu target in the CHARMM installation process). Both GNU and Intel compilers have been tested. The build process is a bit complex at this time, future releases will include more automated compilation.

First, make sure you have these packages and versions:

Since CHARMM/APBS requires full BLAS library the iAPBS library must be built with an external BLAS, like ATLAS. The following directions can guide you through the whole process.

  1. First, setup an environment for compilation and installation of all packages. $APBS_PREFIX environment variable should point to some empty or nonexistent directory where all required packages will be installed.

    export APBS_PREFIX=/home/soft/iAPBS
    mkdir -p $APBS_PREFIX
    cd $APBS_PREFIX
         

    The tarballs of APBS, iAPBS and ATLAS should be placed in $IAPBS_PREFIX.

    tar xzvf atlas3.6.0_Linux_P4SSE2.tar.gz
    export BLAS_LIB=${APBS_PREFIX}/Linux_P4SSE2/lib
    export APBS_BLAS="-L${BLAS_LIB} -llapack -lcblas -lf77blas -latlas"
         
  2. Compile and install APBS (for details please see the APBS manual):

    cd $APBS_PREFIX
    tar xvzf apbs-1.0.0.tar.gz
    cd ${APBS_PREFIX}/apbs-0.1.0
    export CC=icc
    export F77=ifort
    export F90=ifort
    export FC=ifort
    export CFLAGS="${CFLAGS} -DVAPBSQUIET"
    ./configure --prefix=${APBS_PREFIX}
    make && make install
    
    cd $APBS_PREFIX/include
    ln -s $APBS_PREFIX/apbs/contrib/include/maloc
    cd $APBS_PREFIX/lib
    cp $APBS_PREFIX/apbs/contrib/lib/libmaloc.a .
         
  3. Build iAPBS interface library:

    cd $APBS_PREFIX
    tar xvzf iapbs-1.0.0.tgz
    cd iapbs-1.0.0
    ./setup.sh
    ./configure --prefix=${APBS_PREFIX}
    make && make install
         

    After this last step the $APBS_PREFIX/lib directory should contain iapbs.a library which can be linked with CHARMM.

3.5.1. Compiling the CHARMM/APBS module

The following instructions assume your CHARMM version supports the CHARMM/APBS module (v.34b2 and later). If you are using version which does not you have to patch it first before following the steps below. Please download appropriate patch pack from the iAPBS site and follow included directions. Your CHARMM distribution must be patched before proceeding with the following steps.

  1. Build and install APBS, BLAS and iAPBS libraries as described above.

  2. Compile CHARMM with CHARMM/APBS module enabled

    # make sure the following variables are correctly set:
    # APBS_LIB, IAPBS_LIB and APBS_BLAS 
    cd your_CHARMM_dir 
    # patch your charmm installation
    cd c34b2/source/misc/
    rm apbs.src
    ln -s $APBS_PREFIX/iapbs/modules/CHARMM/apbs.f ./apbs.src
    cd ../fcm
    rm apbs.fcm
    ln -s $APBS_PREFIX/iapbs/modules/CHARMM/apbs_fcm.f ./apbs.fcm
    
    cd c34b2
    
    patch -p0 < $APBS_PREFIX/iapbs/modules/CHARMM/patches/c34b2/pbeq.patch
    patch -p0 < $APBS_PREFIX/iapbs/modules/CHARMM/patches/c34b2/Makefile_gnu.patch
    patch -p0 < $APBS_PREFIX/iapbs/modules/CHARMM/patches/c34b2/install.patch
    
    export APBS_LIB=$APBS_PREFIX/lib
    export BLAS_LIB=$APBS_PREFIX/atlas_ifort/lib 
    export APBS_BLAS="-L${BLAS_LIB} -llapack -lcblas -lf77blas -latlas"
    
    # make sure exec and lib directories are cleaned up 
    rm -rf exec/gnu lib/gnu build/gnu
    ./install.com gnu medium APBS IFORT
    
    # test it
    cd $APBS_PREFIX/iapbs/modules/CHARMM/examples/
    ~/foo/c34b2/exec/gnu/charmm < apbs_elstat.inp
    
          

After the last step your exec/gnu directory should contain charmm.exe executable which has APBS compiled in.