If you were unable to find the binary pacakge for your system, or would like to compile APBS yourself, you'll need to read the instructions in this section.
Binary executables for APBS are available from the APBS dowloads site ( http://agave.wustl.edu/apbs/download). We currently only have binary versions for RedHat Linux but are in the processor of developing binaries for several other popular platforms. In the meantime, please install APBS from source, as described below.
In order to install APBS from the source code, you will need:
C and Fortran compilers
The APBS source code (see above)
The MALOC hardware abstraction library (available from http://www.scicomp.ucsd.edu/~mholst/codes/maloc/index.html)
It may also be useful to have:
A version of MPI (try MPICH) for parallel jobs.
A compatible visualization program (see the "Visualization" section of this document)
In what follows, I'll be assuming you're using bash, a fantastic shell available on many platforms (UNIX and non-UNIX).
First, please look at the "Machine-specific notes" section of this document for appropriate compiler flags, etc. to be set via pre-configuration environmental variables. It's not a big deal if you skip this step, but APBS will run more slowly.
There are two directories you'll need to identify prior to installation. The first, which we'll call FETK_SRC, will contain the APBS and MALOC source code. This directory can be deleted after installation, if you wish. The second directory will be the permanent location for APBS and MALOC; we'll call this FETK_PREFIX. If you have root permission, you could pick a global directory such as /usr/local for this; otherwise, pick a directory for which you have write permission. The following commands set up the directories and environmental which point to them:
$ export FETK_SRC=/home/soft/src $ export FETK_PREFIX=/home/soft $ export FETK_INCLUDE=${FETK_PREFIX}/include $ export FETK_LIBRARY=${FETK_PREFIX}/lib $ mkdir -p ${FETK_SRC} ${FETK_INCLUDE} ${FETK_LIBRARY}
$ export FETK_MPI_INCLUDE=/usr/share/mpi/include $ export FETK_MPI_LIBRARY=/usr/share/mpi/lib
You're now ready to unpack the source code:
$ cd ${FETK_SRC} $ gzip -dc maloc.tar.gz | tar xvf - $ gzip -dc apbs-0.3.0.tar.gz | tar xvf -
Now we need to compile the hardware-abstraction library, MALOC. First, go to the MALOC directory:
$ cd ${FETK_SRC}/maloc
WARNING: If you are not starting from a freshly-untarred version of MALOC, you need to clean up the previous distribution by:
$ make distclean
and ignoring any error messages that may result.
MALOC is configured for installation with the autoconf script configure. Configure options can be listed with the --help option. However, MALOC is usually configured in one of two ways for use with APBS:
Sequential execution only (no MPI):
$ ./configure --prefix=${FETK_PREFIX}
With parallel execution (MPI):
$ ./configure --prefix=${FETK_PREFIX} --enable-mpi
Be sure to keep an eye out for warning messages during the configuration of MALOC, especially if you are using MPI.
At this point, you are ready to make and install MALOC:
$ make; make install
If all went well (you'll see an error message if either the compilation or installation failed), then you're ready to install APBS...
APBS is configured and installed much the same way as MALOC. First, you need to configure with the autoconf configure script. As before, you can examine the various configure options with the --help option. For most platforms, no options need to be specified; APBS's autoconf setup automatically detects whether MALOC was compiled with MPI and configures itself appropriately. Therefore, most users can configure as follows:
$ cd ${FETK_SRC}/apbs $ ./configure --prefix=${FETK_PREFIX}
There's no need to pay too much attention to the autoconf messages here. If the APBS configuration script can't find something it needs, it will simply fail to configure and exit with a hopefully-informative error message.
If you have a vendor-supplied BLAS math library, you will probably compile a faster version of APBS if you link to it instead of the BLAS version provided with MALOC. This is done by passing the appropriate linking options to configure with the --with-blas flag. For example, suppose you had a machine-specific version of the BLAS library at /usr/local/lib/libblas.a. You would then configure APBS by:
$ cd ${FETK_SRC}/apbs $ ./configure --prefix=${FETK_PREFIX} --with-blas="-L/usr/local/lib -lblas"
Assuming all has gone well with the configuration, you're ready to compile and install APBS:
$ make all $ make install
This will place a version of the APBS binary at ${FETK_PREFIX}/bin/${host_cpu}-${host_vendor}-${host_os}/apbs, where ${host_cpu}-${host_vendor}-${host_os} is a machine-specific string. This extra layer of obfuscation lets you keep several APBS binaries around in the same directory. At this point you are ready to use APBS; either by calling the binary directly or adding the above directory to your path. There are also several tools provided with APBS that remain in the APBS directory; these are described in later portions of this manual. You may wish to copy these to a global location (or the same place as your APBS binary) at this time.
While the APBS and MALOC autoconf configure scripts are flexible enough to work on most platforms, the resulting executables don't always offer optimal performance. We're slowly trying to provide binary support for some of the more popular platforms, this section is meant to supplement our pre-compiled binaries and provide some tips on how to get a better APBS binary on your platform. If you have tips or trickes on improving APBS performance on your machine, please let us know!
In what follows, we're denoting Pentium/Xeon 32-bit Intel machines as "IA32" and Itanium* 64-bit Intel machines as "IA64".
The only compilation I've done of APBS on Windows has been via Cygwin. Therefore, I had to use the GNU compilers and the performance was pretty mediocre. Furthermore, the resulting binary requires various Cygwin DLLs. We're actively working to provide better (native) binary support under Windows.
Compilation under Linux should be very straightforward as this is the platform on which APBA was developed. This section describes various compilation options under Linux.
Nearly every Linux distribution comes with the GNU compilers; autoconf with configure with these by default. Furthermore, autoconf will automatically choose reasonable optimization (-O2) and debugging (-g) options. I haven't had very good luck improving the performance beyond what's available with -O2 and, given the availablity of the free Intel compilers, I'm not sure it's worth trying too hard.
We've mainly used the free (for Linux) Intel compilers and have observed very good performance. There were some incompatibility issues with version 7 of the Intel compilers and newer versions of Linux (particularly those running glibc 2.3, e.g. RedHat 8 and 9).
First, you need to make sure the Intel compilers are set up properly; this usually is done by sourcing one of the input bash or csh scripts provided with the compilers.
You then need to define the environmental variables appropriate to these compilers before you configure either MALOC or APBS. This is done by:
$ export CC='icc' $ export CXX='icc' $ export F77='ifort'
If you want to use the compiled code on machines where the Intel compilers are not installed, you also need to set some linker options:
$ export LDFLAGS='-static-libcxa'
Finally, you'll want to choose some optimization options. Intel has a number of options that are specific to the type of processor you are running; the examples below assume you are running on a Pentium 4:
$ export FFLAGS='-fast -arch pn4' $ export CFLAGS='-fast -tpp5' $ export CXXFLAGS=${CFLAGS}
There are a number of other good compilers (Portland Group, Absoft) that we have not tested with APBS. If you have experience with these, please let us know.
We are in the process of acquiring a Mac G5 to test the best compilation options, etc. In the meantime, please visit the apbs-users mailing list which has a number of threads which discuss installation on Mac OS platforms.
It has become apparent from the mailing lists that some "packages" of the GNU development software available for MacOS contain different versions of the C and FORTRAN compilers. This is very bad; APBS will not compile with different versions of the C and FORTRAN compilers.
These are various compilation options I experimented with on the NPACI Blue Horizon platform -- we're working on acquiring a Power4 machine for additional notes. However, I expect some of the issues are applicable to other AIX machines. In what follows, I used the mpcc and mpxlf compilers.
In order to use a reasonable amount of memory during runs, you also need to specify -bmaxdata:0x80000000 and -bmaxstack:0x10000000, or whatever values are appropriate to your system. You'll also want to link to the IBM blas, mass, and essl libraries (if available) and optimize as much as possible for the specific machine you're running on. Putting it all together gives:
$ export CC=mpcc $ export CXX=mpcc $ export F77=mpxlf $ export BLASPATH=/usr/lib $ export CFLAGS="-bmaxdata:0x80000000 -bmaxstack:0x10000000 -L/usr/local/apps/mass -lmass -lessl -O3 -qstrict -qarch=pwr3 -qtune=pwr3 -qmaxmem=-1 -qcache=auto" $ export FFLAGS="-qfixed=132 -bmaxdata:0x80000000 -bmaxstack:0x10000000 -L/usr/local/apps/mass -lmass -lessl -O3 -qstrict -qarch=pwr3 -qtune=pwr3 -qmaxmem=-1 -qcache=auto"
Compilation tips for this system are short and sweet: Whatever you do, don't use the GNU compilers; they result in very slow binaries.