Skip to content

SUMMA Makefile Part 0 configuration

Wouter Knoben edited this page Jul 30, 2020 · 11 revisions

To make it easier to compile SUMMA on your system, this page serves to document versions of Part 0 of the Makefile (the user-configurable part) for different compilers, systems, and libraries. Even if you don't find what you need here, it may point you in the right direction for configuring the Makefile for your system.

Recommended uses of the Makefile:

  • Copy it to Makefile.local, edit that file to your heart's content, then build SUMMA with make -f build/Makefile.local from the top-level SUMMA directory. Don't include Makefile.local in any pull requests.
  • Alternatively, just leave the Makefile alone, but write a small shell script (e.g. build_summa.sh) in which you specify the configurable variables and then run make, e.g. in bash:
#!/bin/bash
export F_MASTER=/Users/user/code/summa
export FC=gfortran
export FC_EXE=gfortran
export INCLUDES='-I/usr/local/Cellar/netcdf/4.6.3_1/include -I/usr/local/Cellar/lapack/3.8.0_2/include'
export LIBRARIES='-L/usr/local/Cellar/netcdf/4.6.3_1/lib -lnetcdff -L/usr/local/Cellar/lapack/3.8.0_2/lib -lblas -llapack'
make -f ${F_MASTER}/build/Makefile

For the following, please use the template when adding your own configuration. Include the name of the compiler and the machine/operating system that you are using as well as the date on which this configuration worked for you.

Template

Machine/operating system: 
Fortran compiler:
Comments: 
Date:

Entries in Part 0 of Makefile:
------------------------------
FC =
FC_EXE =
INCLUDES =
LIBRARIES =

Configurations

Cheyenne with ifort

Machine/operating system: Cheyenne (cheyenne.ucar.edu)
Fortran compiler: ifort
Comments: Before compiling, you need to load the right modules: 
`module load intel` and `module load mkl`. 
With `mkl` loaded you do not need to specify any of the lapack or blas libraries. 
Using the environment variables rather than absolute paths to specify the netCDF 
include files and libraries makes this more robust.
Date: 2019/08/28

Entries in Part 0 of Makefile:
------------------------------
FC = ifort
FC_EXE = ifort
INCLUDES = -I$(NCAR_INC_NETCDF)
LIBRARIES = -L$(NCAR_LDFLAGS_NETCDF) -lnetcdff

Cheyenne with gfortran

Machine/operating system: Cheyenne (cheyenne.ucar.edu)
Fortran compiler: gfortran
Comments: Before compiling, you need to load the right modules: 
`module load gnu` and `module load openblas`
Using the environment variables rather than absolute paths to specify the netCDF 
and openblas include files and libraries makes this more robust.
Date: 2019/08/28

Entries in Part 0 of Makefile:
------------------------------
FC = gfortran
FC_EXE = gfortran
INCLUDES = -I$(NCAR_INC_NETCDF) -I$(NCAR_INC_OPENBLAS)
LIBRARIES = -L$(NCAR_LDFLAGS_NETCDF) -lnetcdff -L$(NCAR_LDFLAGS_OPENBLAS) $(NCAR_LIBS_OPENBLAS)

MacOS Mojave with homebrew

Machine/operating system: MacOS Mojave (10.14.6) with homebrew (https://brew.sh/)
Fortran compiler: gfortran: gcc version 9.2.0 (Homebrew GCC 9.2.0) 
Comments: The following brew installed packages are used: gcc, netcdf, lapack
Date: 2019/08/28

Entries in Part 0 of Makefile:
------------------------------
FC = gfortran
FC_EXE = gfortran
INCLUDES = -I/usr/local/Cellar/netcdf/4.6.3_1/include -I/usr/local/Cellar/lapack/3.8.0_2/include
LIBRARIES = -L/usr/local/Cellar/netcdf/4.6.3_1/lib -lnetcdff -L/usr/local/Cellar/lapack/3.8.0_2/lib -lblas -llapack

Hydro-C1 (NCAR RAL) with gfortran

Machine/operating system: Hydro-C1 (hydro-c1.ucar.edu)
Fortran compiler: gfortran
Comments: Before compiling, `setenv LD_RUN_PATH '/opt/netcdf4-gnu/lib'`
so that the correct shared libs are found at run time. 
Date: 2019/08/28

Entries in Part 0 of Makefile:
------------------------------
FC = gfortran
FC_EXE = /usr/bin/gfortran
INCLUDES = -I/opt/netcdf4-gnu/include
LIBRARIES = -L/opt/netcdf4-gnu/lib -lnetcdff -L/usr/lib/lapack/ -llapack

Graham with ifort

Machine/operating system: Graham (graham.computecanada.ca)
Fortran compiler: ifort
Comments: Before compiling, load the most recent intel module. Check the available versions with: 
`module spider intel`. Then load the latest version: `module load intel/2019.3`. 
Lapack and blas libraries are loaded with library argument `-mkl`.
Date: 2020/07/30

Entries in Part 0 of Makefile:
------------------------------
FC = ifort
FC_EXE = /cvmfs/restricted.computecanada.ca/easybuild/software/2017/Core/ifort/2019.3.199/compilers_and_libraries_2019.3.199/linux/bin/intel64/ifort
INCLUDES = -I/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx/Compiler/intel2016.4/netcdf-fortran/4.4.4/include
LIBRARIES = -L/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx/Compiler/intel2016.4/netcdf-fortran/4.4.4/lib -lnetcdff -mkl