forked from nerscadmin/IPM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
361 lines (313 loc) · 8.96 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
AC_INIT([ipm], [2.0.6], [ipm-dev@nersc.gov])
AC_CONFIG_SRCDIR([src/ipm_core.c])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([no-dependencies])
AC_CONFIG_MACRO_DIR([m4])
sinclude(ax_mpi.m4)
sinclude(ipm_underscore.m4)
sinclude(ipm_mpistatuscount.m4)
sinclude(ipm_hostdetection.m4)
dnl CRAY is not the default
CRAY=0
AX_IPM_HOSTDETECTION
dnl AC_PROG_CC
AC_PROG_CXX
dnl AC_PROG_F77
dnl AC_PROG_FC
if test "x$MPICC" == "x"; then
AC_LANG([C])
AX_MPI
AC_LANG([Fortran 77])
AX_MPI
AC_LANG([Fortran])
AX_MPI
AC_LANG([C])
fi
AM_PROG_CC_C_O
AC_CONFIG_HEADERS(config.h)
AX_IPM_UNDERSCORE
AX_IPM_MPISTATUSCOUNT
if test "x$CRAY" = "x0"; then
CC=$MPICC
F77=$MPIF77
FC=$MPIFC
AC_CHECK_HEADERS([dlfcn.h],
[
CFLAGS="$CFLAGS -DHAVE_DYNLOAD"
],
[], [])
need_c2f_macros=no
AC_CHECK_FUNC(MPI_Status_c2f, [], [need_c2f_macros=yes])
AC_CHECK_FUNC(MPI_Status_f2c, [], [need_c2f_macros=yes])
if test "x$need_c2f_macros" == "xyes"; then
CFLAGS="$CFLAGS -DNEED_C2F_MACROS"
fi
else
AC_DEFINE(HAVE_DLFCN_H, 0)
fi
AC_PROG_INSTALL
AC_PROG_LIBTOOL
# defining the enabled modules
enable_mod_mpi=yes
enable_mod_posixio=no
enable_mod_mpiio=no
enable_mod_self_monitor=no
enable_mod_mem=no
enable_mod_callpath=no
enable_mod_procctrl=no
enable_mod_keyhist=no
enable_mod_omptracepoints=no
enable_mod_clustering=no
enable_mod_cuda=no
enable_mod_cublas=no
enable_mod_cufft=no
AC_ARG_ENABLE(mpi,
AC_HELP_STRING([--disable-mpi], [disable mpi module]),
[
AS_IF([test "x$enableval" = "xno"],
[enable_mod_mpi=no])
],
[ enable_mod_mpi=yes ]
)
AC_ARG_ENABLE(posixio,
AC_HELP_STRING([--enable-posixio], [enabled posixio module (default=no)]),
[
AS_IF([test "x$enableval" = "xyes"],
[enable_mod_posixio=yes])
],
[ enable_mod_posixio=no ]
)
have_cudainc=no
AC_ARG_WITH(cudapath,
[ --with-cudapath=<path> to cuda installation.],
[
if test -d "$withval"; then
CFLAGS="$CFLAGS -I$withval/include"
have_cudainc=yes
else
if test "x$withval" == "xyes"; then
echo "cuda path is empty."
else
echo "cuda was not found in $withval."
fi
exit 1
fi
report_experimental=yes
],
[
have_cudainc=no
]
)
report_experimental=no
AC_ARG_ENABLE(experimental,
AC_HELP_STRING(
[--enable-experimental=MODULE-LIST],
[commas-separated list of IPMv2 modules to enable]),
[
report_experimental=yes
enableval=`echo $enableval | sed s/\,/\ /g`
for i in $enableval; do
if test "$i" = "papi"; then
echo "to enable papi use --with-papi=<path>"
exit 1
elif test "$i" = "all"; then
# enable_mod_mpi=yes
enable_mod_posixio=yes
enable_mod_mpiio=yes
enable_mod_self_monitor=yes
# enable_mod_mem=yes
# enable_mod_callpath=yes
# enable_mod_procctrl=yes
# enable_mod_keyhist=yes
enable_mod_omptracepoints=yes
# enable_mod_clustering=yes
enable_mod_cuda=yes
enable_mod_cublas=yes
enable_mod_cufft=yes
else
dnl i=`echo $i | sed 's/-/_/g'`
eval "enable_mod_$i=yes"
fi
if test "$enable_mod_cuda" = "yes" -o "$enable_mod_cublas" = "yes" -o "$enable_mod_cufft" = "yes" ;
then
if test "$have_cudainc" = "no";
then
echo "you need to set the path to cuda via --with-cudapath"
exit 1
fi
fi
done
])
AC_ARG_ENABLE(coll-details,
AC_HELP_STRING(
[--enable-coll-details],
[Enable detailed monitoring of collective operations (experimental)]),
[CFLAGS="$CFLAGS -DIPM_COLLECTIVE_DETAILS=1"],
[])
AC_ARG_WITH(papi,
[ --with-papi=<path> to PAPI installation.],
[
if test -d "$withval"; then
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib -Wl,-rpath=$withval/lib"
LIBS="$LIBS -lpapi"
echo "papi: $withval"
enable_mod_papi=yes
else
if test "x$withval" == "xyes"; then
echo "no path to papi given."
else
echo "papi not found in $withval."
fi
exit 1
fi
],
[
enable_mod_papi=no
]
)
report_libunwind=no
AC_ARG_WITH(libunwind,
[ --with-libunwind=<path> to libunwind installation.],
[
report_libunwind=yes
if test -d "$withval"; then
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
LIBS="$LIBS -lunwind"
echo "libunwind: $withval"
have_libunwind=yes
else
if test "x$withval" == "xyes"; then
echo "no path to libunwind given."
else
echo "libunwind not found in $withval."
fi
exit 1
fi
],
[
have_libunwind=no
]
)
AM_CONDITIONAL([ENABLE_MPI], [test "$enable_mod_mpi" = yes])
AM_CONDITIONAL([ENABLE_SELF_MONITORING], [test "$enable_mod_self_monitor" = yes])
AM_CONDITIONAL([ENABLE_MPIIO], [test "$enable_mod_mpiio" = yes])
AM_CONDITIONAL([ENABLE_MEM], [test "$enable_mod_mem" = yes])
AM_CONDITIONAL([ENABLE_POSIXIO], [test "$enable_mod_posixio" = yes])
AM_CONDITIONAL([ENABLE_CALLPATH], [test "$enable_mod_callpath" = yes])
AM_CONDITIONAL([ENABLE_PAPI], [test "$enable_mod_papi" = yes])
AM_CONDITIONAL([ENABLE_KEYHIST], [test "$enable_mod_keyhist" = yes])
AM_CONDITIONAL([ENABLE_PROCCTRL], [test "$enable_mod_procctrl" = yes])
AM_CONDITIONAL([ENABLE_OMPTRACEPOINTS], [test "$enable_mod_omptracepoints" = yes])
AM_CONDITIONAL([ENABLE_CLUSTERING], [test "$enable_mod_clustering" = yes])
AM_CONDITIONAL([ENABLE_CUDA], [test "$enable_mod_cuda" = yes])
AM_CONDITIONAL([ENABLE_CUBLAS], [test "$enable_mod_cublas" = yes])
AM_CONDITIONAL([ENABLE_CUFFT], [test "$enable_mod_cufft" = yes])
if test "x$target_os" == "xlinux-gnu"; then
CFLAGS+=" -DOS_LINUX"
fi
enable_ipm_parser=no
AC_ARG_ENABLE(parser,
AC_HELP_STRING(
[--enable-parser],
[Enables building the ipm parser.])
,
[
AS_IF([test "x$enable_parser" = "xyes"], [
enable_ipm_parser=yes
AC_CHECK_LIB(mxml, mxmlElementGetAttr, [],
[
echo "To compile ipm_parse you need to have libmxml installed."
exit 1
])
if test ! -f "utils/cubew/lib/libcubew3.a"; then
echo "trying to build libcubew3 in utils/cubew/lib for you"
make -C utils/cubew/lib
fi
if test ! -f "utils/cubew/lib/libcubew3.a"; then
echo "bilding libcubew3 in utils/cubew/lib failed!"
exit 1
fi
]
)
]
,
[:] dnl not given
)
AM_CONDITIONAL([ENABLE_PARSER], [test "$enable_ipm_parser" = yes])
AC_CONFIG_FILES([
Makefile
bin/Makefile
etc/Makefile
src/Makefile
utils/Makefile
test/Makefile
test/test.allgather/Makefile
test/test.allgatherv/Makefile
test/test.allreduce/Makefile
test/test.alltoall/Makefile
test/test.alltoallv/Makefile
test/test.bcast/Makefile
test/test.fhello/Makefile
test/test.forever/Makefile
test/test.fork/Makefile
test/test.fring/Makefile
test/test.gather/Makefile
test/test.gatherv/Makefile
test/test.hello/Makefile
test/test.jacobi/Makefile
test/test.keyhist/Makefile
test/test.omp/Makefile
test/test.pcontrol/Makefile
test/test.posixio-helloworld/Makefile
test/test.posixio-read/Makefile
test/test.simple_mpi/Makefile
test/test.status_ignore/Makefile
])
AC_CONFIG_FILES([bin/make_wrappers], [chmod +x bin/make_wrappers])
dnl test/test.pomp-standalone/Makefile
AC_OUTPUT
echo "################################################"
echo " IPM configuration:"
echo " MPI profiling enabled : $enable_mod_mpi"
echo " POSIX-I/O profiling enabled : $enable_mod_posixio"
echo " PAPI enabled : $enable_mod_papi"
if test "x$report_experimental" == "xyes"; then
echo " Self monitoring enabled : $enable_mod_self_monitor"
echo " MPIIO (C only) enabled : $enable_mod_mpiio"
#echo " MEM enabled : $enable_mod_mem"
#echo " CALLPATH enabled : $enable_mod_callpath"
#echo " keyhist enabled : $enable_mod_keyhist"
#echo " procctrl enabled : $enable_mod_procctrl"
echo " OpenMP (PGI/Cray) enabled : $enable_mod_omptracepoints"
#echo " clustering enabled : $enable_mod_clustering"
echo " CUDA profiling enabled : $enable_mod_cuda"
echo " CUBLAS profiling enabled : $enable_mod_cublas"
echo " CUFFT profiling enabled : $enable_mod_cufft"
fi
if test "x$report_libunwind" == "xyes"; then
echo " use libunwind : $have_libunwind"
fi
echo " CFLAGS : $CFLAGS"
echo " LDFLAGS : $LDFLAGS"
echo " LIBS : $LIBS"
echo " MPI_STATUS_COUNT : $IPM_MPISTATUSCOUNT"
echo " Fortran underscore : $IPM_FUNDERSCORE"
echo " Building IPM Parser : $enable_ipm_parser"
echo ""
warn=yes
check="$enable_mod_mpi $enable_mod_posixio $enable_mod_papi $enable_mod_cuda $enable_mod_cufft $enable_mod_cublas $report_experimental"
for mod in $check
do
if test "x$mod" = "xyes"; then
warn=no
fi
done
if test "x$warn" = "xyes"; then
echo ""
echo "################################################"
echo " !! WARNING !!"
echo " No module of IPM has been enabled!"
echo "################################################"
fi