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:

Compile and install APBS (for details please see the APBS manual):

export APBS_PREFIX=/home/soft/iAPBS
mkdir -p $APBS_PREFIX
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 .
     

Build iAPBS interface library:

cd $APBS_PREFIX
tar xvzf iapbs-1.2.0.tgz
cd iapbs-1.2.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.

Build and install APBS and iAPBS libraries as described above.

Compile CHARMM with CHARMM/APBS module enabled

cd your_CHARMM_dir 
# patch your charmm installation
cd c35b2/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 $APBS_PREFIX/c35b2/
patch -p0 < $APBS_PREFIX/iapbs/modules/CHARMM/patches/c35b2/pbeq.patch 
patch -p0 < $APBS_PREFIX/iapbs/modules/CHARMM/patches/c35b2/install.patch 
patch -p0 < $APBS_PREFIX/iapbs/modules/CHARMM/patches/c35b2/Makefile_gnu.patch 
export APBS_LIB=$APBS_PREFIX/lib
cd $APBS_LIB
objcopy -N daxpy_ -N dcopy_ -N ddot_ -N dnrm2_ \
$APBS_PREFIX/apbs/contrib/blas/.libs/libapbsblas.a ./libapbsblasmod.a
export APBS_BLAS="-L${APBS_LIB} -lapbsblasmod"
cd $APBS_PREFIX/c35b2/
./install.com gnu medium APBS IFORT

# test it
cd $APBS_PREFIX/iapbs/modules/CHARMM/examples/
$APBS_PREFIX/c35b2/exec/gnu/charmm < apbs_elstat.inp
      

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