Add PGI and Intel compilers support to default host file.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
0a71fbc697
commit
87dc667040
build
@ -1,56 +1,138 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# depending on the compilation flags choose the right compilers and options
|
||||
# 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.
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# GNU Fortran compiler
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
ifeq ($(COMPILER), GNU)
|
||||
|
||||
# compiler and linker setup
|
||||
#
|
||||
ifeq ($(MPI),Y)
|
||||
FC = mpif90
|
||||
FC = mpifort
|
||||
else
|
||||
FC = gfortran
|
||||
endif
|
||||
LD = $(FC)
|
||||
|
||||
# preprocessor prefix (used by IBM Fortran, e.g.)
|
||||
# compiler and linker flags
|
||||
#
|
||||
CPPPREFIX =
|
||||
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)
|
||||
|
||||
# compiler and linker flags
|
||||
#
|
||||
ifeq ($(DEBUG),Y)
|
||||
FFLAGS = -g -O2 $(CPPPREFIX)-DDEBUG
|
||||
FFLAGS = -O -g -DDEBUG
|
||||
else
|
||||
FFLAGS = -O2
|
||||
FFLAGS = -fast
|
||||
endif
|
||||
ifeq ($(PROFILE),Y)
|
||||
FFLAGS += -Mprof=dwarf
|
||||
endif
|
||||
LDFLAGS = $(FFLAGS)
|
||||
ifeq ($(STATIC),Y)
|
||||
LDFLAGS += -Bstatic
|
||||
endif
|
||||
|
||||
LDFLAGS = $(FFLAGS)
|
||||
|
||||
# libraries
|
||||
#
|
||||
LIBS =
|
||||
endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 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)
|
||||
ifeq ($(STATIC),Y)
|
||||
LDFLAGS += -static
|
||||
LDFLAGS += -static
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Additional common directives set in make.config
|
||||
#
|
||||
|
||||
ifeq ($(SIGNALS),Y)
|
||||
FFLAGS += $(CPPPREFIX)-DSIGNALS
|
||||
FFLAGS += -DSIGNALS
|
||||
endif
|
||||
|
||||
ifeq ($(MPI),Y)
|
||||
FFLAGS += $(CPPPREFIX)-DMPI
|
||||
FFLAGS += -DMPI
|
||||
endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 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
|
||||
|
||||
ifeq ($(OUTPUT),HDF5)
|
||||
FFLAGS += -I/usr/include
|
||||
LIBS += -lhdf5_fortran -lhdf5 -lz
|
||||
ifeq ($(HDF5DIR),)
|
||||
FFLAGS += -I/usr/include
|
||||
else
|
||||
FFLAGS += -I$(HDF5DIR)/include
|
||||
LIBS += -L$(HDF5DIR)/lib
|
||||
endif
|
||||
LIBS += -lhdf5_fortran -lhdf5
|
||||
endif
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -9,7 +9,7 @@
|
||||
# SIGNALS - support for signals for proper shutdown with restart file
|
||||
#
|
||||
COMPILER = GNU
|
||||
DEBUG = Y
|
||||
DEBUG = N
|
||||
PROFILE = N
|
||||
STATIC = N
|
||||
SIGNALS = N
|
||||
@ -36,3 +36,7 @@ NDIMS = 2
|
||||
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# path for temporary files during compilation (uncomment if you wish to use it)
|
||||
#
|
||||
#OBJSDIR := /tmp/${USER}/amun-code/obj
|
Loading…
x
Reference in New Issue
Block a user