-
Notifications
You must be signed in to change notification settings - Fork 3
/
gcc.mak
188 lines (168 loc) · 4.11 KB
/
gcc.mak
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#==============================================================
#
# Makefile for OS solvers (SGI)
#
# Author: Scott Collis
#
# Revised: 11-10-97
#
#==============================================================
#
# If you have a license to use Numerical Recipes
# you can activate it with this define.
#
ifdef USE_NR_ALL
USE_NR = 1
#USE_NR_ODEINT = 1
USE_NR_HUNT = 1
endif
ifdef USE_NR
ifdef USE_NR_ODEINT
#DEFINES += -DUSE_NR_ODEINT
endif
ifdef USE_NR_HUNT
DEFINES += -DUSE_NR_HUNT
endif
NR_OBJ =
NR_LIB = ../NR-utilities/libnr.a
#nr.o
endif
#
# Experimental (don't use)
#
ifdef USE_RKF45
DEFINES += -DUSE_RKF45
RKF45_OBJ = rkf45.o
endif
#
# High order, but RKCK45 works better in practise
#
ifdef USE_LSRK14
DEFINES += -DUSE_LSRK14
endif
#
# This currently is the best choice
#
ifdef USE_RKCK45
DEFINES += -DUSE_RKCK45
endif
#
# Experimental (i.e. don't use)
#
ifdef USE_VODE
DEFINES += -DUSE_VODE
VODE_OBJ = zvode.o
endif
#
# Compilers
#
CC = gcc-9
CXX = gxx-9
FC = gfortran
F77 = gfortran
#
# Define all objects
#
ALL = bl conte contebl conteucbl orrncbl orrcolchan orrsom orrspace \
orrfdbl orrfdchan orrbfs orrucbfs orrucbl orrwong shoot
#
OBJS = $(foreach module, $(ALL), $(module).o) $(NR_OBJ)
#
# Optimization/debug flags
#
OPT = -O2 -ffpe-trap=invalid,zero,overflow
#DEBUG = -g -fbacktrace -ffpe-trap=invalid,zero,overflow,underflow,denormal
#
# Compiler flags
#
FFLAGS = -cpp -ffixed-line-length-120 -freal-4-real-8 -fdefault-real-8 \
-fdefault-integer-8 -std=legacy $(DEFINES) $(OPT) $(DEBUG)
F90FLAGS = -cpp -freal-4-real-8 -fdefault-real-8 -fdefault-integer-8 \
$(DEFINES) $(OPT) $(DEBUG)
#
# Use the correct OpenBLAS
#
ifdef USE_LOCAL_OPENBLAS
OPENBLAS = -L$(HOME)/local/OpenBLAS/lib -lopenblas
else ifdef USE_HOMEBREW_OPENBLAS
OPENBLAS = -L/usr/local/opt/openblas/lib -lopenblas
else ifdef USE_APPLEBREW_OPENBLAS
OPENBLAS = -L/opt/homebrew/opt/openblas/lib -lopenblas
else ifdef USE_LINUXBREW_OPENBLAS
OPENBLAS = -L/home/linuxbrew/.linuxbrew/opt/openblas/lib -lopenblas
else
OPENBLAS = -L$(HOME)/local/OpenBLAS/lib -lopenblas
endif
#
# External Libraries
#
LIB = $(OPENBLAS) $(NR_LIB) $(RKF45_OBJ) $(VODE_OBJ)
#
# Define Fortran 90 suffix
#
.SUFFIXES: .f90
all:
$(MAKE) bl
$(MAKE) conte
$(MAKE) contebl
$(MAKE) conteucbl
$(MAKE) orrsom
$(MAKE) orrspace
ifdef USE_NR
$(MAKE) orrncbl
$(MAKE) orrcolchan
$(MAKE) orrfdbl
$(MAKE) orrfdchan
$(MAKE) orrbfs
$(MAKE) orrucbfs
$(MAKE) orrucbl
$(MAKE) orrwong
endif
docs:
doxygen
clean-docs:
/bin/rm -rf html latex
help:
@echo ''
@echo '==========================================================='
@echo ' OS-Stab Makefile options'
@echo '==========================================================='
@echo ' USE_NR_ALL=1 Will activate and use Numerical Recipes'
@echo ' ODEINT and HUNT in nr.f if you have license'
@echo ' and code to do so. Other will error out.'
@echo ' USE_RKCK45=1 Uses RKCK45 integration (best option)'
@echo ' USE_VODE=1 Experimental use of VODE integrator'
@echo ' USE_LSRK14=1 Uses low-storage RK14 ok, but RKCK45 better'
@echo ''
conte: conte.o shoot.o $(NR_OBJ) $(RKF45_OBJ) $(VODE_OBJ)
$(FC) $(LIB) shoot.o conte.o -o conte
contebl: contebl.o shoot.o $(NR_OBJ) $(RKF45_OBJ) $(VODE_OBJ)
$(FC) $(LIB) shoot.o contebl.o -o contebl
conteucbl: conteucbl.o $(NR_OBJ)
$(FC) $(LIB) conteucbl.o -o conteucbl
orrsom: orrsom.o $(NR_OBJ)
$(FC) $(LIB) orrsom.o -o orrsom
orrspace: orrspace.o $(NR_OBJ)
$(FC) $(LIB) orrspace.o -o orrspace
orrncbl: orrncbl.o $(NR_OBJ)
$(FC) $(LIB) orrncbl.o -o orrncbl
orrcolchan: orrcolchan.o $(NR_OBJ)
$(FC) $(LIB) orrcolchan.o -o orrcolchan
orrfdbl: orrfdbl.o $(NR_OBJ)
$(FC) $(LIB) orrfdbl.o -o orrfdbl
orrfdchan: orrfdchan.o $(NR_OBJ)
$(FC) $(LIB) orrfdchan.o -o orrfdchan
orrbfs: orrbfs.o $(NR_OBJ)
$(FC) $(LIB) orrbfs.o -o orrbfs
orrucbfs: orrucbfs.o $(NR_OBJ)
$(FC) $(LIB) orrucbfs.o -o orrucbfs
orrucbl: orrucbl.o $(NR_OBJ)
$(FC) $(LIB) orrucbl.o -o orrucbl
orrwong: orrwong.o $(NR_OBJ)
$(FC) $(LIB) orrwong.o -o orrwong
clean:
/bin/rm -fr $(ALL) *.o *.mod *.dSYM
.f90.o:
$(FC) $(F90FLAGS) -c $*.f90
.f.o:
$(F77) $(FFLAGS) -c $*.f