Skip to content

Commit 91298d6

Browse files
committed
Remove NETCDF, OPENMP, and Verbose Makefile arguments
1 parent f7e8a15 commit 91298d6

6 files changed

Lines changed: 162 additions & 6 deletions

File tree

MOM6

Submodule MOM6 updated 165 files

standalone/build/build_examples.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ ${MKMF_ROOT}/list_paths ${FMS_ROOT}/src
110110
echo "${SHR_ROOT}/src/shr_kind_mod.F90" >> path_names
111111
echo "${SHR_ROOT}/src/shr_const_mod.F90" >> path_names
112112
${MKMF_ROOT}/mkmf -t ${TEMPLATE} -p libfms.a -c "-Duse_libMPI -Duse_netCDF -DSPMD" path_names
113-
make -j${JOBS} NETCDF=3 ${REPRO_OR_DEBUG}=1 libfms.a
113+
make -j${JOBS} ${REPRO_OR_DEBUG}=1 libfms.a
114114

115115
# 2) Build MOM6
116116
cd ${INTERFACE_ROOT}/standalone/build
117117
mkdir -p ${BLD_ROOT}/MOM6
118118
cd ${BLD_ROOT}/MOM6
119119
${MKMF_ROOT}/list_paths -l ${MOM_ROOT}/{config_src/infra/FMS2,config_src/memory/dynamic_symmetric,config_src/drivers/solo_driver,../externals/MARBL/src,config_src/external,src/{*,*/*}}/
120120
${MKMF_ROOT}/mkmf -t ${TEMPLATE} -o '-I../FMS' -p MOM6 -l '-L../FMS -lfms' -c '-Duse_libMPI -Duse_netCDF -DSPMD' path_names
121-
make -j${JOBS} NETCDF=3 ${REPRO_OR_DEBUG}=1 MOM6
121+
make -j${JOBS} ${REPRO_OR_DEBUG}=1 MOM6
122122

123123
echo "Finished build at `date`"

standalone/templates/ncar-gnu.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# template for the GNU fortran compiler
2+
#
23
# typical use with mkmf
34
# mkmf -t linux-gnu.mk -c"-Duse_libMPI -Duse_netCDF" path_names /usr/local/include
5+
46
############
57
# commands #
68
############
@@ -12,6 +14,7 @@ LD = mpif90 $(MAIN_PROGRAM)
1214
#########
1315
# flags #
1416
#########
17+
1518
DEBUG =
1619
REPRO =
1720
VERBOSE =

standalone/templates/ncar-intel.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# template for Intel compilers
2+
#
23
# typical use with mkmf:
34
# mkmf -t nescc-intel.mk -c "-Duse_libMPI -Duse_netCDF" path_names /usr/local/include
45

56
############
67
# commands #
78
############
8-
99
FC = mpif90
1010
CC = mpicc
1111
CXX = icpc
@@ -37,7 +37,7 @@ CFLAGS += -I$(NETCDF_PATH)/include
3737
CFLAGS_OPT = -O2 -debug minimal
3838
CFLAGS_OPENMP = -openmp
3939
CFLAGS_DEBUG = -O0 -g -ftrapv
40-
40+
FFLAGS_NOOPT
4141
LDFLAGS :=
4242
LDFLAGS_OPENMP := -openmp
4343
LDFLAGS_VERBOSE := -Wl,-V,--verbose,-cref,-M
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# template for Intel compilers
2+
#
3+
# typical use with mkmf:
4+
# mkmf -t nescc-intel.mk -c "-Duse_libMPI -Duse_netCDF" path_names /usr/local/include
5+
6+
############
7+
# commands #
8+
############
9+
FC = mpif90
10+
CC = mpicc
11+
CXX = icpc
12+
LD = mpif90
13+
14+
############
15+
# flags #
16+
############
17+
18+
DEBUG =
19+
REPRO =
20+
21+
MAKEFLAGS += --jobs=8
22+
23+
FPPFLAGS := -fpp -Wp,-w
24+
25+
FFLAGS := -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -i4 -r8 -nowarn -traceback
26+
FFLAGS_OPT = -O3 -debug minimal -fp-model source -qoverride-limits
27+
FFLAGS_DEBUG = -g -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fpe0 -ftrapuv
28+
FFLAGS_REPRO = -O2 -debug minimal -fp-model source -qoverride-limits
29+
30+
CFLAGS := -D__IFC -sox -traceback -diag-disable=10441
31+
CFLAGS += -I$(NETCDF_PATH)/include
32+
CFLAGS_OPT = -O2 -debug minimal
33+
CFLAGS_OPENMP = -openmp
34+
CFLAGS_DEBUG = -O0 -g -ftrapv
35+
FFLAGS_NOOPT
36+
LDFLAGS :=
37+
38+
# start with blank LIBS
39+
LIBS :=
40+
41+
ifneq ($(REPRO),)
42+
CFLAGS += $(CFLAGS_REPRO)
43+
FFLAGS += $(FFLAGS_REPRO)
44+
else ifneq ($(DEBUG),)
45+
CFLAGS += $(CFLAGS_DEBUG)
46+
FFLAGS += $(FFLAGS_DEBUG)
47+
else
48+
CFLAGS += $(CFLAGS_OPT)
49+
FFLAGS += $(FFLAGS_OPT)
50+
endif
51+
52+
# Add Net CDF Flags
53+
FFLAGS += -I$(shell nf-config --includedir)
54+
# add the use_LARGEFILE cppdef
55+
ifneq ($(findstring -Duse_netCDF,$(CPPDEFS)),)
56+
CPPDEFS += -Duse_LARGEFILE
57+
endif
58+
endif
59+
60+
# Add netcdf linking
61+
LIBS := $(shell nc-config --libs) $(shell nf-config --flibs)
62+
63+
LDFLAGS += $(LIBS)
64+
65+
#---------------------------------------------------------------------------
66+
# you should never need to change any lines below.
67+
68+
# see the MIPSPro F90 manual for more details on some of the file extensions
69+
# discussed here.
70+
# this makefile template recognizes fortran sourcefiles with extensions
71+
# .f, .f90, .F, .F90. Given a sourcefile <file>.<ext>, where <ext> is one of
72+
# the above, this provides a number of default actions:
73+
74+
# make <file>.opt create an optimization report
75+
# make <file>.o create an object file
76+
# make <file>.s create an assembly listing
77+
# make <file>.x create an executable file, assuming standalone
78+
# source
79+
# make <file>.i create a preprocessed file (for .F)
80+
# make <file>.i90 create a preprocessed file (for .F90)
81+
82+
# The macro TMPFILES is provided to slate files like the above for removal.
83+
84+
RM = rm -f
85+
SHELL = /bin/csh -f
86+
TMPFILES = .*.m *.B *.L *.i *.i90 *.l *.s *.mod *.opt
87+
88+
.SUFFIXES: .F .F90 .H .L .T .f .f90 .h .i .i90 .l .o .s .opt .x
89+
90+
.f.L:
91+
$(FC) $(FFLAGS) -c -listing $*.f
92+
.f.opt:
93+
$(FC) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.f
94+
.f.l:
95+
$(FC) $(FFLAGS) -c $(LIST) $*.f
96+
.f.T:
97+
$(FC) $(FFLAGS) -c -cif $*.f
98+
.f.o:
99+
$(FC) $(FFLAGS) -c $*.f
100+
.f.s:
101+
$(FC) $(FFLAGS) -S $*.f
102+
.f.x:
103+
$(FC) $(FFLAGS) -o $*.x $*.f *.o $(LDFLAGS)
104+
.f90.L:
105+
$(FC) $(FFLAGS) -c -listing $*.f90
106+
.f90.opt:
107+
$(FC) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.f90
108+
.f90.l:
109+
$(FC) $(FFLAGS) -c $(LIST) $*.f90
110+
.f90.T:
111+
$(FC) $(FFLAGS) -c -cif $*.f90
112+
.f90.o:
113+
$(FC) $(FFLAGS) -c $*.f90
114+
.f90.s:
115+
$(FC) $(FFLAGS) -c -S $*.f90
116+
.f90.x:
117+
$(FC) $(FFLAGS) -o $*.x $*.f90 *.o $(LDFLAGS)
118+
.F.L:
119+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -listing $*.F
120+
.F.opt:
121+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.F
122+
.F.l:
123+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $(LIST) $*.F
124+
.F.T:
125+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -cif $*.F
126+
.F.f:
127+
$(FC) $(CPPDEFS) $(FPPFLAGS) -EP $*.F > $*.f
128+
.F.i:
129+
$(FC) $(CPPDEFS) $(FPPFLAGS) -P $*.F
130+
.F.o:
131+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $*.F
132+
.F.s:
133+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -S $*.F
134+
.F.x:
135+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -o $*.x $*.F *.o $(LDFLAGS)
136+
.F90.L:
137+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -listing $*.F90
138+
.F90.opt:
139+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.F90
140+
.F90.l:
141+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $(LIST) $*.F90
142+
.F90.T:
143+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -cif $*.F90
144+
.F90.f90:
145+
$(FC) $(CPPDEFS) $(FPPFLAGS) -EP $*.F90 > $*.f90
146+
.F90.i90:
147+
$(FC) $(CPPDEFS) $(FPPFLAGS) -P $*.F90
148+
.F90.o:
149+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $*.F90
150+
.F90.s:
151+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -S $*.F90
152+
.F90.x:
153+
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -o $*.x $*.F90 *.o $(LDFLAGS)

0 commit comments

Comments
 (0)