-
Notifications
You must be signed in to change notification settings - Fork 0
/
systemdef.mk
276 lines (251 loc) · 7.2 KB
/
systemdef.mk
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
# -*- Makefile -*-
#
# Override SYSTEM and other variable definition in user.mk
#
# In order to switch between a debug and an optimized executable, set CFLAGS
# in your 'user.mk' file as follows:
#
# * For an executable with debug information:
# CFLAGS = -g -DDEBUG -O0
#
# * For an optimized executable:
# CFLAGS = -O2
#
# * For an even more optimized executable:
CFLAGS = -O3
#
# check other platform specific flags below.
#
-include $(WORKDIR)/user.mk
ifndef SYSTEM
SYSTEM := $(shell uname -s | tr A-Z a-z)
ARCH = $(shell uname -m | tr A-Z a-z)
endif
ifeq ($(SYSTEM), Stampede)
CC = mpicc
CXX = mpicxx
LD = mpicxx
CFLAGS += -DBIGBEN
CC += -I/opt/apps/intel18/gsl/2.6/include/
LDFLAGS += -L/opt/apps/intel18/gsl/2.6/lib/
LDFLAGS += -lgsl -lgslcblas
#LDFLAGS +=
#ifdef IOBUF_INC
# CPPFLAGS += -I${IOBUF_INC}
#endif
CPPFLAGS += -D_USE_FILE_OFFSET64 -D_FILE_OFFSET_BITS=64 -D_USE_LARGEFILE64
endif
ifeq ($(SYSTEM), Frontera)
CC = mpicc
CXX = mpicxx
LD = mpicxx
CFLAGS += -DBIGBEN
CFLAGS += -xCORE-AVX512
# CC += -I/opt/apps/intel19/gsl/2.6/include/
# LDFLAGS += -L/opt/apps/intel19/gsl/2.6/lib/
# NOTE: The special envrionment variables TACC_GSL_INC and TACC_GSL_LIB
# can be used on Frontera to link the GSL library, but users must load
# the GSL module before compiling and launching Hercules with the command
# `module load gsl` or `ml gsl`.
CC += -I$$TACC_GSL_INC
LDFLAGS += -L$$TACC_GSL_LIB
LDFLAGS += -lgsl -lgslcblas
#LDFLAGS +=
#ifdef IOBUF_INC
# CPPFLAGS += -I${IOBUF_INC}
#endif
CPPFLAGS += -D_USE_FILE_OFFSET64 -D_FILE_OFFSET_BITS=64 -D_USE_LARGEFILE64
endif
ifeq ($(SYSTEM), Stampede3)
CC = mpicc
CXX = mpicxx
LD = mpicxx
CFLAGS += -DBIGBEN -xCORE-AVX512
# CC += -I/opt/apps/intel19/gsl/2.6/include/
# LDFLAGS += -L/opt/apps/intel19/gsl/2.6/lib/
# NOTE: The special envrionment variables TACC_GSL_INC and TACC_GSL_LIB
# can be used on Frontera to link the GSL library, but users must load
# the GSL module before compiling and launching Hercules with the command
# `module load gsl` or `ml gsl`.
CC += -I$$TACC_GSL_INC
LDFLAGS += -L$$TACC_GSL_LIB
LDFLAGS += -lgsl -lgslcblas
#LDFLAGS +=
#ifdef IOBUF_INC
# CPPFLAGS += -I${IOBUF_INC}
#endif
CPPFLAGS += -D_USE_FILE_OFFSET64 -D_FILE_OFFSET_BITS=64 -D_USE_LARGEFILE64
endif
ifeq ($(SYSTEM), XT5)
CC = cc
CXX = CC
LD = CC
CFLAGS += -DBIGBEN
LDFLAGS +=
ifdef IOBUF_INC
CPPFLAGS += -I${IOBUF_INC}
endif
CPPFLAGS += -D_USE_FILE_OFFSET64 -D_FILE_OFFSET_BITS=64 -D_USE_LARGEFILE64
endif
ifeq ($(SYSTEM), XK7CPU)
CC = cc
CXX = CC
LD = CC
CFLAGS += -DBIGBEN
LDFLAGS += -Wl,-zmuldefs
ifdef IOBUF_INC
CPPFLAGS += -I${IOBUF_INC}
endif
CPPFLAGS += -D_USE_FILE_OFFSET64 -D_FILE_OFFSET_BITS=64 -D_USE_LARGEFILE64
endif
ifeq ($(SYSTEM), BGW)
MPI_DIR ?= /bgl/BlueLight/ppcfloor/bglsys
CC = mpcc
CXX = mpCC
LD = mpCC
CFLAGS += -qmaxmem=-1 -qarch=440
CFLAGS += -DBGL
CFLAGS += -D_FILE_OFFSET_BITS=64
endif
ifeq ($(SYSTEM), BGL)
MPI_DIR ?= /bgl/BlueLight/ppcfloor/bglsys
CC = mpicc
CXX = mpicxx
LD = mpicxx
CFLAGS += -DBGL
CFLAGS += -D_FILE_OFFSET_BITS=64 -Wall -D_LARGEFILE_SOURCE
endif
#
# Use the following settings for IBM compilers
# CC = /bgsys/drivers/ppcfloor/comm/bin/mpixlc
# CFLAGS = -O -qarch=450d -qtune=450
#
ifeq ($(SYSTEM), BGP)
MPI_DIR ?= /bgsys/drivers/ppcfloor/comm
CC = mpicc
CXX = mpicxx
LD = mpicxx
CPPFLAGS += -DBGP -DMPICH_IGNORE_CXX_SEEK -D_LARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64
CFLAGS += -Wall
endif
#
# Note: Add the following flags ( -fastsse -O3 ) to the CFLAGS variable
# in order to create an optimized executable.
#
# Also define USE_IOBUF=1 in order to use the io_buf library and remember
# to load the io_buf module before compiling and launching your job.
#
ifeq ($(SYSTEM), BIGBEN)
CC = cc
CXX = CC
LD = CC
CFLAGS += -DBIGBEN -target=catamount
LDFLAGS += -target=catamount
ifdef IOBUF_INC
CPPFLAGS += -I${IOBUF_INC}
endif
endif
#
# optimization flags: -fast -O
#
ifeq ($(SYSTEM), LEMIEUX)
CC = cc
CXX = cxx
LD = cxx
CFLAGS += -DPROCPERNODE=4
CFLAGS += -trapuv -check_bounds -DALPHA_TRU64UNIX_CC -DALIGNMENT
LDFLAGS += -lelan -lmpi
endif
ifeq ($(SYSTEM), MANTEO)
MPI_DIR ?= /usr/local/mpich-1.2.6
CC = $(MPI_DIR)/bin/mpicc
CXX = $(MPI_DIR)/bin/mpicxx
LD = $(MPI_DIR)/bin/mpicxx
CFLAGS += -Wall
CPPFLAGS += -DPROCPERNODE=64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
ifeq ($(SYSTEM), USCHPC)
MPI_DIR ?= /usr/usc/mpich/1.2.6..13b/gm-gnu32
CC = $(MPI_DIR)/bin/mpicxx
LD = $(MPI_DIR)/bin/mpicxx
CFLAGS += -Wall
CPPFLAGS += -DPROCPERNODE=2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
ifeq ($(SYSTEM), SCEC)
MPI_DIR ?= /opt/mpich/gnu
CC = $(MPI_DIR)/bin/mpicxx
LD = $(MPI_DIR)/bin/mpicxx
CPPFLAGS += -DPROCPERNODE=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-DSCEC
CFLAGS += -Wall
endif
#
# Add, define or override the following options in $(WORKDIR)/user.mk:
# RUN_DIR = /path/to/your/run/time/directory
# CFLAGS += -O2
# CFLAGS += -g -DDEBUG
# CFLAGS += -DPROCPERNODE=2
# CFLAGS += -DCVM_SRCPATH=\"/path/to/your/cvm/database/file\"
# CFLAGS += -DCVM_DESTDIR=\"$(RUN_DIR)/destination/directory\"
#
ifeq ($(SYSTEM), LINUX-MPICH)
MPI_DIR ?= /usr
MPI_INCLUDE ?= $(MPI_DIR)/include
CC = $(MPI_DIR)/bin/mpicc
CXX = $(MPI_DIR)/bin/mpicxx
LD = $(MPI_DIR)/bin/mpicxx
CXXFLAGS += -DMPICH_IGNORE_CXX_SEEK
CFLAGS += -Wall
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
# This is the configuration to work locally in hooke.cml.cs.cmu.edu
# Prepared by: Ricardo, 2008--2009
ifeq ($(SYSTEM), HOOKE)
MPI_INCLUDE = /usr0/local/mpich2-1.0.3/src/include/
MPI_DIR = /usr0/local/mpich2-1.0.3/
CC = $(MPI_DIR)/bin/mpicc
CXX = $(MPI_DIR)/bin/mpicxx
LD = $(MPI_DIR)/bin/mpicxx
CPPFLAGS += -DMPICH_IGNORE_CXX_SEEK
CFLAGS += -Wall
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
# Configuration for Hoffman2 Cluster at UCLA
ifeq ($(SYSTEM), Hoffman2)
CFLAGS += -g -ggdb -Wall
IO_CPPFLAGS = -DUSECVMDB -DSCEC -DPROCPERNODE=1
CC = mpicc
CXX = mpicxx
LD = mpicxx
CXXFLAGS += -DMPICH_IGNORE_CXX_SEEK
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LDFLAGS += -lgslcblas -lgsl
endif
# Configurations for Intel Macs and Arm Macs
ifeq ($(SYSTEM), darwin)
CFLAGS += -g -ggdb
IO_CPPFLAGS = -DUSECVMDB -DSCEC -DPROCPERNODE=4
ifeq ($(ARCH), arm64)
MPI_DIR = /opt/homebrew
MPI_INCLUDE = $(MPI_DIR)/include/
CC = $(MPI_DIR)/bin/mpicc
CXX = $(MPI_DIR)/bin/mpicxx
LD = $(MPI_DIR)/bin/mpicxx
CXXFLAGS += -DMPICH_IGNORE_CXX_SEEK
CFLAGS += -Wall -I$(MPI_DIR)/include/
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LDFLAGS += -L$(MPI_DIR)/lib/
else ifeq ($(ARCH), x86_64)
MPI_DIR = /usr/local/
MPI_INCLUDE = $(MPI_DIR)/include/openmpi/ompi/mpi/cxx
CC = $(MPI_DIR)/bin/mpicc
CXX = $(MPI_DIR)/bin/mpicxx
LD = $(MPI_DIR)/bin/mpicxx
CXXFLAGS += -DMPICH_IGNORE_CXX_SEEK
CFLAGS += -Wall
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LDFLAGS += /usr/local/lib/libgsl.a
endif
LDFLAGS += -lgslcblas -lgsl
endif