-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.macro
More file actions
34 lines (31 loc) · 1.19 KB
/
make.macro
File metadata and controls
34 lines (31 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Set this somewhere.
# module add netCDF-HDF5/4.9.2-1.12.2-hpc1
# module add buildenv-intel/2023a-eb
# e.g., $NETCDF_DIR = /software/sse2/freja_el9/manual/netcdf-hdf5/4.9.2-1.12.2/hpc1-intel-2023a-eb
#
# Use debug by e.g., make clara DEBUG=w
NETCDF_INC = -I$(NETCDF_DIR)/include
NETCDF_LIB = -L$(NETCDF_DIR)/lib -lnetcdf -lnetcdff
ifeq ($(ARCH),gfortran)
MOD=-Jmod/
OMPFLAG = -fopenmp
ifeq ($(DEBUG),)
OPTIONS=-O3 # -march=native -ffast-math -funroll-loops -ftree-vectorize
else ifeq ($(DEBUG),w) # with warnings
OPTIONS= -O0 -g -Wall -Wsurprising -ffpe-trap='invalid','zero','overflow' -fcheck='all' -fmax-errors=10 -check uninit -init=snan -check bounds
else ifeq ($(DEBUG),no) #no optimisation
OPTIONS=-O0 -g
endif
else
ARCH=ifort
MOD=-module mod/
OMPFLAG = -qopenmp
ifeq ($(DEBUG),)
OPTIONS=-O3 # -xHost -ipo -qopenmp-simd -qopt-report=5
else ifeq ($(DEBUG),w) # with warnings
OPTIONS= -O0 -g -traceback -C -check all -fpe0 -warn -warn interface -debug full -debug inline_debug_info -stand f18
else ifeq ($(DEBUG),no) #no optimisation
OPTIONS=-O0 -g
endif
endif
COMPILE = $(ARCH) $(OPTIONS) $(MOD)