Skip to content

Commit

Permalink
Update ncrc templates for latest ncrc/c3 settings
Browse files Browse the repository at this point in the history
Add missing compile flags for ncrc/c3 settings to allow intel to reproduce from run to run.

Also removed unsupported intel tag -override-limits

Updated VERBOSE compile option with -Wall equivalent tag for all compilers.

Fixes NOAA-GFDL#9
  • Loading branch information
underwoo committed May 2, 2016
1 parent 725a382 commit 27b7a82
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 34 deletions.
17 changes: 9 additions & 8 deletions templates/ncrc-gnu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ FFLAGS_OPT = -O2 -fno-expensive-optimizations
FFLAGS_REPRO =
FFLAGS_DEBUG = -O0 -g -W -fbounds-check -ffpe-trap=invalid,zero,overflow
FFLAGS_OPENMP = -fopenmp
FFLAGS_VERBOSE =
FFLAGS_VERBOSE = -Wall -Wextra

CFLAGS := -D__IFC
CFLAGS_OPT = -O2
CFLAGS_OPENMP = -fopenmp
CFLAGS_DEBUG = -O0 -g
CFLAGS_VERBOSE = -Wall -Wextra

# Optional Testing compile flags. Mutually exclusive from DEBUG, REPRO, and OPT
# *_TEST will match the production if no new option(s) is(are) to be tested.
Expand Down Expand Up @@ -94,13 +95,13 @@ LDFLAGS += $(LIBS)
# .f, .f90, .F, .F90. Given a sourcefile <file>.<ext>, where <ext> is one of
# the above, this provides a number of default actions:

# make <file>.opt create an optimization report
# make <file>.o create an object file
# make <file>.s create an assembly listing
# make <file>.x create an executable file, assuming standalone
# source
# make <file>.i create a preprocessed file (for .F)
# make <file>.i90 create a preprocessed file (for .F90)
# make <file>.opt create an optimization report
# make <file>.o create an object file
# make <file>.s create an assembly listing
# make <file>.x create an executable file, assuming standalone
# source
# make <file>.i create a preprocessed file (for .F)
# make <file>.i90 create a preprocessed file (for .F90)

# The macro TMPFILES is provided to slate files like the above for removal.

Expand Down
39 changes: 22 additions & 17 deletions templates/ncrc-intel.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# template for the Intel fortran compiler
# typical use with mkmf
# mkmf -t template.ifc -c"-Duse_libMPI -Duse_netCDF" path_names /usr/local/include
# mkmf -t ncrc-intel.mk -c"-Duse_libMPI -Duse_netCDF" path_names /usr/local/include
############
# commands #
############
Expand All @@ -23,7 +23,7 @@ need := 3.81
ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
ifneq ($(need),$(ok))
$(error Need at least make version $(need). Load module gmake/3.81)
endif
endif

MAKEFLAGS += --jobs=2

Expand All @@ -33,21 +33,26 @@ INCLUDE = -I$(NETCDF_ROOT)/include

FPPFLAGS := -fpp -Wp,-w $(INCLUDE)

FFLAGS := -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -i4 -r8 -nowarn -sox -traceback $(INCLUDE)
FFLAGS_OPT = -O3 -debug minimal -fp-model source -override-limits
# -msse2 is added as a workaround for reproducibility on the c3 system. We in the
# modeling systems group are looking for why this is needed to allow run-to-run
# reproducibility on the c3 system.
FFLAGS := -msse2 -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -i4 -r8 -nowarn -sox -traceback $(INCLUDE)
FFLAGS_OPT = -O3 -debug minimal -fp-model source
FFLAGS_DEBUG = -g -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fpe0 -ftrapuv
FFLAGS_REPRO = -O2 -debug minimal -fp-model source -override-limits
FFLAGS_REPRO = -O2 -debug minimal -fp-model source
FFLAGS_OPENMP = -openmp
FFLAGS_VERBOSE = -v -V -what
FFLAGS_VERBOSE = -v -V -what -warn all

