Compiling on a Unix/Linux cluster

To compile the code on a Unix based system, you may need to  modify the Makefile in /Source. See the CLUSTER section near the top of this file. You can add your own CLUSTER argument to the Makefile or can probably get by with one of the existing entries, depending on the configuration of your system. If you look at the Makefile and have no idea about what to do, I recommend you find someone that can offer assistance since its easy to mess things up.

Here are a few tips for modifying the Makefile:

  • MARE2DEM needs to link to the Intel Math Kernel Library.  The process for doing this depends on the specific version of the Intel compilers and your operating system. To find the correct Makefile settings for your system see the Intel MKL Library Link Line Advisor at
  • Do not turn on the auto-multithreading compiler flags. MARE2DEM selectively uses some multi- threaded functions from the Intel Math Kernel Library and is already highly parallelized, so turning on auto-multithreading will create a whole heap of competing processes that will actually slow the code down.

Once you have the makefile configured, log on to your server and cd to the directory /Source. Then type “make CLUSTER=<yourclustername>” to compile all the libraries and routines needed for MARE2DEM. It should take a several minutes to compile everything.

Here are the Makefile variables I currently use for the Triton Shared Compute Cluster at the San Diego Supercomputer Center (these can be used with "make CLUSTER=tscc"):
FC = mpif90
FFLAGS = -O2 -fpp -m64
CC = mpicc
ARCH = xiar
RANLIB = ranlib
BLASLIB = -L$(MKLPATH) -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread

Two things to note in the above settings. First is the ARCH variable that uses xiar instead of the usual ar, and the MKLPATH and the BLASLIB variables. These are specific for the TSCC cluster and may need to be modified on your own Linux cluster.


2 thoughts on “Compiling on a Unix/Linux cluster

Leave a Reply