-
Notifications
You must be signed in to change notification settings - Fork 17
/
make.inc.parallel
380 lines (318 loc) · 9.45 KB
/
make.inc.parallel
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
#
# This file is part of INDDGO.
# Copyright (C) 2012, Oak Ridge National Laboratory
#
#----------------------------------------------------------------
# REQUIRED USER-SUPPLIED VARIABLE
# This should be a full path to the root directory for INDDGO.
# (i.e. the parent of lib_graphd, libtree_d, madness, wis, etc.)
#
SRC_DIR =
#----------------------------------------------------------------
# REQUIRED USER-SUPPLIED OPTIONS
# Determine which third-party software is used in the compilation.
# For any enabled packages, directories need to be set in next section.
# With default settings, necessary dirs are marked with #FILL IN
#WARNING: If HAS_PARMETIS=1, you must also set HAS_METIS=1 (metis is
#included in the parmetis install).
HAS_ARPACK = 0
HAS_SUITESPARSE = 1
HAS_PARMETIS = 1
HAS_METIS = 1
HAS_IGRAPH = 0
HAS_GMP = 0
HAS_GTEST = 0
# Set to 1 if you have boost installed on your system
# Many linux systems have it installed by default
HAS_BOOST = 0
#Slepc is needed if you want eigen values
HAS_PETSC = 1
HAS_SLEPC = 1
# Set whether serial or parallel version is desired for WIS.
IS_PARALLEL = 1
HAS_MADNESS = 1
# madness is included in the INDDGO distribution, and is required to be compiled for successful parallel execution of WIS.
MAC_OSX = 0
#some compiler flags cause problems on MacOSX. Set this to 1 if you're having problems compiling on OSX.
#use this to turn logging on/off
LOG_ENABLED = 0
#----------------------------------------------------------------
# OPTIONAL USER-SUPPLIED DIRECTORY VARIABLES
# These are the directories to find optional third-party software.
#
ARPACK =
#directory containing SuiteSparse installation. This includes AMD and SuiteSparse_config/UFconfig.
SUITESPARSE =
#NOTE: the build directory is usually platform dependent.
PARMETIS_SRC_DIR =
PARMETIS_LIB_DIR =
METIS_SRC_DIR = $(PARMETIS_SRC_DIR)/metis
METIS_LIB_DIR = $(PARMETIS_SRC_DIR)/metis/build/Linux-x86_64/libmetis/
IGRAPH =
IGRAPH_INSTALL_DIR = $(IGRAPH)/deploy
GMP =
GTEST_INCLUDE_DIR =
PETSC_DIR =
SLEPC_DIR =
#----------------------------------------------------------------
#
# Compilers, Flags and System Tools
#
CC = gcc
CXX = g++
# Set the following flag to 1 if you are compiling with a gcc version < 4.4
OLDGCC = 0
CFLAGS = -O3
CPPFLAGS =
LDFLAGS =
ifeq ($(HAS_BOOST),1)
CFLAGS := $(CFLAGS) -DHAS_BOOST
endif
ifeq ($(LOG_ENABLED), 1)
CFLAGS := $(CFLAGS) -D__LOG_ENABLE__
endif
ifeq ($(HAS_MADNESS),1)
CXX = mpicxx
ifeq ($(OLDGCC), 1)
CFLAGS := $(CFLAGS) -D__MADNESS__ -D_OLDGCC -Wno-strict-aliasing -Wno-deprecated -ffast-math
endif
ifeq ($(OLDGCC), 0)
CPPFLAGS := $(CPPFLAGS) -std=c++0x
CFLAGS := $(CFLAGS) -D__MADNESS__ -std=c++0x -Wno-strict-aliasing -Wno-deprecated -ffast-math
endif
endif
ifneq ($(MAC_OSX),1)
CFLAGS := $(CFLAGS) -march=native
endif
ifeq ($(IS_PARALLEL),1)
CXX = mpicxx
CFLAGS := $(CFLAGS) -D__PARALLEL__ -D__OPENMP__ -fopenmp
endif
ifeq ($(HAS_PARMETIS),1)
CXX = mpicxx
endif
ifeq ($(HAS_GTEST),1)
CFLAGS := $(CFLAGS) -I$(GTEST_INCLUDE_DIR)
endif
#FC = gfortran
#FFLAGS = -O3 -m64
CD = cd
ECHO = echo
LN = ln
LNFLAGS = -s
EXPORT = export
CONFIGURE = ./configure
MAKE = /usr/bin/make
AUTOGEN = ./autogen.sh
VALGRIND_COMMAND = valgrind --leak-check=yes --show-reachable=yes -v
VALGRIND_FLAGS= -g -O0
RM = rm
RMFLAGS = -f
SHELL = /bin/sh
AR = ar
ARFLAGS = rv
RANLIB = ranlib
#--------------------------------------------------------
# STOP: Most users should not need to edit below this
#--------------------------------------------------------
#-------------------------------------
# INDDGO internal directories
#
ifeq ($(SRC_DIR),)
$(error User must set SRC_DIR in make.inc)
endif
GRAPH = $(SRC_DIR)/lib_graphd
TREE = $(SRC_DIR)/lib_treed
PTREE = $(SRC_DIR)/lib_ptreed
WIS = $(SRC_DIR)/max_wis
VIZ = $(SRC_DIR)/viz
UTIL = $(SRC_DIR)/util
INDDGO_LIB_DIR = $(SRC_DIR)/lib
INDDGO_LIB = -L$(INDDGO_LIB_DIR)
INDDGO_BIN = $(SRC_DIR)/bin
SUBDIRS = $(GRAPH) $(TREE) $(PTREE) $(VIZ) $(WIS) $(UTIL)
MADNESS = $(SRC_DIR)/madness
MADNESS_INSTALL_DIR = $(MADNESS)/deploy
UTHASH_INCDIR = -I$(SRC_DIR)/uthash-1.9.3/src
RUN_TEST=./run_test.sh
#-------------------------------------
#
# Sanity checking for required third-party directories using HAS_XXX flags.
#
ifeq ($(HAS_ARPACK),1)
ifeq ($(ARPACK), )
$(error When HAS_ARPACK = 1, you must define the ARPACK directory variable)
endif
endif
ifeq ($(HAS_SUITESPARSE),1)
ifeq ($(SUITESPARSE), )
$(error When HAS_SUITESPARSE = 1, you must define the SUITESPARSE directory variable)
endif
endif
ifeq ($(HAS_PARMETIS),1)
ifeq ($(HAS_METIS),0)
$(error When HAS_PARMETIS = 1, HAS_METIS must also be 1)
endif
ifeq ($(PARMETIS_LIB_DIR), )
$(error When HAS_PARMETIS = 1, you must define the PARMETIS_LIB_DIR directory variable)
endif
ifeq ($(PARMETIS_SRC_DIR), )
$(error When HAS_PARMETIS = 1, you must define the PARMETIS_SRC_DIR directory variable)
endif
endif
ifeq ($(HAS_METIS),1)
ifeq ($(METIS_LIB_DIR), )
$(error When HAS_METIS = 1, you must define the METIS_LIB_DIR directory variable)
endif
ifeq ($(METIS_SRC_DIR), )
$(error When HAS_METIS = 1, you must define the METIS_SRC_DIR directory variable)
endif
endif
ifeq ($(HAS_SLEPC),1)
ifeq ($(HAS_PETSC),0)
$(error When HAS_SLEPC = 1, HAS_PETSC must also be 1)
endif
ifeq ($(SLEPC_DIR), )
$(error When HAS_SLEPC = 1, you must define the SLEPC_DIR directory variable)
endif
endif
ifeq ($(HAS_METIS),1)
ifeq ($(PETSC_DIR), )
$(error When HAS_PETSC = 1, you must define the PETSC_DIR directory variable)
endif
endif
ifeq ($(HAS_IGRAPH),1)
ifeq ($(IGRAPH), )
$(error When HAS_IGRAPH = 1, you must define the IGRAPH directory variable)
endif
endif
ifeq ($(HAS_GMP),1)
ifeq ($(GMP), )
$(error When HAS_GMP = 1, you must define the GMP directory variable)
endif
endif
#------------------------------------------------------------------
#
# Setting auxiliary library variables.
# If you have non-default third party builds, you may need to edit this.
#
MPILIBS =
MADLIBS = -lMADworld
METIS_INCLUDES=
ifeq ($(HAS_METIS),1)
METIS_INCLUDES = -I$(METIS_SRC_DIR)/include -I$(METIS_SRC_DIR)/libmetis -I$(METIS_SRC_DIR)/GKlib -I$(METIS_SRC_DIR)/programs
endif
PARMETIS_INCDIR=
ifeq ($(HAS_PARMETIS),1)
PARMETIS_INCDIR= -I$(PARMETIS_SRC_DIR)/include
endif
ARPACK_LIB=
ifeq ($(HAS_ARPACK),1)
ARPACK_LIB= -larpack_x86_64 -lgfortran
endif
#-----------------------------------------------------------------
#
# Start:
# ARPACK Specific options.
#
PLAT = x86_64
BLASdir = $(ARPACK)/BLAS
LAPACKdir = $(ARPACK)/LAPACK
UTILdir = $(ARPACK)/UTIL
SRCdir = $(ARPACK)/SRC
#
DIRS = $(BLASdir) $(LAPACKdir) $(UTILdir) $(SRCdir)
#
# %-------------------------------------------------------------------%
# | Comment out the previous line and uncomment the following |
# | if you already have the BLAS and LAPACK installed on your system. |
# | NOTE: ARPACK assumes the use of LAPACK version 2 codes. |
# %-------------------------------------------------------------------%
#
#DIRS = $(UTILdir) $(SRCdir)
#
# %---------------------------------------------------%
# | The name of the libraries to be created/linked to |
# %---------------------------------------------------%
#
ARPACKLIB = $(ARPACK)/libarpack_$(PLAT).a
LAPACKLIB =
BLASLIB =
#
ALIBS = $(ARPACKLIB) $(LAPACKLIB) $(BLASLIB)
#
# END:
# ARPACK specific options.
#------------------------------------------------------------------
#----------------------------------------------------------------
#
# Third party dependent flags and library settings.
# You should not need to edit these in almost all cases.
#
ifeq ($(HAS_ARPACK),1)
CFLAGS := $(CFLAGS) -DHAS_ARPACK
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_ARPACK
ARPACK_LIB := -L $(ARPACK) $(ARPACK_LIB)
endif
METIS_LIB =
VALGRIND_FLAGS=
ifeq ($(HAS_METIS),1)
CFLAGS := $(CFLAGS) -DHAS_METIS -D_FILE_OFFSET_BITS=64
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_METIS
METIS_LIB := -L$(METIS_LIB_DIR) -lmetis
endif
PARMETIS_LIB=
PARMETISOBJ=
ifeq ($(HAS_PARMETIS),1)
CFLAGS := $(CFLAGS) -DHAS_PARMETIS
PARMETISOBJ = $(METIS_LIB_DIR)/libmetis.a $(PARMETIS_LIB_DIR)/libparmetis.a
PARMETIS_LIB := -L$(PARMETIS_LIB_DIR) -lparmetis
endif
GMP_INCDIR=
GMP_LIB=
ifeq ($(HAS_GMP),1)
CFLAGS := $(CFLAGS) -DHAS_GMP
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_GMP
GMP_INCDIR=-I$(GMP)/include
GMP_LIB= -L$(GMP)/lib -lgmp
endif
SSPARSE_INCDIR=
SSPARSE_LIB=
ifeq ($(HAS_SUITESPARSE),1)
AMD = $(SUITESPARSE)/AMD
UFCONFIG = $(SUITESPARSE)/SuiteSparse_config
CFLAGS := $(CFLAGS) -DHAS_SUITESPARSE
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_SUITESPARSE
AMD_INCDIR= -I$(AMD)/Include -I$(UFCONFIG)
AMD_LIB= -L$(AMD)/Lib -lamd
SSPARSE_INCDIR= -I$(SUITESPARSE)/CHOLMOD/Include -I$(SUITESPARSE)/COLAMD/Include $(AMD_INCDIR)
SSPARSE_LIB= -L$(SUITESPARSE)/CHOLMOD/Lib -lcholmod -L$(SUITESPARSE)/COLAMD/Lib -lcolamd $(AMD_LIB)
endif
MADNESS_INCDIR=
MADNESS_LIB=
ifeq ($(HAS_MADNESS),1)
MADNESS_INCDIR= -I$(MADNESS_INSTALL_DIR)/include
MADNESS_LIB= -L$(MADNESS_INSTALL_DIR)/lib $(MADLIBS) -lpthread
SUBDIRS := $(SUBDIRS) $(MADNESS)
endif
IGRAPH_LIB=
IGRAPH_INCDIR=
ifeq ($(HAS_IGRAPH),1)
CFLAGS := $(CFLAGS) -DHAS_IGRAPH
IGRAPH_LIB= -L $(IGRAPH_INSTALL_DIR)/lib -ligraph
IGRAPH_INCDIR = -I $(IGRAPH_INSTALL_DIR)/include/igraph
endif
PETSC_INCDIR=
PETSC_LIB=
ifeq ($(HAS_PETSC),1)
CFLAGS := $(CFLAGS) -DHAS_PETSC
PETSC_INCDIR = -I $(PETSC_DIR)/include
PETSC_LIB = -L $(PETSC_DIR)/lib -lpetsc -llapack -lblas -lX11
endif
SLEPC_INCDIR=
SLEPC_LIB=
ifeq ($(HAS_SLEPC),1)
CFLAGS := $(CFLAGS) -DHAS_SLEPC
SLEPC_INCDIR = -I $(SLEPC_DIR)/include
SLEPC_LIB = -L $(SLEPC_DIR)/lib -lslepc
endif