2008-11-04 13:08:01 -06:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
2018-08-31 11:05:16 -03:00
|
|
|
# Compilation flags depend on variable COMPILER set in make.default or
|
|
|
|
# make.config. This variable indicates which compiler family should be used.
|
|
|
|
# Currently, we support GNU, PGI and INTEL compilers. If you need support
|
|
|
|
# for a different compiler, please add corresponding section below.
|
2008-11-04 13:08:01 -06:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
2018-08-31 11:05:16 -03:00
|
|
|
# GNU Fortran compiler
|
2008-12-08 13:59:57 -06:00
|
|
|
#
|
2018-08-31 11:05:16 -03:00
|
|
|
ifeq ($(COMPILER), GNU)
|
|
|
|
|
2008-11-04 13:08:01 -06:00
|
|
|
# compiler and linker setup
|
|
|
|
#
|
|
|
|
ifeq ($(MPI),Y)
|
2018-08-31 11:05:16 -03:00
|
|
|
FC = mpifort
|
2008-11-04 13:08:01 -06:00
|
|
|
else
|
2014-08-04 09:26:36 -03:00
|
|
|
FC = gfortran
|
2008-11-04 13:08:01 -06:00
|
|
|
endif
|
2014-08-04 09:26:36 -03:00
|
|
|
LD = $(FC)
|
|
|
|
|
2018-08-31 11:05:16 -03:00
|
|
|
# compiler and linker flags
|
2014-08-04 09:26:36 -03:00
|
|
|
#
|
2018-08-31 11:05:16 -03:00
|
|
|
ifeq ($(DEBUG),Y)
|
|
|
|
FFLAGS = -Og -g -DDEBUG
|
|
|
|
else
|
|
|
|
FFLAGS = -O2 -march=native -pipe
|
|
|
|
endif
|
|
|
|
ifeq ($(PROFILE),Y)
|
|
|
|
FFLAGS += -pg
|
|
|
|
endif
|
|
|
|
LDFLAGS = $(FFLAGS)
|
|
|
|
ifeq ($(STATIC),Y)
|
|
|
|
LDFLAGS += -static
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# PGI Fortran compiler
|
|
|
|
#
|
|
|
|
ifeq ($(COMPILER), PGI)
|
|
|
|
|
|
|
|
# compiler and linker setup
|
|
|
|
#
|
|
|
|
ifeq ($(MPI),Y)
|
|
|
|
FC = mpifort
|
|
|
|
else
|
|
|
|
FC = pgfortran
|
|
|
|
endif
|
|
|
|
LD = $(FC)
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
# compiler and linker flags
|
|
|
|
#
|
2008-12-08 13:59:57 -06:00
|
|
|
ifeq ($(DEBUG),Y)
|
2018-08-31 11:05:16 -03:00
|
|
|
FFLAGS = -O -g -DDEBUG
|
2008-12-08 13:59:57 -06:00
|
|
|
else
|
2018-08-31 11:05:16 -03:00
|
|
|
FFLAGS = -fast
|
|
|
|
endif
|
|
|
|
ifeq ($(PROFILE),Y)
|
|
|
|
FFLAGS += -Mprof=dwarf
|
2008-12-08 13:59:57 -06:00
|
|
|
endif
|
2014-08-04 09:26:36 -03:00
|
|
|
LDFLAGS = $(FFLAGS)
|
2018-08-31 11:05:16 -03:00
|
|
|
ifeq ($(STATIC),Y)
|
|
|
|
LDFLAGS += -Bstatic
|
|
|
|
endif
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2018-08-31 11:05:16 -03:00
|
|
|
endif
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2008-12-08 13:59:57 -06:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
2018-08-31 11:05:16 -03:00
|
|
|
# INTEL Fortran compiler
|
|
|
|
#
|
|
|
|
ifeq ($(COMPILER), INTEL)
|
|
|
|
|
|
|
|
# compiler and linker setup
|
|
|
|
#
|
|
|
|
ifeq ($(MPI),Y)
|
|
|
|
FC = mpifort
|
|
|
|
else
|
|
|
|
FC = ifort
|
|
|
|
endif
|
|
|
|
LD = $(FC)
|
|
|
|
|
|
|
|
# compiler and linker flags
|
|
|
|
#
|
|
|
|
ifeq ($(DEBUG),Y)
|
|
|
|
FFLAGS = -O -g -DDEBUG
|
|
|
|
else
|
|
|
|
FFLAGS = -O2 -xHost
|
|
|
|
endif
|
|
|
|
ifeq ($(PROFILE),Y)
|
|
|
|
FFLAGS += -p
|
|
|
|
endif
|
|
|
|
LDFLAGS = $(FFLAGS)
|
2008-12-08 13:59:57 -06:00
|
|
|
ifeq ($(STATIC),Y)
|
2018-08-31 11:05:16 -03:00
|
|
|
LDFLAGS += -static
|
2008-12-08 15:31:35 -06:00
|
|
|
endif
|
|
|
|
|
2018-08-31 11:05:16 -03:00
|
|
|
endif
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Additional common directives set in make.config
|
|
|
|
#
|
|
|
|
|
2011-04-29 15:01:06 -03:00
|
|
|
ifeq ($(SIGNALS),Y)
|
2018-08-31 11:05:16 -03:00
|
|
|
FFLAGS += -DSIGNALS
|
2011-04-29 15:01:06 -03:00
|
|
|
endif
|
|
|
|
|
2008-12-08 13:59:57 -06:00
|
|
|
ifeq ($(MPI),Y)
|
2018-08-31 11:05:16 -03:00
|
|
|
FFLAGS += -DMPI
|
2008-12-08 13:59:57 -06:00
|
|
|
endif
|
2008-12-08 15:31:35 -06:00
|
|
|
|
2018-08-31 11:05:16 -03:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# libraries and their dependencies
|
|
|
|
#
|
|
|
|
LIBS =
|
|
|
|
|
|
|
|
# if your HDF5 libraries not are installed in the standard location /usr,
|
|
|
|
# you can set this path using the HDF5DIR variable here
|
|
|
|
#
|
|
|
|
#HDF5DIR=/home/user/hdf5
|
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
ifeq ($(OUTPUT),HDF5)
|
2018-08-31 11:05:16 -03:00
|
|
|
ifeq ($(HDF5DIR),)
|
|
|
|
FFLAGS += -I/usr/include
|
|
|
|
else
|
|
|
|
FFLAGS += -I$(HDF5DIR)/include
|
|
|
|
LIBS += -L$(HDF5DIR)/lib
|
|
|
|
endif
|
|
|
|
LIBS += -lhdf5_fortran -lhdf5
|
2008-12-08 15:31:35 -06:00
|
|
|
endif
|
2008-11-04 13:08:01 -06:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------------
|