|
| 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