-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
372 lines (306 loc) · 12.4 KB
/
configure.ac
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
#
#
# Copyright (c) 2014-2020 LIPN - Universite Paris 13
# - Universite Sorbonne Paris Nord
# All rights reserved.
#
# This file is part of POSH.
#
# POSH is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# POSH 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with POSH. If not, see <http://www.gnu.org/licenses/>.
#
#
AC_INIT([POSH: Paris OpenSHMEM],[0.2],[[email protected]])
AM_INIT_AUTOMAKE([-Wall])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AM_PROG_AR
LT_INIT
AC_ENABLE_SHARED
# CHECK FOR PROGRAMS
AC_PROG_CXX
# SANITY CHECK
AC_CONFIG_SRCDIR([src/shmem.h])
AC_PREREQ([2.61]) # CC: not sure about the exact minimal number
AC_LANG([C++])
# CHECK FOR EXTERNAL LIBRARIES
LIBS="$LIBS"
# CHECK FOR FLEX (required to compile the source-to-source precompiler)
AC_PROG_LEX
if test "x$LEX" != xflex; then
LEX="$SHELL $missing_dir/missing flex"
AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
AC_SUBST([LEXLIB], [''])
fi
#################################################################################
# Boost
#################################################################################
# the hub requires Boost 1.67
# other versions are okay with older versions
AC_ARG_WITH(
[boost],
AS_HELP_STRING(
[--with-boost=FULLPATH],
[set full path to your Boost installation]
),
[BOOSTPATH="$withval"]
)
if test -n "$BOOSTPATH"; then
AC_MSG_CHECKING([user-supplied Boost installation])
CPPFLAGS="-I${BOOSTPATH}/include ${CPPFLAGS} -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_ERROR_CODE_HEADER_ONLY"
# CPPFLAGS="-I${BOOSTPATH}/include ${CPPFLAGS} -DBOOST_SYSTEM_NO_DEPRECATED "
# CPPFLAGS="-I${BOOSTPATH}/include ${CPPFLAGS} -DBOOST_ERROR_CODE_HEADER_ONLY"
# CPPFLAGS="-I${BOOSTPATH}/include ${CPPFLAGS} "
LDFLAGS="-L${BOOSTPATH}/lib ${LDFLAGS}"
fi
# TODO not always necessary
ACX_MPI([], [AC_MSG_ERROR([Cannot find an MPI C++ compiler wrapper.])])
CXX="$MPICXX"
CXXCPP="$CXX -E"
#AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([boost/interprocess/managed_shared_memory.hpp], [],
[AC_MSG_ERROR(You need the Boost Interprocess libraries.)])
AC_CHECK_HEADERS([boost/thread.hpp], [],
[AC_MSG_ERROR(You need the Boost Thread libraries.)])
AC_CHECK_HEADERS([boost/bind.hpp], [],
[AC_MSG_ERROR(You need the Boost Bind libraries.)])
AC_CHECK_HEADERS([boost/system/error_code.hpp], [],
[AC_MSG_ERROR(You need the Boost System libraries.)])
AC_CHECK_HEADERS([boost/mpi.hpp], [],
[AC_MSG_ERROR(You need the Boost MPI libraries.)])
#AC_LANG_POP([C++])
AX_PTHREAD([], [AC_MSG_ERROR([Missing pthread library])])
# Check only boost_thread, assume optimistically that the other ones will be with it
AX_CXX_CHECK_LIB(boost_thread, boost::thread, [], [
AX_CXX_CHECK_LIB(boost_thread-mt, boost::thread, [], [
echo "Error: POSH needs some Boost libraries: boost_thread or boost_thread-mt, boost_system and boost_program_options. Check the path with --with-boost"
exit -1
])
])
CPPFLAGS=" ${CPPFLAGS} -Wall -Wno-unused-variable -Wno-deprecated-declarations -fPIC -D_GNU_SOURCE -Wno-unused-function -Wno-deprecated-register"
LDFLAGS=" ${LDFLAGS} -lboost_system -lpthread -lboost_program_options "
#################################################################################
# flex
#################################################################################
#AC_CHECK_PROG([FLEX], [flex lex], [flex])
#AM_MISSING_PROG([FLEX], [$FLEX])
AC_PROG_LEX
# gnu++11
AX_CXX_COMPILE_STDCXX_11
CPPFLAGS="${CPPFLAGS} -std=gnu++11 "
#################################################################################
# DEBUGGING MODE
#################################################################################
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging, default: no]),
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],
[debug=false])
if test $debug = true ; then
CPPFLAGS="-O0 -g -D_DEBUG ${CPPFLAGS}"
LDFLAGS="-g -Wall -O0 ${LDFLAGS}"
else
CPPFLAGS=" ${CPPFLAGS}"
LDFLAGS=" ${LDFLAGS}"
fi
#################################################################################
# SAFE MODE
#################################################################################
AC_ARG_ENABLE(safe,
AS_HELP_STRING([--enable-safe],
[enable safe mode, default: no]),
[case "${enableval}" in
yes) safe=true ;;
no) safe=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-safe]) ;;
esac],
[safe=false])
if test $safe = true ; then
CPPFLAGS="-D_SAFE ${CPPFLAGS} "
fi
#################################################################################
# WHICH RTE
#################################################################################
## TODO disable it
AC_ARG_ENABLE([launcher-local],
AS_HELP_STRING([--enable-launcher-local], [Enable local, single-node launcher [default=yes]]),
[ AM_CONDITIONAL(ENABLE_LAUNCHERLOCAL, true)
CPPFLAGS+=" -DENABLE_LAUNCHER_LOCAL "],
[ AM_CONDITIONAL(ENABLE_LAUNCHERLOCAL, true) ] )
AC_ARG_ENABLE([launcher-mpi],
AS_HELP_STRING([--enable-launcher-mpi], [Enable MPI launcher [default=disabled]]),
[ AM_CONDITIONAL(ENABLE_LAUNCHERMPI, true)
CPPFLAGS+="-DMPILAUNCHER -DDISTRIBUTED_POSH "
ACX_MPI( [ CC=mpicc ; CXX=mpic++ ; LD=mpic++ ; LDFLAGS=" ${LDFLAGS} -lboost_mpi "
],
[ AC_MSG_FAILURE( MPI is required ) ] )
],
[ AM_CONDITIONAL(ENABLE_LAUNCHERMPI, false) ] )
# TODO check the presence of PadicoTM
AC_ARG_ENABLE([launcher-padico],
AS_HELP_STRING([--enable-launcher-padico], [Enable PadicoTM launcher [default=disabled]]),
[ AM_CONDITIONAL(ENABLE_LAUNCHERPADICO, true)
CPPFLAGS+="-DPADICOLAUNCHER -DDISTRIBUTED_POSH "
],
[ AM_CONDITIONAL(ENABLE_LAUNCHERPADICO, false) ] )
AC_ARG_ENABLE([launcher-gaspi],
AS_HELP_STRING([--enable-launcher-gaspi], [Enable gaspi launcher [default=disabled]]),
[ AM_CONDITIONAL(ENABLE_LAUNCHERGASPI, true)
CPPFLAGS+="-DGASPILAUNCHER -DDISTRIBUTED_POSH "
],
[ AM_CONDITIONAL(ENABLE_LAUNCHERGASPI, false) ] )
#################################################################################
# CHOICE OF MEMCPY
#################################################################################
MEMCPYTYPE=_USE_MEMCPY_ # Default
AC_ARG_WITH([memcpy],
AS_HELP_STRING([--without-memcpy], [Use default memcpy implementation (stock memcpy() )]))
AC_ARG_WITH(
memcpy,
AS_HELP_STRING(
[--with-memcpy=MEMCPY-TYPE],
[Use memcpy implementation: memcpy, kernel, vectorized, ptrvec, SSE, MMX or MMX2 ]
),
[ memcpy="$withval" ]
)
AS_IF( [test "x$memcpy" = "xmemcpy"],
[ MEMCPYTYPE=_USE_MEMCPY_ ])
AS_IF( [test "x$memcpy" = "xvectorized"],
[ MEMCPYTYPE=_USE_VECTOR_COPY_ ])
AS_IF( [test "x$memcpy" = "xptrvec"],
[ MEMCPYTYPE=_USE_PTR_VEC_COPY_ ])
AS_IF( [test "x$memcpy" = "xkernel"],
[ MEMCPYTYPE=_USE_KER_COPY_ ])
AS_IF( [test "x$memcpy" = "xsse"],
[ MEMCPYTYPE=_USE_SSE_COPY_ ])
AS_IF( [test "x$memcpy" = "xmmx"],
[ MEMCPYTYPE=_USE_MMX_COPY_ ])
AS_IF( [test "x$memcpy" = "xmmx2"],
[ MEMCPYTYPE=_USE_MMX2_COPY_ ])
CPPFLAGS=" -D${MEMCPYTYPE} ${CPPFLAGS} "
#################################################################################
# CHOICE OF COMMUNICATION CHANNEL
#################################################################################
# TODO
# verifier que les dependances sont la
# verifier qu'on n'a pas d'incoherence entre RTE et comm channel
#AC_ARG_ENABLE([commsm],
# AS_HELP_STRING([--enable-sm-comm], [Enable local shared memory communications (strongly recommanded) [default=yes]]),
# [],
# [enable_commsm=yes] )
AC_ARG_ENABLE([knem-comm],
AS_HELP_STRING([--enable-knem-comm], [Enable local KNEM communications [default=no]]),
[ AM_CONDITIONAL(ENABLE_COMM_KNEM, true)
CPPFLAGS+=" -D_WITH_KNEM "],
[ AM_CONDITIONAL(ENABLE_COMM_KNEM, false) ] )
AC_ARG_WITH(
[knem],
AS_HELP_STRING(
[--with-knem=FULLPATH],
[set full path to your KNEM installation]
),
[KNEMPATH="$withval"]
)
if test -n "$KNEMPATH"; then
AC_MSG_CHECKING([user-supplied KNEM installation])
CPPFLAGS="-I${KNEMPATH}/include ${CPPFLAGS}"
LDFLAGS="-L${KNEMPATH}/lib ${LDFLAGS}"
fi
AC_ARG_ENABLE([tcp-comm],
AS_HELP_STRING([--enable-tcp-comm], [Enable TCP communications (slow) [default=no]]),
[ AM_CONDITIONAL(ENABLE_COMM_TCP, true)
CPPFLAGS+=" -DDISTRIBUTED_POSH -D_WITH_TCP "],
[ AM_CONDITIONAL(ENABLE_COMM_TCP, false) ] )
AC_ARG_ENABLE([mpi-comm],
AS_HELP_STRING([--enable-mpi-comm], [Enable MPI communications [default=no]]),
[ AM_CONDITIONAL(ENABLE_COMM_MPI, true)
CPPFLAGS+=" -DMPICHANNEL -DDISTRIBUTED_POSH "
ACX_MPI( [ CC=mpicc ; CXX=mpic++ ; LD=mpic++ ; LDFLAGS=" ${LDFLAGS} -lboost_mpi " ],
[ AC_MSG_FAILURE( MPI is required ) ] )
],
[ AM_CONDITIONAL(ENABLE_COMM_MPI, false) ] )
AC_ARG_ENABLE([nmad-comm],
AS_HELP_STRING([--enable-nmad-comm], [Enable NewMadeleine communications [default=no]]),
[ AM_CONDITIONAL(ENABLE_COMM_NMAD, true)
CPPFLAGS+="-DNMADCHANNEL `pkg-config --cflags nmad` -D_WITH_NMAD -DDISTRIBUTED_POSH "
LDFLAGS += `pkg-config --libs nmad` ],
[ AM_CONDITIONAL(ENABLE_COMM_NMAD, false) ] )
AC_ARG_ENABLE([mpi-hub],
AS_HELP_STRING([--enable-mpi-hub], [Enable hub communications using MPI [default=no]]),
[ AM_CONDITIONAL(ENABLE_COMM_HUB_MPI, true)
CPPFLAGS+=" -DMPIHUBCHANNEL -DDISTRIBUTED_POSH "
ACX_MPI( [ CC=mpicc ; CXX=mpic++ ; LD=mpic++ ; LDFLAGS=" ${LDFLAGS} -lboost_mpi -lrt "],
[ AC_MSG_FAILURE( MPI is required ) ] )
],
AM_CONDITIONAL([ENABLE_COMM_HUB_MPI], false))
AC_ARG_ENABLE([gaspi-comm],
AS_HELP_STRING([--enable-gaspi-comm], [Enable GASPI communications [default=no]]),
[ AM_CONDITIONAL(ENABLE_COMM_GASPI, true)
CPPFLAGS+=" -DDISTRIBUTED_POSH -D_WITH_GASPI "],
[ AM_CONDITIONAL(ENABLE_COMM_GASPI, false) ] )
#################################################################################
# CHOICE OF COLLECTIVE COMMUNICATIONS
#################################################################################
COLLTYPE=SHMEM_COLL_BINARY # Default
AC_ARG_WITH([collective],
AS_HELP_STRING([--without-collective], [Use default collective communication algorithms]))
AC_ARG_WITH(
collective,
AS_HELP_STRING(
[--with-collective=COLL_TYPE],
[Use collective communication algorithms: flat or binary]
),
[ colltype="$withval" ]
)
AS_IF( [test "x$colltype" = "xbinary"],
[ COLLTYPE=SHMEM_COLL_BINARY ])
AS_IF( [test "x$colltype" = "xflat"],
[ COLLTYPE=SHMEM_COLL_FLAT ] )
CPPFLAGS=" -D${COLLTYPE} ${CPPFLAGS} "
#################################################################################
# FAULT TOLERANCE
#################################################################################
# TODO: path to the checkpointing library
AC_ARG_WITH(
faulttolerance,
AS_HELP_STRING(
[--with-faulttolerance=ALGORITHM],
[Use fault tolerance: Chandy-Lamport (ALGORITHM=marker), blocking with a double barrier (ALGORITHM=doublebarrier)]
),
[ faulttolerance="$withval" ]
)
AM_CONDITIONAL(ENABLE_FT, false)
AS_IF( [test "x$faulttolerance" = "xmarker"],[ CPPFLAGS+=" -DCHANDYLAMPORT -DCL_MARKER " ],
[test "x$faulttolerance" = "xmarker"],[ AM_CONDITIONAL(ENABLE_FT, true) ])
AS_IF( [test "x$faulttolerance" = "xdoublebarrier"],[ AM_CONDITIONAL(ENABLE_FT, true) ])
AS_IF( [test "x$faulttolerance" = "xdoublebarrier"],[ CPPFLAGS+=" -DCHANDYLAMPORT -DCL_DOUBLEBARRIER " ] )
AX_DMTCP_HOME([])
#################################################################################
# PERFORMANCE PROFILING
#################################################################################
# TODO
#################################################################################
# END
#################################################################################
AC_PROG_INSTALL
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/hub_mpi/Makefile
])
AC_OUTPUT