-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
112 lines (85 loc) · 2.77 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# set default fortran compiler:
FC = gfortran
#FC = ifort
# set mode
MODE =
# set to "EMPIRE" for EMPIRE mode or leave empty for pure OPTMAN
# set formatted output for *.tlj
OUTMODE =
# set to "formatted" for formatted output of *.tlj or leave blank
# for unformatted
# set parallel
PARALLEL =OPENMP
# set to "OPENMP" for parallelization or leave blank for single thread
# set matrix inversion
MATRIX =
# set to "LAPACK" for LAPACK matrix inversion or leave blank for
# subroutine
# various flags are set based on compiler FC:
# FFLAGS are the normal complier options for production code
# DFLAGS are the options used when debugging (except for ECIS)
# EFLAGS are the options used for ECIS (no debug allowed)
# OFLAGS are the options used for OPTMAN
LIBS =
DFLAGS =
FFLAGS =
EFLAGS =
OFLAGS =
ifeq ($(FC),gfortran)
#---------------------------------
#----GNU gfortran FORTRAN compiler
#---------------------------------
#----flags for production compilation with gfortran
FFLAGS = -O3 -std=legacy -ftree-vectorize -ffast-math -cpp
ifeq ($(PARALLEL),OPENMP)
FFLAGS += -fopenmp
endif
#FFLAGS = -O3 -pg -std=legacy
#----flags for debuging
DFLAGS = -O0 -g --bounds-check -std=legacy -ftrapv
# -pg shoudl be added for profiling
#----flags for OPTMAN
OFLAGS = -O2 -std=legacy -ffast-math
else ifeq ($(FC),ifort)
#---------------------------
#----INTEL f95 compiler
#---------------------------
#----flags for production compilation using ifort
# *** Please note that ifort v11.1 does not work properly with -ipo !!!!!
#----flags for debuging
DFLAGS = -O0 -g -debug all -check all -warn unused -fp-stack-check -ftrapuv -trace -logo
#------------------------------------------------------------------------------------------------
# FFLAGS = -O3 -x=host -logo -parallel -openmp-report1 -par-threshold2 -openmp -vec-report1
# flags for automatic & openMP directives
ifeq ($(MATRIX),LAPACK)
LIBS = -mkl#-openmp-lib compat
endif
#----flags for automatic parallelization
FFLAGS = -O3 -fpp
ifeq ($(PARALLEL),OPENMP)
FFLAGS += -qopenmp
endif
# Flags for OPTMAN
OFLAGS = -O2
endif
ifeq ($(MATRIX),LAPACK)
FFLAGS = $(FFLAGS) -DLAPACK
endif
ifeq ($(MODE),EMPIRE)
FFLAGS = $(FFLAGS) -DEMPMODE
endif
ifeq ($(OUTMODE),formatted)
FFLAGS = $(FFLAGS) -DFORMATTEDOUT
endif
# make sure MAKE knows f90 extension
%.o : src/%.f
$(FC) $(FFLAGS) -c $<
OBJF = OPTMAND.o SHEMSOFD.o dispers.o KNDITD.o ccrd.o ABCTpar.o DATETpar.o LU_matrix_inv.o opt2Rmatrix.o
all:
$(MAKE) optmand
optmand: $(OBJF)
$(FC) $(FFLAGS) -o optmand $(OBJF) $(LIBS)
clean:
rm -f *.o *.mod
cleanall:
rm -f *.o *.mod empire optmand *.optrpt