You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
184 lines
5.4 KiB
184 lines
5.4 KiB
# $Id: mkmf.template.gfdl_ws_64.gnu,v 1.1.2.1 2013/12/18 17:47:54 Niki.Zadeh Exp $ |
|
# template for the Intel fortran compiler |
|
# typical use with mkmf |
|
# mkmf -t template.ifc -c"-Duse_libMPI -Duse_netCDF" path_names /usr/local/include |
|
############ |
|
# commands # |
|
############ |
|
FC = gfortran |
|
CC = gcc |
|
LD = gfortran $(MAIN_PROGRAM) |
|
######### |
|
# flags # |
|
######### |
|
DEBUG = |
|
REPRO = |
|
VERBOSE = |
|
OPENMP = |
|
|
|
MAKEFLAGS += --jobs=$(shell grep '^processor' /proc/cpuinfo | wc -l) |
|
|
|
FPPFLAGS := |
|
|
|
FFLAGS := -fcray-pointer -fdefault-real-8 -Waliasing -ffree-line-length-none -fno-range-check |
|
FFLAGS += -I/net2/nnz/opt/netcdf-4.1.1/include |
|
#FFLAGS += -I/home/fms/local/opt/netcdf/4.1.1-gnu-4/include |
|
#The above fails with USE netcdf, ONLY: NF_FILL_REAL => NF90_FILL_REAL |
|
# 1 |
|
# Fatal Error: Parse error when checking module version for file 'netcdf.mod' opened at (1) |
|
# |
|
#FFLAGS += $(shell nc-config --fflags) |
|
# |
|
FFLAGS += -I/net2/nnz/opt/mpich2-1.3_ifort11_x64/include |
|
#FFLAGS += -I/usr/local/x64/mpich2-1.2.1p1/include # I do not trust this package, mpirun does not work |
|
#$(shell pkg-config --cflags-only-I mpich2-c) |
|
FFLAGS_OPT = -O2 |
|
FFLAGS_REPRO = |
|
FFLAGS_DEBUG = -O0 -g -W -fbounds-check |
|
FFLAGS_OPENMP = -fopenmp |
|
FFLAGS_VERBOSE = |
|
|
|
CFLAGS := -D__IFC |
|
CFLAGS += $(shell nc-config --cflags) |
|
CFLAGS += -I/net2/nnz/opt/netcdf-4.1.1/include -I/net2/nnz/opt/mpich2-1.3_ifort11_x64/include |
|
#CFLAGS += $(shell pkg-config --cflags-only-I mpich2-c) |
|
CFLAGS_OPT = -O2 |
|
CFLAGS_OPENMP = -fopenmp |
|
CFLAGS_DEBUG = -O0 -g |
|
|
|
# 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 = -O2 |
|
CFLAGS_TEST = -O2 |
|
|
|
LDFLAGS := |
|
LDFLAGS_OPENMP := -fopenmp |
|
LDFLAGS_VERBOSE := |
|
|
|
ifneq ($(REPRO),) |
|
CFLAGS += $(CFLAGS_REPRO) |
|
FFLAGS += $(FFLAGS_REPRO) |
|
endif |
|
ifneq ($(DEBUG),) |
|
CFLAGS += $(CFLAGS_DEBUG) |
|
FFLAGS += $(FFLAGS_DEBUG) |
|
else ifneq ($(TEST),) |
|
CFLAGS += $(CFLAGS_TEST) |
|
FFLAGS += $(FFLAGS_TEST) |
|
else |
|
CFLAGS += $(CFLAGS_OPT) |
|
FFLAGS += $(FFLAGS_OPT) |
|
endif |
|
|
|
ifneq ($(OPENMP),) |
|
CFLAGS += $(CFLAGS_OPENMP) |
|
FFLAGS += $(FFLAGS_OPENMP) |
|
LDFLAGS += $(LDFLAGS_OPENMP) |
|
endif |
|
|
|
ifneq ($(VERBOSE),) |
|
CFLAGS += $(CFLAGS_VERBOSE) |
|
FFLAGS += $(FFLAGS_VERBOSE) |
|
LDFLAGS += $(LDFLAGS_VERBOSE) |
|
endif |
|
|
|
ifeq ($(NETCDF),3) |
|
# add the use_LARGEFILE cppdef |
|
ifneq ($(findstring -Duse_netCDF,$(CPPDEFS)),) |
|
CPPDEFS += -Duse_LARGEFILE |
|
endif |
|
endif |
|
|
|
LIBS := $(shell nc-config --flibs) -L/net2/nnz/opt/mpich2-1.3_ifort11_x64/lib -lmpich -lmpl -lpthread |
|
#$(shell pkg-config --libs mpich2-f90) #does not work |
|
LDFLAGS += $(LIBS) |
|
|
|
#--------------------------------------------------------------------------- |
|
# you should never need to change any lines below. |
|
|
|
# see the MIPSPro F90 manual for more details on some of the file extensions |
|
# discussed here. |
|
# this makefile template recognizes fortran sourcefiles with extensions |
|
# .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) |
|
|
|
# The macro TMPFILES is provided to slate files like the above for removal. |
|
|
|
RM = rm -f |
|
SHELL = /bin/csh -f |
|
TMPFILES = .*.m *.B *.L *.i *.i90 *.l *.s *.mod *.opt |
|
|
|
.SUFFIXES: .F .F90 .H .L .T .f .f90 .h .i .i90 .l .o .s .opt .x |
|
|
|
.f.L: |
|
$(FC) $(FFLAGS) -c -listing $*.f |
|
.f.opt: |
|
$(FC) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.f |
|
.f.l: |
|
$(FC) $(FFLAGS) -c $(LIST) $*.f |
|
.f.T: |
|
$(FC) $(FFLAGS) -c -cif $*.f |
|
.f.o: |
|
$(FC) $(FFLAGS) -c $*.f |
|
.f.s: |
|
$(FC) $(FFLAGS) -S $*.f |
|
.f.x: |
|
$(FC) $(FFLAGS) -o $*.x $*.f *.o $(LDFLAGS) |
|
.f90.L: |
|
$(FC) $(FFLAGS) -c -listing $*.f90 |
|
.f90.opt: |
|
$(FC) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.f90 |
|
.f90.l: |
|
$(FC) $(FFLAGS) -c $(LIST) $*.f90 |
|
.f90.T: |
|
$(FC) $(FFLAGS) -c -cif $*.f90 |
|
.f90.o: |
|
$(FC) $(FFLAGS) -c $*.f90 |
|
.f90.s: |
|
$(FC) $(FFLAGS) -c -S $*.f90 |
|
.f90.x: |
|
$(FC) $(FFLAGS) -o $*.x $*.f90 *.o $(LDFLAGS) |
|
.F.L: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -listing $*.F |
|
.F.opt: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.F |
|
.F.l: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $(LIST) $*.F |
|
.F.T: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -cif $*.F |
|
.F.f: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) -EP $*.F > $*.f |
|
.F.i: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) -P $*.F |
|
.F.o: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $*.F |
|
.F.s: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -S $*.F |
|
.F.x: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -o $*.x $*.F *.o $(LDFLAGS) |
|
.F90.L: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -listing $*.F90 |
|
.F90.opt: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -opt_report_level max -opt_report_phase all -opt_report_file $*.opt $*.F90 |
|
.F90.l: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $(LIST) $*.F90 |
|
.F90.T: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -cif $*.F90 |
|
.F90.f90: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) -EP $*.F90 > $*.f90 |
|
.F90.i90: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) -P $*.F90 |
|
.F90.o: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c $*.F90 |
|
.F90.s: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -c -S $*.F90 |
|
.F90.x: |
|
$(FC) $(CPPDEFS) $(FPPFLAGS) $(FFLAGS) -o $*.x $*.F90 *.o $(LDFLAGS)
|
|
|