CFLAGS := -D__IFC -sox -traceback
CFLAGS := -D__IFC -msse2 -sox -traceback
CFLAGS_OPT = -O2 -debug minimal
CFLAGS_REPRO = -O2 -debug minimal
CFLAGS_OPENMP = -openmp
CFLAGS_DEBUG = -O0 -g -ftrapuv
CFLAGS_DEBUG = -O0 -g -ftrapuv
CFLAGS_VERBOSE = -w3

# Optional Testing compile flags. Mutually exclusive from DEBUG, REPRO, and OPT
# *_TEST will match the production if no new option(s) is(are) to be tested.
FFLAGS_TEST = -O3 -debug minimal -fp-model source -override-limits
FFLAGS_TEST = -O3 -debug minimal -fp-model source
CFLAGS_TEST = -O2

LDFLAGS :=
Expand Down Expand Up @@ -98,7 +103,7 @@ else
LIBS += -lnetcdf
endif

LIBS +=
LIBS +=
LDFLAGS += $(LIBS)

#---------------------------------------------------------------------------
Expand All @@ -110,13 +115,13 @@ LDFLAGS += $(LIBS)
# .f, .f90, .F, .F90. Given a sourcefile <file>.<ext>, where <ext> is one of
# the above, this provides a number of default actions:

# make <file>.opt create an optimization report
# make <file>.o create an object file
# make <file>.s create an assembly listing
# make <file>.x create an executable file, assuming standalone
# source
# make <file>.i create a preprocessed file (for .F)
# make <file>.i90 create a preprocessed file (for .F90)
# make <file>.opt create an optimization report
# make <file>.o create an object file
# make <file>.s create an assembly listing
# make <file>.x create an executable file, assuming standalone
# source
# make <file>.i create a preprocessed file (for .F)
# make <file>.i90 create a preprocessed file (for .F90)

# The macro TMPFILES is provided to slate files like the above for removal.

Expand Down
18 changes: 9 additions & 9 deletions templates/ncrc-pgi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ FFLAGS_OPT = -O3 -Mvect=nosse -Mnoscalarsse -Mallocatable=95
FFLAGS_DEBUG = -O0 -g -traceback -Ktrap=fp
FFLAGS_REPRO = -O2 -Mvect=nosse -Mnoscalarsse $(NOFMA)
FFLAGS_OPENMP = -mp
FFLAGS_VERBOSE = -v
FFLAGS_VERBOSE = -v -Minform=inform

CPPFLAGS = $(INCLUDE)
CFLAGS =
CFLAGS_OPT = -O2
CFLAGS_DEBUG = -O0 -g -traceback -Ktrap=fp
CFLAGS_OPENMP = -mp
CFLAGS_VERBOSE = -v
CFLAGS_VERBOSE = -v -Minform=inform

# Optional Testing compile flags. Mutually exclusive from DEBUG, REPRO, and OPT
# *_TEST will match the production if no new option(s) is(are) to be tested.
Expand Down Expand Up @@ -114,13 +114,13 @@ LDFLAGS += $(LIBS)
# .f, .f90, .F, .F90. Given a sourcefile <file>.<ext>, where <ext> is one of
# the above, this provides a number of default actions:

# make <file>.opt create an optimization report
# make <file>.o create an object file
# make <file>.s create an assembly listing
# make <file>.x create an executable file, assuming standalone
# source
# make <file>.i create a preprocessed file (for .F)
# make <file>.i90 create a preprocessed file (for .F90)
# make <file>.opt create an optimization report
# make <file>.o create an object file
# make <file>.s create an assembly listing
# make <file>.x create an executable file, assuming standalone
# source
# make <file>.i create a preprocessed file (for .F)
# make <file>.i90 create a preprocessed file (for .F90)

# The macro TMPFILES is provided to slate files like the above for removal.

Expand Down

0 comments on commit 27b7a82

Please sign in to comment.