Ticket #41: Linux-ifort.mk

File Linux-ifort.mk, 4.0 KB (added by m.hadfield, 17 years ago)
Line 
1# svn $Id: Linux-ifort.mk 49 2007-05-10 21:40:11Z arango $
2#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
3# Copyright (c) 2002-2007 The ROMS/TOMS Group :::
4# Licensed under a MIT/X style license :::
5# See License_ROMS.txt :::
6#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
7#
8# Include file for Intel IFORT (version 8.x) compiler on Linux
9# -------------------------------------------------------------------------
10#
11# ARPACK_LIBDIR ARPACK libary directory
12# FC Name of the fortran compiler to use
13# FFLAGS Flags to the fortran compiler
14# CPP Name of the C-preprocessor
15# CPPFLAGS Flags to the C-preprocessor
16# CLEAN Name of cleaning executable after C-preprocessing
17# NETCDF_INCDIR NetCDF include directory
18# NETCDF_LIBDIR NetCDF libary directory
19# LD Program to load the objects into an executable
20# LDFLAGS Flags to the loader
21# RANLIB Name of ranlib command
22# MDEPFLAGS Flags for sfmakedepend (-s if you keep .f files)
23#
24# First the defaults
25#
26 FC := ifort
27 FFLAGS :=
28 CPP := /usr/bin/cpp
29 CPPFLAGS := -P -traditional
30 LD := $(FC)
31 LDFLAGS := -Vaxlib
32 AR := ar
33 ARFLAGS := r
34 MKDIR := mkdir -p
35 RM := rm -f
36 RANLIB := ranlib
37 PERL := perl
38 TEST := test
39
40 MDEPFLAGS := --cpp --fext=f90 --file=- --objdir=$(SCRATCH_DIR)
41
42#
43# Library locations, can be overridden by environment variables.
44#
45
46 MCT_INCDIR ?= /usr/local/mct/include
47 MCT_LIBDIR ?= /usr/local/mct/lib
48 NETCDF_INCDIR ?= /opt/intelsoft/netcdf/include
49 NETCDF_LIBDIR ?= /opt/intelsoft/netcdf/lib
50
51 CPPFLAGS += -I$(NETCDF_INCDIR)
52 LIBS := -L$(NETCDF_LIBDIR) -lnetcdf
53
54ifdef USE_ARPACK
55 ifdef USE_MPI
56 PARPACK_LIBDIR ?= /opt/intelsoft/PARPACK
57 LIBS += -L$(PARPACK_LIBDIR) -lparpack
58 endif
59 ARPACK_LIBDIR ?= /opt/intelsoft/PARPACK
60 LIBS += -L$(ARPACK_LIBDIR) -larpack
61endif
62
63ifdef USE_MPI
64 CPPFLAGS += -DMPI
65 ifdef USE_MPIF90
66# FC := /opt/intelsoft/mpich2/bin/mpif90
67 FC := /opt/intelsoft/mpich2-1.0.5/bin/mpif90
68 LD := $(FC)
69 else
70 LIBS += -lfmpi-pgi -lmpi-pgi
71 endif
72endif
73
74ifdef USE_OpenMP
75 CPPFLAGS += -D_OPENMP
76 FFLAGS += -openmp -fpp
77endif
78
79ifdef USE_DEBUG
80 FFLAGS += -g -check bounds -traceback
81else
82 FFLAGS += -ip -O3
83 ifeq ($(CPU),i686)
84 FFLAGS += -pc80 -xW
85 endif
86 ifeq ($(CPU),x86_64)
87 FFLAGS += -xW
88 endif
89endif
90
91ifdef SWAN_COUPLE
92 FFLAGS += -I$(MCT_INCDIR)
93 LIBS += -L$(MCT_LIBDIR) -lmct -lmpeu
94endif
95
96 clean_list += ifc* work.pc*
97
98#
99# Set free form format in source files to allow long string for
100# local directory and compilation flags inside the code.
101#
102
103$(SCRATCH_DIR)/mod_ncparam.o: FFLAGS += -free
104$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -free
105
106#
107# Supress free format in SWAN source files since there are comments
108# beyond column 72.
109#
110
111ifdef SWAN_COUPLE
112
113$(SCRATCH_DIR)/ocpcre.o: FFLAGS += -nofree
114$(SCRATCH_DIR)/ocpids.o: FFLAGS += -nofree
115$(SCRATCH_DIR)/ocpmix.o: FFLAGS += -nofree
116$(SCRATCH_DIR)/swancom1.o: FFLAGS += -nofree
117$(SCRATCH_DIR)/swancom2.o: FFLAGS += -nofree
118$(SCRATCH_DIR)/swancom3.o: FFLAGS += -nofree
119$(SCRATCH_DIR)/swancom4.o: FFLAGS += -nofree
120$(SCRATCH_DIR)/swancom5.o: FFLAGS += -nofree
121$(SCRATCH_DIR)/swanmain.o: FFLAGS += -nofree
122$(SCRATCH_DIR)/swanout1.o: FFLAGS += -nofree
123$(SCRATCH_DIR)/swanout2.o: FFLAGS += -nofree
124$(SCRATCH_DIR)/swanparll.o: FFLAGS += -nofree
125$(SCRATCH_DIR)/swanpre1.o: FFLAGS += -nofree
126$(SCRATCH_DIR)/swanpre2.o: FFLAGS += -nofree
127$(SCRATCH_DIR)/swanser.o: FFLAGS += -nofree
128$(SCRATCH_DIR)/swmod1.o: FFLAGS += -nofree
129$(SCRATCH_DIR)/swmod2.o: FFLAGS += -nofree
130$(SCRATCH_DIR)/swmod3.o: FFLAGS += -nofree
131
132endif