Compiling ADF from Sources

Compiling ADF from sources by end users is not supported on Windows. The following instructions apply to Linux/Unix and Mac OS X only. Compiling ADF2016 from sources is supported for ifort version 15.0.6 with MKL, and IntelMPI on linux.

Unpacking the distribution

Installing ADF with recompilation in mind is somewhat different from the binary-only installation. The downloaded source and binary tarballs must be unpacked in the following order (using Platform-MPI on x86_64-linux in this example):

# First sources
tar xzf adf2016.101.src.tgz
# Then binaries
tar xzf adf2016.101.pc64_linux.platform_mpi.bin.tgz

The result will be a adf2016.101 directory containing both binaries (for your platform) and sources.

Note that for Mac OS X, the downloading of the binaries is different. Follow the instructions for downloading and installation of the binaries. Copy the binaries from the downladed disk image to the directory adf2016.101 that was created from the source code. Depending oin where you have put the binaries it could be something like:

cp -r /Applications/ADF2016.101.app/Contents/MacOS/ADF.app/Contents/Resources/adfhome/* adf2016.101

Setting up environment

In addition to the standard environment variables discussed in the Section 2.3, you may need to set additional ones depending on your platform:

  • I_MPI_ROOT: this variable must be set if compiling with IntelMPI on linux (the default)
  • MPIDIR: may be needed in the case of compiling ADF with non-default MPI, for example openMPI on linux. The MPIDIR variable is not needed when configuring with Platform-MPI.
  • MATHDIR: this should be set to the the MKL root folder. If MKLROOT is defined and MATHDIR is not, then MKLROOT will be used.

Running Install/configure

After unpacking everything and setting up your environment properly, you need to run the configure script. This script is located in the $ADFHOME/Install directory, and it must be executed from the $ADFHOME directory. The script replaces some files in the bin directory with versions specifically targeted for your system. For example, if you want to install an OpenMPI version of ADF on a platform for which only a Platform-MPI version is available, then Install/configure will make an $ADFBIN/start script suitable for OpenMPI and overwrite the old one which was made for Platform-MPI. Further, configure creates the buildinfo file that you will need to compile ADF.

To see what options the configure script supports, use configure -h:

Example:

cd $ADFHOME
Install/configure -h

Configure can set up multiple build targets with different configuration options using the -b flag, but by default it only creates two targets: release and debug. The easiest way to configure is to use all default options (ifort/MKL/OpenMPI on OSX, ifort/MKL/IntelMPI on linux):

cd $ADFHOME
Install/configure

If a different MPI version is needed (for example platform_mpi), simply run:

cd $ADFHOME
Install/configure -p platform_mpi

Compiling ADF

Next, you need to compile the sources by executing foray located in $ADFBIN. Foray supports parallel compilation to make things faster, use -j N to tell foray you want it to use N processes (for example: -j 4 on a quadcore machine):

cd $ADFHOME
bin/foray -j 4

After a while, depending on the speed of your computer, everything should be ready to use, just as if you had installed the precompiled executables but now with your modifications included. Use bin/foray -h to get a list of all foray options.