ORB5  v4.9.4
Makefiles

Makefiles' operating principle and how to add a new one.

Author
N. Ohana
Date
11.2017

Makefiles' operating principle

The philosophy is to use a main Makefile containing all commmon variables, rules and dependencies, and including a platform/user-specific Makefile containing the rest.

The libraries are built using the same flags as the rest of the code, i.e. sending $(FC), $(FFLAGS), ... to the Makefile_ORB5 files in the library folders.

How to add a new Makefile

  1. Edit Makefile.inc to set $(SITE) variable to your specific platform from hostname and dnsdomainname variables.
  2. Add a new file tools/make_configs/$(SITE).inc in which you set the following variables:

    • $(FUTILS_HOME): futils install location
    • $(SPCLIBS_HOME): SPClibs install location
    • $(CC): C compiler
    • $(CFLAGS): C compiler flags
    • $(FC): Fortran compiler
    • $(FFLAGS_OPTIM): Fortran compiler optimized flags (used if DEBUG==TRUE)
    • $(FFLAGS_DEBUG): Fortran compiler debug flags (used if DEBUG/=TRUE)
    • $(FFLAGS_OMP): Fortran compiler OpenMP flags (used if OPENMP==TRUE)
    • $(F90INCLUDES): ORB5's include locations
    • $(SFC): serial Fortran compiler (used for compiling SPClibs)
    • $(PREPROC_FLAG): preprocessor flag (used for compiling SPClibs)
    • $(LD): linker
    • $(LDFLAGS): linker flags
    • $(LDFLAGS_OMP): linker OpenMP flags (used if OPENMP==TRUE)

    and optionally the following ones:

    • $(HDF5_HOME): HDF5 install location (if hdf5 module is not enough)
    • $(BASEDIR): to set a non-standard root directory location
    • $(SRCDIR): to set a non-standard source directory location
    • $(OBJDIR): to set a non-standard object directory location
    • $(BINDIR): to set a non-standard binary directory location
    • $(SLIBS) / $(LIBS): to add libraries to the linking stage
Note
If you want to use Cray compiler, you need to add -D_CRAY to $(FFLAGS_OPTIM) and $(FFLAGS_DEBUG) as a work-around to preprocessor concatenation macro used in src/deposition.inc and src/get_field.inc.
See also
Get started