-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathconfigure.ac.in
261 lines (227 loc) · 7.22 KB
/
configure.ac.in
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
# TITLE MACRO
define(TITLE,
[
echo ' $1 ' | sed -e's/./-/g' >&AS_MESSAGE_FD
echo ' $1' >& AS_MESSAGE_FD
echo ' $1 ' | sed -e's/./-/g' >&AS_MESSAGE_FD
])
# INITS
AC_PREREQ([2.63])
AC_INIT([GPI-2], [1.5.1], [https://github.com/cc-hpc-itwm/GPI-2/issues])
AC_CONFIG_SRCDIR([src/GPI2.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_HEADERS([config.h])
# CONFIG DEFAULTS
export CONFIG_SITE=$srcdir/config.site
source ${CONFIG_SITE}
# OVERWRITE LIBTOOL FLAGS
if test -z "${CFLAGS}"; then
CFLAGS=
fi
if test -z "${FCFLAGS}"; then
FCFLAGS=
fi
if test -z "${CXXFLAGS}"; then
CXXFLAGS=
fi
TITLE([Checking for C, standard headers and libs])
# AUTOMAKE
AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_FILES([Makefile
src/Makefile
src/GPI2.pc
tests/Makefile
tests/tests/Makefile
tests/tests/atomic/Makefile
tests/tests/cm/Makefile
tests/tests/collectives/Makefile
tests/tests/comm/Makefile
tests/tests/config/Makefile
tests/tests/error_vec/Makefile
tests/tests/extensions/Makefile
tests/tests/fortran/Makefile
tests/tests/groups/Makefile
tests/tests/init/Makefile
tests/tests/lists/Makefile
tests/tests/mpi/Makefile
tests/tests/notifications/Makefile
tests/tests/passive/Makefile
tests/tests/segments/Makefile
tests/tests/utils/Makefile
tests/microbenchmarks/Makefile
tutorial/code/Makefile
])
AM_INIT_AUTOMAKE([foreign nostdinc AUTOMAKE_SUBDIRS])
# LIBTOOL
LT_PREREQ([2.2])
LT_INIT()
# CHECKS FOR PROGRAMS.
TITLE([Checking for other used headers and libs, typedefs, structures and compiler characteristics])
ACX_C
AM_PROG_CC_C_O
AC_PROG_AWK
AC_PROG_SED
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# CHECKS FOR LIBRARIES.
AC_CHECK_LIB([m], [sqrt])
# CHECKS FOR HEADER FILES.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h unistd.h sys/signal.h])
# CHECKS FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# CHECKS FOR LIBRARY FUNCTIONS.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([ftime ftruncate gethostbyname gethostname gettimeofday inet_ntoa memmove memset pow select socket sqrt strerror strtol uname mktemp])
# DEFAULT INFOS
options=
gpilibs=" standard"
batchsys=" PBS"
# MPI
AC_ARG_WITH(mpi_extra_flags,[AS_HELP_STRING([--with-mpi-extra-flags],[add MPI fine tuning])],
[with_mpi_extra_flags=$withval],
[with_mpi_extra_flags=no])
if test "x$with_mpi_extra_flags" != xno; then
AC_SUBST([mpi_extra_flags],[$with_mpi_extra_flags])
fi
AC_ARG_WITH(mpi,[AS_HELP_STRING([--with-mpi],[compile with MPI support])],
[with_mpi=$withval],
[with_mpi=no])
if test "x$with_mpi" != xno; then
TITLE([Checking for MPI])
ACX_MPI
fi
AM_CONDITIONAL([WITH_MPI],[test x${HAVE_MPI} = x1])
if test x${HAVE_MPI} = x1; then
if test "x$with_mpi_extra_flags" != xno; then
options="$options MPI with flags $with_mpi_extra_flags"
else
options="$options MPI"
fi
fi
# FORTRAN
AC_ARG_WITH([fortran],[AS_HELP_STRING([--with-fortran], [compile Fortran modules (default)])],
[with_fortran=$withval],
[with_fortran=yes])
if test "x$with_fortran" == xyes; then
TITLE([Checking for Fortran])
AC_PROG_FC
ACX_FORTRAN
fi
AM_CONDITIONAL([WITH_FORTRAN],[test x${HAVE_FORTRAN} = x1])
if test x${HAVE_FORTRAN} = x1; then
options="$options Fortran"
fi
# CHECKS INFINIBAND
AC_ARG_WITH([infiniband],[AS_HELP_STRING([--with-infiniband], [compile for infiniband (default)])],
[with_infiniband=$withval],
[with_infiniband=no])
AC_ARG_ENABLE([infiniband-ext],[AS_HELP_STRING([--enable-infiniband-ext],[build/install with Infiniband Extensions])],
[infiniband_ext=$enableval],
[infiniband_ext=no])
# CHECKS ETHERNET
AC_ARG_WITH([ethernet],[AS_HELP_STRING([--with-ethernet], [compile for ethernet])],
[with_ethernet=$withval],
[with_ethernet=no])
# WHAT DEVICE IS REALLY USABLE
ACX_USABLE_DEVICE
# BATCH SYSTEM
# PBS
AC_ARG_WITH(pbs,[AS_HELP_STRING([--with-pbs],[compile with PBS support])],
[with_pbs=$withval],
[with_pbs=no])
# LOADLEVELER
AC_ARG_WITH(loadleveler,[AS_HELP_STRING([--with-loadleveler],[compile with LoadLeveler support])],
[with_loadleveler=$withval],
[with_loadleveler=no])
# SLURM
AC_ARG_WITH(slurm,[AS_HELP_STRING([--with-slurm],[compile with Slurm support])],
[with_slurm=$withval],
[with_slurm=no])
if test $with_pbs = yes -a $with_loadleveler = yes -a $with_slurm = yes; then
AC_MSG_ERROR([Only one batch system is supported])
elif test $with_pbs = yes -a $with_loadleveler = yes -a $with_slurm = no; then
AC_MSG_ERROR([Only one batch system is supported])
elif test $with_pbs = yes -a $with_loadleveler = no -a $with_slurm = yes; then
AC_MSG_ERROR([Only one batch system is supported])
elif test $with_pbs = no -a $with_loadleveler = yes -a $with_slurm = yes; then
AC_MSG_ERROR([Only one batch system is supported])
elif test $with_pbs = yes; then
batchsys=" PBS"
elif test $with_loadleveler = yes; then
batchsys=" LoadLeveler"
elif test $with_slurm = yes; then
batchsys=" Slurm"
else
batchsys=" PBS"
fi
AM_CONDITIONAL([WITH_LOADLEVELER],[test $with_loadleveler = yes])
AM_CONDITIONAL([WITH_SLURM],[test $with_slurm = yes])
# BUILD DEBUG LIBRARY
AC_ARG_ENABLE([debug-lib],[AS_HELP_STRING([--disable-debug-lib],[do not build/install debug library (required by the tests)])],
[build_debug_lib=$enableval],
[build_debug_lib=yes])
AM_CONDITIONAL([ENABLE_DEBUG],[test $build_debug_lib = yes])
if test $build_debug_lib = yes; then
gpilibs="$gpilibs debugging"
fi
# BUILD STAT LIBRARY
AC_ARG_ENABLE([stat-lib],[AS_HELP_STRING([--disable-stat-lib], [do not build/install statistic library])],
[build_stat_lib=$enableval],
[build_stat_lib=yes])
AM_CONDITIONAL([ENABLE_STAT],[test $build_stat_lib = yes])
if test $build_stat_lib = yes; then
gpilibs="$gpilibs statistics"
fi
# DOXYGEN
TITLE([Checking for Doxygen])
AC_CHECK_PROGS([DOXYGEN],[doxygen])
if test -z "$DOXYGEN"; then
AC_MSG_WARN([Doxygen not found])
fi
AC_CHECK_PROGS([DOT],[dot])
if test -z "$DOT"; then
AC_MSG_WARN([Dot not found])
fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN" -a -n "$DOT"])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([docs/Doxyfile])])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([docs/Makefile])])
# PRINT INFO
TITLE([Configuration setup])
echo "Options:" >& AS_MESSAGE_FD
echo "$options" >& AS_MESSAGE_FD
echo "Target GPI libs:" >& AS_MESSAGE_FD
echo "$gpilibs" >& AS_MESSAGE_FD
if test $build_debug_lib = no; then
AC_MSG_WARN([Debug library is required for testing])
fi
if test "$enable_shared" = "yes"; then
library_dir=$prefix/lib64
if test "$prefix" = "NONE"; then
library_dir="/usr/local/lib64"
fi
echo " please add $library_dir to LD_LIBRARY_PATH" >& AS_MESSAGE_FD
fi
echo "Batch system:" >& AS_MESSAGE_FD
echo "$batchsys" >& AS_MESSAGE_FD
echo "Doxygen documentation target:" >& AS_MESSAGE_FD
if test -n "$DOXYGEN" -a -n "$DOT"; then
echo " Available" >& AS_MESSAGE_FD
else
echo " Not available" >& AS_MESSAGE_FD
fi
AC_CANONICAL_HOST
echo "Host CPU architecture:" >& AS_MESSAGE_FD
echo " $host_cpu" >& AS_MESSAGE_FD
echo >& AS_MESSAGE_FD
AC_OUTPUT