forked from LLNL/UnifyFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
executable file
·373 lines (320 loc) · 10.2 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
372
373
dnl
dnl This file is a part of UnifyFS. Please see LICENSE for the license
dnl information.
dnl Process this file with autoconf to produce a configure script.
AC_INIT([unifyfs],
m4_esyscmd([git describe --always |
awk '/.*/{sub(/^v/,""); printf "%s",$1; exit}']),
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign tar-pax subdir-objects])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([disable])
LT_INIT
AC_PROG_CC_STDC
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# fortran support
AC_ARG_ENABLE([fortran],
AC_HELP_STRING([--enable-fortran],
[Enable fortran compatibility and features]))
AC_MSG_CHECKING(if fortran is wanted )
if test "x$enable_fortran" = "xyes"; then
AC_MSG_RESULT(yes)
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
AC_FC_DUMMY_MAIN
AM_CONDITIONAL([HAVE_FORTRAN], [true])
else
AC_MSG_RESULT(no)
AM_CONDITIONAL([HAVE_FORTRAN], [false])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_STRUCT_ST_BLOCKS
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_CHECK_TYPES([ptrdiff_t])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h sys/socket.h sys/time.h])
AC_CHECK_HEADERS([unistd.h arpa/inet.h inttypes.h netdb.h netinet/in.h])
AC_CHECK_HEADERS([stddef.h stdint.h libgen.h strings.h syslog.h])
AC_CHECK_HEADERS([inttypes.h wchar.h wctype.h])
AC_CHECK_HEADER([openssl/md5.h], [], [AC_MSG_FAILURE([
*** openssl/md5.h missing, openssl-devel package required])])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([ftruncate getpagesize gettimeofday memset socket floor])
AC_CHECK_FUNCS([gethostbyname strcasecmp strdup strerror strncasecmp strrchr])
AC_CHECK_FUNCS([gethostname strstr strtoumax strtol uname posix_fallocate])
# PMPI Init/Fini mount/unmount option
AC_ARG_ENABLE([mpi-mount],
AC_HELP_STRING([--enable-mpi-mount],
[Enable transparent mount/unmount at MPI_Init/Finalize.]))
if test "x$enable_mpi_mount" = "xyes"; then
AM_CONDITIONAL([USE_PMPI_WRAPPERS], [true])
else
AM_CONDITIONAL([USE_PMPI_WRAPPERS], [false])
fi
# PMIx support build option
AC_ARG_ENABLE([pmix],
AC_HELP_STRING([--enable-pmix],
[Enable PMIx build options.]))
if test "x$enable_pmix" = "xyes"; then
AC_CHECK_HEADERS([pmix.h],
[AM_CONDITIONAL([USE_PMIX], [true])],
[AM_CONDITIONAL([USE_PMIX], [false])])
else
AM_CONDITIONAL([USE_PMIX], [false])
fi
# PMI2 support build option
AC_ARG_ENABLE([pmi],
AC_HELP_STRING([--enable-pmi],
[Enable PMI2 build options.]))
if test "x$enable_pmi" = "xyes"; then
AC_CHECK_HEADERS([pmi2.h],
[AM_CONDITIONAL([USE_PMI2], [true])],
[AM_CONDITIONAL([USE_PMI2], [false])])
else
AM_CONDITIONAL([USE_PMI2], [false])
fi
CHECK_NUMA
AC_ARG_WITH(pkgconfigdir,
[ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
[pkgconfigdir=$withval],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST(pkgconfigdir)
## unifyfs options
AC_ARG_ENABLE(cuserid,
[ --disable-cuserid Disables attempted use of cuserid() at run time],
[if test "x$enableval" = "xno" ; then
AC_DEFINE(CRUISE_DISABLE_CUSERID, 1, Define if cuserid() should be disabled),
fi]
,)
AC_ARG_ENABLE(ld-preload,
[ --disable-ld-preload Disables support for LD_PRELOAD library],
[if test "x$enableval" = "xno" ; then
DISABLE_LDPRELOAD="1"
fi]
,)
AC_ARG_ENABLE(st-dev-workaround,
[ --enable-st-dev-workaround Gather device id from parent directory instead of file],
[if test "x$enableval" = "xyes" ; then
AC_DEFINE(__CP_ST_DEV_WORKAROUND, 1, Define if device id should be taken from parent directory rather than file)
DISABLE_LDPRELOAD="1"
fi]
,)
# checks to see how we can print 64 bit values on this architecture
gt_INTTYPES_PRI
dnl Check byte ordering
AC_C_BIGENDIAN
dnl temporarily set large file flags just for this test; we don't want
dnl it to propagate to the makefile because of zlib bugs
AC_MSG_CHECKING(for off64_t)
AC_TRY_COMPILE(
[
#define _FILE_OFFSET_BITS 64
#define _LARGEFILE64_SOURCE
#include <sys/types.h>
],
[ off64_t off; ],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_OFF64_T, 1, Define if off64_t type is defined),
AC_MSG_RESULT(no)
)
AC_CHECK_HEADERS(mntent.h sys/mount.h)
# look for MPI and set flags
LX_FIND_MPI
if test "x$enable_fortran" = "xyes"; then
AC_LANG_PUSH([Fortran])
LX_FIND_MPI
AC_LANG_POP
fi
if test "$have_C_mpi" != "yes" ; then
AC_MSG_ERROR(["Couldn't find MPI"])
fi
# look for leveldb library, sets LEVELDB_CFLAGS/LDFLAGS/LIBS
UNIFYFS_AC_LEVELDB
# look for gotcha library, sets GOTCHA_INCLUDE, GOTCHA_LIB
UNIFYFS_AC_GOTCHA
UNIFYFS_AC_MARGO
UNIFYFS_AC_FLATCC
# HDF found?
AX_LIB_HDF5
AM_CONDITIONAL([HAVE_HDF5], [test x$with_hdf5 = xyes])
# libc functions wrapped by unifyfs
CP_WRAPPERS+="-Wl,-wrap,access"
CP_WRAPPERS+=",-wrap,chmod"
CP_WRAPPERS+=",-wrap,fchmod"
CP_WRAPPERS+=",-wrap,lio_listio"
CP_WRAPPERS+=",-wrap,mkdir"
CP_WRAPPERS+=",-wrap,rmdir"
CP_WRAPPERS+=",-wrap,unlink"
CP_WRAPPERS+=",-wrap,remove"
CP_WRAPPERS+=",-wrap,rename"
CP_WRAPPERS+=",-wrap,truncate"
CP_WRAPPERS+=",-wrap,stat"
CP_WRAPPERS+=",-wrap,fstat"
CP_WRAPPERS+=",-wrap,__lxstat"
CP_WRAPPERS+=",-wrap,__xstat"
CP_WRAPPERS+=",-wrap,creat"
CP_WRAPPERS+=",-wrap,creat64"
CP_WRAPPERS+=",-wrap,open"
CP_WRAPPERS+=",-wrap,open64"
CP_WRAPPERS+=",-wrap,__open_2"
CP_WRAPPERS+=",-wrap,read"
CP_WRAPPERS+=",-wrap,write"
CP_WRAPPERS+=",-wrap,readv"
CP_WRAPPERS+=",-wrap,writev"
CP_WRAPPERS+=",-wrap,pread"
CP_WRAPPERS+=",-wrap,pread64"
CP_WRAPPERS+=",-wrap,pwrite"
CP_WRAPPERS+=",-wrap,pwrite64"
CP_WRAPPERS+=",-wrap,posix_fadvise"
CP_WRAPPERS+=",-wrap,lseek"
CP_WRAPPERS+=",-wrap,lseek64"
CP_WRAPPERS+=",-wrap,ftruncate"
CP_WRAPPERS+=",-wrap,fsync"
CP_WRAPPERS+=",-wrap,fdatasync"
CP_WRAPPERS+=",-wrap,flock"
CP_WRAPPERS+=",-wrap,mmap"
CP_WRAPPERS+=",-wrap,mmap64"
CP_WRAPPERS+=",-wrap,munmap"
CP_WRAPPERS+=",-wrap,msync"
CP_WRAPPERS+=",-wrap,__fxstat"
CP_WRAPPERS+=",-wrap,close"
# FILE* functions
CP_WRAPPERS+=",-wrap,fclose"
CP_WRAPPERS+=",-wrap,fflush"
CP_WRAPPERS+=",-wrap,fopen"
CP_WRAPPERS+=",-wrap,freopen"
CP_WRAPPERS+=",-wrap,setbuf"
CP_WRAPPERS+=",-wrap,setvbuf"
CP_WRAPPERS+=",-wrap,fprintf"
CP_WRAPPERS+=",-wrap,fscanf"
CP_WRAPPERS+=",-wrap,vfprintf"
CP_WRAPPERS+=",-wrap,vfscanf"
CP_WRAPPERS+=",-wrap,fgetc"
CP_WRAPPERS+=",-wrap,fgets"
CP_WRAPPERS+=",-wrap,fputc"
CP_WRAPPERS+=",-wrap,fputs"
CP_WRAPPERS+=",-wrap,getc"
CP_WRAPPERS+=",-wrap,putc"
CP_WRAPPERS+=",-wrap,ungetc"
CP_WRAPPERS+=",-wrap,fread"
CP_WRAPPERS+=",-wrap,fwrite"
CP_WRAPPERS+=",-wrap,fgetpos"
CP_WRAPPERS+=",-wrap,fseek"
CP_WRAPPERS+=",-wrap,fsetpos"
CP_WRAPPERS+=",-wrap,ftell"
CP_WRAPPERS+=",-wrap,rewind"
CP_WRAPPERS+=",-wrap,clearerr"
CP_WRAPPERS+=",-wrap,feof"
CP_WRAPPERS+=",-wrap,ferror"
CP_WRAPPERS+=",-wrap,fseeko"
CP_WRAPPERS+=",-wrap,ftello"
CP_WRAPPERS+=",-wrap,fileno"
# wide character FILE* functions
CP_WRAPPERS+=",-wrap,fwprintf"
CP_WRAPPERS+=",-wrap,fwscanf"
CP_WRAPPERS+=",-wrap,vfwprintf"
CP_WRAPPERS+=",-wrap,vfwscanf"
CP_WRAPPERS+=",-wrap,fgetwc"
CP_WRAPPERS+=",-wrap,fgetws"
CP_WRAPPERS+=",-wrap,fputwc"
CP_WRAPPERS+=",-wrap,fputws"
CP_WRAPPERS+=",-wrap,fwide"
CP_WRAPPERS+=",-wrap,getwc"
CP_WRAPPERS+=",-wrap,putwc"
CP_WRAPPERS+=",-wrap,ungetwc"
# ,-u,__wrap___fxstat64,-u,pthread_mutex_lock,-u,pthread_mutex_unlock
# We need to know the value of the $libdir and $bindir variables so that
# we can reference the correct path in the unifyfs compiler wrappers.
# Unfortunately, those two variables are not normally evaluated by autoconf.
# They are evaluated at build time using Makefile variable substitutions.
#
# The following logic was copied from mpich2 1.3.1 to resolve the $libdir
# variable at configure time.
#
# Temporarily replace the default NONE value for exec_prefix
# and prefix with the actual, default values.
savePrefix=$prefix
saveExecprefix=$exec_prefix
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
eval unifyfs_lib_path=$libdir
eval unifyfs_bin_path=$bindir
prefix=$savePrefix
exec_prefix=$saveExecprefix
# autoconf<=2.69, runstatedir is not configurable.
if test "x$runstatedir" = x; then
AC_SUBST([runstatedir], ['${localstatedir}/run'])
fi
AC_SUBST(unifyfs_lib_path)
AC_SUBST(unifyfs_bin_path)
AC_SUBST(LDFLAGS)
AC_SUBST(__CP_LOG_PATH)
AC_SUBST(CP_WRAPPERS)
AC_SUBST(DISABLE_LDPRELOAD)
AC_CONFIG_FILES([Makefile
common/Makefile
common/src/Makefile
meta/Makefile
meta/src/Makefile
server/Makefile
server/src/Makefile
client/Makefile
client/src/Makefile
client/unifyfs.pc
examples/Makefile
examples/src/Makefile
extras/Makefile
extras/unifyfs.conf
t/Makefile
t/lib/Makefile
util/Makefile
util/scripts/Makefile
util/scripts/lsfcsm/Makefile
util/unifyfs/Makefile
util/unifyfs/src/Makefile])
AC_CONFIG_FILES([client/unifyfs-config], [chmod +x client/unifyfs-config])
AC_CONFIG_FILES([util/scripts/lsfcsm/unifyfs_lsfcsm_prolog], [chmod +x util/scripts/lsfcsm/unifyfs_lsfcsm_prolog])
AC_CONFIG_FILES([util/scripts/lsfcsm/unifyfs_lsfcsm_epilog], [chmod +x util/scripts/lsfcsm/unifyfs_lsfcsm_epilog])
UNIFYFS_VERSION=${PACKAGE_VERSION}
AC_SUBST(UNIFYFS_VERSION)
AC_SUBST([LIBUNIFYFS_LT_VERSION], [1:0:0])
# pkgconfig versioning
LIBUNIFYFS_API_VERSION="1.0.0"
AC_SUBST(LIBUNIFYFS_API_VERSION)
AC_OUTPUT
AC_MSG_RESULT([
==========================
UNIFYFS Checkpoint-Restart
==========================
prefix ${prefix}
compiler ${CC}
CFLAGS ${CFLAGS}
==========================
Supported POSIX wrappers:
${CP_WRAPPERS}
])