-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmakefile.system-dependent
309 lines (249 loc) · 10.8 KB
/
makefile.system-dependent
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# -*- mode: makefile -*-
# Copyright 2019, University of Maryland and the MANGO development team.
#
# This file is part of MANGO.
#
# MANGO is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# MANGO is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with MANGO. If not, see
# <https://www.gnu.org/licenses/>.
# This file, which is included by the main makefile, attempts to detect which computer we are on.
#####################################################################
# NERSC Cori
#####################################################################
#ifdef $(NERSC_HOST)
ifeq ($(NERSC_HOST),cori)
MANGO_HOST = cori
FC = ftn
FLINKER = $(FC)
## NERSC documentation recommends against specifying -O3
## -mkl MUST APPEAR AT THE END!!
EXTRA_COMPILE_FLAGS = -qopenmp -mkl
EXTRA_LINK_FLAGS = -qopenmp -mkl -Wl,-ydgemm_
# Above, the link flag "-Wl,-ydgemm_" causes the linker to report which version of DGEMM (the BLAS3 matrix-matrix-multiplication subroutine) is used.
# For batch systems, set the following variable to the command used to run jobs. This variable is used by 'make test'.
REGCOIL_COMMAND_TO_SUBMIT_JOB = srun -n 1 -c 32
#####################################################################
# PPPL cluster
#####################################################################
# 2020-06-24: Tested with the following modules:
# module load gcc openmpi gsl petsc_real anaconda3
# From external_packages, I ran all the install_* scripts. Note install_nlopt must be run after loading the compiler module (gcc). For some reason, nlopt had a build error when I tried the intel compiler rather than gcc.
# To use nlopt, in your .cshrc file you need to set
# setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/u/mlandrem/mango/external_packages/nlopt/nlopt-2.6.1/install/lib64
# (replacing mlandrem with whatever directory you used.)
#else ifneq (,$(findstring pppl,$(HOSTNAME)))
else ifneq (,$(findstring pppl,$(LD_LIBRARY_PATH)))
MANGO_HOST = pppl
# Change this next line to point to where you put the mango repository:
MANGO_DIR = /u/mlandrem/mango
MANGO_PETSC_AVAILABLE = T
MANGO_HOPSPACK_AVAILABLE = T
MANGO_NLOPT_AVAILABLE = T
MANGO_GSL_AVAILABLE = T
MANGO_DAKOTA_AVAILABLE = F
MANGO_EIGEN_AVAILABLE = T
#CC = mpicc
#FC = mpif90
#CLINKER = $(CC)
#FLINKER = $(FC)
# The next line should set CC, FC, CLINKER, and FLINKER
include ${PETSC_DIR}/lib/petsc/conf/variables
#include ${PETSC_DIR}/lib/petsc/conf/rules
EXTRA_C_COMPILE_FLAGS = -O0 -g -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/include
EXTRA_F_COMPILE_FLAGS = -ffree-line-length-none
EXTRA_C_LINK_FLAGS = -L$(PETSC_DIR)/lib -lpetsc
EXTRA_F_LINK_FLAGS = -L$(PETSC_DIR)/lib -lpetsc
ifeq ($(MANGO_NLOPT_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I ${MANGO_DIR}/external_packages/nlopt/nlopt-2.6.1/install/include
EXTRA_C_LINK_FLAGS += -L ${MANGO_DIR}/external_packages/nlopt/nlopt-2.6.1/install/lib64 -lnlopt
EXTRA_F_LINK_FLAGS += -L ${MANGO_DIR}/external_packages/nlopt/nlopt-2.6.1/install/lib64 -lnlopt
endif
ifeq ($(MANGO_GSL_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I $(GSL_HOME)/include
EXTRA_C_LINK_FLAGS += -L $(GSL_HOME)/lib -lgsl
EXTRA_F_LINK_FLAGS += -L $(GSL_HOME)/lib -lgsl
endif
ifeq ($(MANGO_EIGEN_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I external_packages/eigen/eigen-3.3.7
endif
MANGO_COMMAND_TO_SUBMIT_JOB = srun -n NUM_PROCS
#####################################################################
# IPP Draco
#####################################################################
else ifeq ($(CLUSTER),DRACO)
MANGO_HOST = draco
# On Draco, you sometimes seem to need 'module load gcc', sometimes not.
MANGO_PETSC_AVAILABLE = T
MANGO_HOPSPACK_AVAILABLE = T
MANGO_NLOPT_AVAILABLE = T
MANGO_GSL_AVAILABLE = T
MANGO_DAKOTA_AVAILABLE = F
MANGO_EIGEN_AVAILABLE = T
#ifeq ($(PETSC_DIR),)
#$(error PETSC_DIR is not defined. This probably means you have not loaded the petsc-real module.)
#endif
ifeq ($(MANGO_PETSC_AVAILABLE),T)
include ${PETSC_DIR}/lib/petsc/conf/variables
#include ${PETSC_DIR}/lib/petsc/conf/rules
EXTRA_C_COMPILE_FLAGS = -O0 -g -I/u/mlan/nlopt/nlopt-2.6.1/install/include -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/include
EXTRA_F_COMPILE_FLAGS = -O0 -g -module obj -I/u/mlan/nlopt/nlopt-2.6.1/install/include -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/include
EXTRA_C_LINK_FLAGS = -L/u/mlan/nlopt/nlopt-2.6.1/install/lib64 -lnlopt -L$(PETSC_DIR)/lib -lpetsc
EXTRA_F_LINK_FLAGS = -L/u/mlan/nlopt/nlopt-2.6.1/install/lib64 -lnlopt -cxxlib -L$(PETSC_DIR)/lib -lpetsc
else
CC = mpiicpc
FC = mpiifort
CLINKER = $(CC)
FLINKER = $(FC)
EXTRA_C_COMPILE_FLAGS = -O0 -g -I/u/mlan/nlopt/nlopt-2.6.1/install/include
EXTRA_F_COMPILE_FLAGS = -O0 -g -module obj -I/u/mlan/nlopt/nlopt-2.6.1/install/include
EXTRA_C_LINK_FLAGS = -L/u/mlan/nlopt/nlopt-2.6.1/install/lib64 -lnlopt
EXTRA_F_LINK_FLAGS = -L/u/mlan/nlopt/nlopt-2.6.1/install/lib64 -lnlopt -cxxlib
endif
ifeq ($(MANGO_GSL_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I $(GSL_HOME)/include
EXTRA_C_LINK_FLAGS += -L $(GSL_HOME)/lib -lgsl
EXTRA_F_LINK_FLAGS += -L $(GSL_HOME)/lib -lgsl
endif
EXTRA_C_COMPILE_FLAGS += -I external_packages/eigen/eigen-3.3.7
#PETSC_DIR=/opt/local/lib/petsc
#
#EXTRA_C_COMPILE_FLAGS = -I${PETSC_DIR}/include -O0 -g
#EXTRA_F_COMPILE_FLAGS = -I${PETSC_DIR}/include -ffree-line-length-none -O0 -g
#EXTRA_COMPILE_FLAGS = -ffree-line-length-none -O0 -g
#EXTRA_LINK_FLAGS = -lnlopt
#EXTRA_C_COMPILE_FLAGS += -I/usr/local/include
#EXTRA_F_COMPILE_FLAGS += -I/usr/local/include
# catch2 requires the -std=c++11 flag
EXTRA_C_COMPILE_FLAGS += -std=c++11
MANGO_COMMAND_TO_SUBMIT_JOB = srun -n NUM_PROCS
#####################################################################
# Travis-CI
#####################################################################
else ifneq (,$(TRAVIS_ARCH))
MANGO_HOST = travis
MANGO_PETSC_AVAILABLE = T
MANGO_HOPSPACK_AVAILABLE = F
MANGO_NLOPT_AVAILABLE = T
MANGO_GSL_AVAILABLE = T
MANGO_DAKOTA_AVAILABLE = F
MANGO_EIGEN_AVAILABLE = T
# Locations of PETSc files as they will be located in travis's Ubuntu filesystem can be found at
# https://packages.ubuntu.com/bionic/amd64/libpetsc3.7.7-dev/filelist
# or
# https://www.apt-browse.org/browse/ubuntu/bionic/universe/amd64/libpetsc3.7.7-dev/3.7.7+dfsg1-2build5/
PETSC_DIR=/usr/lib/petscdir/3.7.7/x86_64-linux-gnu-real
# The next line should set CC, FC, CLINKER, and FLINKER
include ${PETSC_DIR}/lib/petsc/conf/variables
#include ${PETSC_DIR}/lib/petsc/conf/rules
EXTRA_C_COMPILE_FLAGS = -I${PETSC_DIR}/include -O0 -g
EXTRA_F_COMPILE_FLAGS = -I${PETSC_DIR}/include -ffree-line-length-none -O0 -g
EXTRA_C_LINK_FLAGS = ${EXTRA_LINK_FLAGS}
EXTRA_F_LINK_FLAGS = ${EXTRA_LINK_FLAGS}
ifeq ($(MANGO_NLOPT_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I ${TRAVIS_BUILD_DIR}/external_packages/nlopt/nlopt-2.6.1/install/include
EXTRA_C_LINK_FLAGS += -L ${TRAVIS_BUILD_DIR}/external_packages/nlopt/nlopt-2.6.1/install/lib -lnlopt
EXTRA_F_LINK_FLAGS += -L ${TRAVIS_BUILD_DIR}/external_packages/nlopt/nlopt-2.6.1/install/lib -lnlopt
endif
ifeq ($(MANGO_GSL_AVAILABLE),T)
EXTRA_C_LINK_FLAGS += -lgsl
EXTRA_F_LINK_FLAGS += -lgsl
endif
ifeq ($(MANGO_EIGEN_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I /usr/include/eigen3
endif
# For batch systems, set the following variable to the command used to run jobs. This variable is used by 'make test'.
MANGO_COMMAND_TO_SUBMIT_JOB = mpiexec -n NUM_PROCS --mca btl_base_warn_component_unused 0 --mca orte_base_help_aggregate 0
# In the above line, the "mca" flags suppress warning messages from MPI about "transport being slow", which is probably
# an artifact of using mpi on the travis virtual machine.
#####################################################################
# Generic Ubuntu (assumes 18.04 LTS)
#####################################################################
else ifeq ($(shell lsb_release -si),Ubuntu)
MANGO_HOST = ubuntu
MANGO_PETSC_AVAILABLE = F
MANGO_HOPSPACK_AVAILABLE = F
MANGO_NLOPT_AVAILABLE = T
MANGO_GSL_AVAILABLE = T
MANGO_DAKOTA_AVAILABLE = F
MANGO_EIGEN_AVAILABLE = T
CC = mpicxx
FC = mpif90
CLINKER = $(CC)
FLINKER = $(CC)
EXTRA_C_COMPILE_FLAGS = -O0
EXTRA_F_COMPILE_FLAGS = -ffree-line-length-none -O0
ifeq ($(MANGO_NLOPT_AVAILABLE),T)
EXTRA_LINK_FLAGS += -lnlopt
endif
ifeq ($(MANGO_GSL_AVAILABLE),T)
EXTRA_LINK_FLAGS += -lgsl -lgslcblas
endif
EXTRA_C_LINK_FLAGS = $(EXTRA_LINK_FLAGS) -lgfortran
#EXTRA_F_LINK_FLAGS = $(EXTRA_LINK_FLAGS)
EXTRA_F_LINK_FLAGS = $(EXTRA_C_LINK_FLAGS) -lmpi_mpifh
#####################################################################
# Matt's laptop, with mpi and petsc via macports
#####################################################################
else
MANGO_HOST = osx
MANGO_PETSC_AVAILABLE = T
MANGO_HOPSPACK_AVAILABLE = T
MANGO_NLOPT_AVAILABLE = T
MANGO_GSL_AVAILABLE = T
MANGO_DAKOTA_AVAILABLE = F
MANGO_EIGEN_AVAILABLE = T
# This next parameter matters only if MANGO_PETSC_AVAILABLE == T
MANGO_USE_MACPORTS_PETSC = F
ifeq ($(MANGO_PETSC_AVAILABLE),T)
ifeq ($(MANGO_USE_MACPORTS_PETSC),T)
PETSC_DIR=/opt/local/lib/petsc
PETSC_ARCH=
include ${PETSC_DIR}/lib/petsc/conf/variables
else
PETSC_DIR=/Users/mattland/petsc/petsc-3.12.2
PETSC_ARCH=arch-darwin-c-debug
include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables
CLINKER = $(CC)
FLINKER = $(CC)
endif
else
CLINKER = $(CC)
FLINKER = $(CC)
endif
#include ${PETSC_DIR}/lib/petsc/conf/petscvariables
#include ${PETSC_DIR}/lib/petsc/conf/rules
#CC = mpicxx
#FC = mpif90
# GSL is in /opt/local/include and /opt/local/lib
EXTRA_C_COMPILE_FLAGS = -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/include -O0 -g
EXTRA_F_COMPILE_FLAGS = -I${PETSC_DIR}/include -ffree-line-length-none -O0 -g
EXTRA_C_LINK_FLAGS = ${EXTRA_LINK_FLAGS}
EXTRA_F_LINK_FLAGS = ${EXTRA_LINK_FLAGS}
# The next 2 lines seem necessary if building without PETSC
EXTRA_C_LINK_FLAGS += -lstdc++
EXTRA_F_LINK_FLAGS += -lstdc++
ifeq ($(MANGO_NLOPT_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I/usr/local/include
EXTRA_C_LINK_FLAGS += -lnlopt
EXTRA_F_LINK_FLAGS += -lnlopt
endif
ifeq ($(MANGO_GSL_AVAILABLE),T)
EXTRA_C_COMPILE_FLAGS += -I/opt/local/include
EXTRA_C_LINK_FLAGS += -L/opt/local/lib -lgsl -lgslcblas
EXTRA_F_LINK_FLAGS += -L/opt/local/lib -lgsl -lgslcblas
endif
EXTRA_C_COMPILE_FLAGS += -I external_packages/eigen/eigen-3.3.7
# For batch systems, set the following variable to the command used to run jobs. This variable is used by 'make test'.
MANGO_COMMAND_TO_SUBMIT_JOB = mpiexec -n NUM_PROCS
#####################################################################
endif