-
Notifications
You must be signed in to change notification settings - Fork 27
/
configure.ac
390 lines (342 loc) · 18.8 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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
#Copyright (c) 2015, Los Alamos National Security, LLC
#All rights reserved.
#
#Copyright 2015. Los Alamos National Security, LLC. This software was produced
#under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National
#Laboratory (LANL), which is operated by Los Alamos National Security, LLC for
#the U.S. Department of Energy. The U.S. Government has rights to use, reproduce,
#and distribute this software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL
#SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY
#FOR THE USE OF THIS SOFTWARE. If software is modified to produce derivative
#works, such modified software should be clearly marked, so as not to confuse it
#with the version available from LANL.
#
#Additionally, redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#1. Redistributions of source code must retain the above copyright notice, this
#list of conditions and the following disclaimer.
#
#2. Redistributions in binary form must reproduce the above copyright notice,
#this list of conditions and the following disclaimer in the documentation
#and/or other materials provided with the distribution.
#3. Neither the name of Los Alamos National Security, LLC, Los Alamos National
#Laboratory, LANL, the U.S. Government, nor the names of its contributors may be
#used to endorse or promote products derived from this software without specific
#prior written permission.
#
#THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
#THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
#OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
#STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
#OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#-----
#NOTE:
#-----
#
#MarFS is released under the BSD license.
#
#MarFS was reviewed and released by LANL under Los Alamos Computer Code identifier:
#LA-CC-15-039.
#
#MarFS uses libaws4c for Amazon S3 object communication. The original version
#is at https://aws.amazon.com/code/Amazon-S3/2601 and under the LGPL license.
#LANL added functionality to the original work. The original work plus
#LANL contributions is found at https://github.com/jti-lanl/aws4c.
#
#GNU licenses can be found at http://www.gnu.org/licenses/.
#
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# NOTE: Instead of generating libne_auto_config.h for inclusion in our
# .h files, which would contain #defines matching AC_DEFINE() calls
# in this config, we now generate erasure_config.h which contains
# hand-built #defines matching AC_SUBST() calls in this config. As
# a result, we generate only the symbols we really want to export,
# which lets us avoid name-conflicts with #defines that might be
# used within other libraries (e.g. pftool) which include our .h
# files, plus their own config.h.
#
# HOWEVER, erasure.c still uses HAVE_LIBISAL internally. Therefore,
# we do generate this file, but we avoid exporting it.
AC_PREREQ([2.69])
AC_INIT([MarFS], [1.0], [[email protected]])
AC_CONFIG_SRCDIR([COPYRIGHT.h])
AC_CONFIG_HEADERS([src/marfs_auto_config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CC([mpicc mpiCC])
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
# default to "-g", instead of "-g -O2"
CFLAGS="$CFLAGS -g"
# AC_PROG_CC
# AC_PROG_RANLIB
# check for '-Wall' support and use it if we can
AC_MSG_CHECKING(whether compiler understands -Wall)
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
CFLAGS="$old_CFLAGS")
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h])
AXATTR_CHECK
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_SSIZE_T
AC_TYPE_SIZE_T
AC_CHECK_HEADER_STDBOOL
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([bzero ftruncate memset strerror strtol strtoul malloc])
AXATTR_GET_FUNC_CHECK
AXATTR_SET_FUNC_CHECK
AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR(["Could not locate libpthread!"])])
AC_CHECK_LIB([m], [log10], [], [AC_MSG_ERROR(["Could not locate libm!])])
AC_CHECK_LIB([xml2], [xmlReadFile], [], [AC_MSG_ERROR(["Could not locate libxml2!"])])
AC_CHECK_LIB([fuse], [fuse_main], [], [AC_MSG_ERROR(["Could not locate libfuse!"])])
AC_CHECK_LIB([readline], [readline], [], [AC_MSG_ERROR(["Could not locate libreadline!"])])
AC_CHECK_LIB([mpi], [MPI_Abort], [], [AC_MSG_ERROR(["Could not locate libmpi!"])])
# Check if we'll be building the S3 DAL
warnlibs=""
nos3=""
AC_ARG_ENABLE([S3],
AS_HELP_STRING( [--disable-S3], [Skip Build of the S3 DAL @{:@ useful on systems with outdated libS3 @:}@] ),
[nos3="true"], [] )
AC_CHECK_LIB([s3], [S3_initiate_multipart], [], [warnlibs="libs3 "])
AM_CONDITIONAL([S3DAL], [test "$warnlibs" = "" && test "$nos3" = ""])
AM_COND_IF([S3DAL], [AC_DEFINE( [S3DAL], [], [Flag indicating activation of S3 DAL] )],
[ if test "$nos3" = ""; then
echo
echo "WARNING: failed to properly link all necessary functions from $( echo "$warnlibs" | sed 's/ $/\./' | sed 's/ /, /g' )"
echo " These libraries may be missing, or below the required versions."
echo " The 'S3' DAL will be disabled!"
echo; fi ] )
PKG_CHECK_MODULES( XML, libxml-2.0 )
AC_CHECK_LIB([isal], [crc32_ieee],
[],
[AC_CHECK_LIB([isal], [crc32_ieee_base],
[echo
echo "WARNING: Could not properly link 'crc32_ieee' from isa-l, defaulting to '_base' implementation"
echo " IN THIS STATE, THESE UTILITES MAY NOT FUNCTION AS EXPECTED AND WILL ALMOST CERTAINLY HAVE VERY POOR PERFORMANCE"
echo],
[AC_MSG_ERROR(["Could not locate Intel's Intelligent Storage Acceleration Library (isa-l) on this system! Please verify that the proper version of the library (v2.16.0 or higher) is installed."])])])
# check for presence of zlib
warnlibs=""
AC_CHECK_LIB([z], [adler32], [], [warnlibs="zlib "])
AC_CHECK_LIB([m], [ceil], [], [warnlibs="$warnlibs""libm "])
AC_CHECK_LIB([isal], [crc32_gzip_refl], [:], [warnlibs="$warnlibs""libisal(need-v2.19+) "])
librdmacm_present=true
AC_CHECK_LIB([rdmacm], [rdma_getaddrinfo], [], [librdmacm_present=false && warnlibs="$warnlibs""librdmacm "])
AM_CONDITIONAL([BENCH], [test "$warnlibs" = "" ])
AM_COND_IF([BENCH], [],
[echo
echo "WARNING: failed to properly link all necessary functions from $( echo "$warnlibs" | sed 's/ $/\./' | sed 's/ /, /g' )"
echo " These libraries may be missing, or below the required versions."
echo " The 'isal_benchmark' subdir will not be built!"
echo ])
AC_DEFINE( [GTESTNEVAR], [], [Testing variable] )
# Allow turning on debugging flags
# NOTE: There are currently no fast-timer (i.e. 'ft') diagnostics.
# If there were, we would probably only want to see them for specialized debugging.
# NOTE: The only point of 'gdb' is to allow sockets timeouts to be made long, in the
# case where a developer wants to be able to take their time stepping through
# protocol steps, without worrying about timeouts. In all other ways, it is the
# same as 'yes' (which is the default if you just configure with '--enable-debug')
#AC_ARG_ENABLE([debug],
# AS_HELP_STRING([--enable-debug],
# [Turn on internal debugging. One of {yes,no,ne,sockets,ft,gdb}]),
# [ AS_IF( [ x"${enableval}" =~ ^x\(.*,\)?all\(,.*\)?$ ], [AC_DEFINE( [DEBUG_ALL] )], [] ) ],
# [debug_all=no; debug_ne=no; debug_io=no; debug_dal=no; debug_tq=no])
fulldebugstr=""
AC_ARG_ENABLE( [debugALL],
[ AS_HELP_STRING( [--enable-debugALL], [Enable all debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_ALL], [3], [Enable all debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_ALL], [2], [Enable all debug output] ) ],
[ AC_DEFINE( [DEBUG_ALL], [1], [Enable all debug output] ) ]
) && fulldebugstr="$fulldebugstr""ALL=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugMDAL],
[ AS_HELP_STRING( [--enable-debugMDAL], [Enable 'mdal'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_MDAL], [3], [Enable 'mdal'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_MDAL], [2], [Enable 'mdal'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_MDAL], [1], [Enable 'mdal'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""MDAL=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugHASH],
[ AS_HELP_STRING( [--enable-debugHASH], [Enable 'hash'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_HASH], [3], [Enable 'hash'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_HASH], [2], [Enable 'hash'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_HASH], [1], [Enable 'hash'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""HASH=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugCONFIG],
[ AS_HELP_STRING( [--enable-debugCONFIG], [Enable 'config'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_CONFIG], [3], [Enable 'config'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_CONFIG], [2], [Enable 'config'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_CONFIG], [1], [Enable 'config'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""CONFIG=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugRECOVERY],
[ AS_HELP_STRING( [--enable-debugRECOVERY], [Enable 'recovery'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_RECOVERY], [3], [Enable 'recovery'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_RECOVERY], [2], [Enable 'recovery'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_RECOVERY], [1], [Enable 'recovery'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""RECOVERY=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugTAGGING],
[ AS_HELP_STRING( [--enable-debugTAGGING], [Enable 'tagging'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_TAGGING], [3], [Enable 'tagging'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_TAGGING], [2], [Enable 'tagging'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_TAGGING], [1], [Enable 'tagging'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""TAGGING=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugDS],
[ AS_HELP_STRING( [--enable-debugDS], [Enable 'ds'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_DS], [3], [Enable 'ds'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_DS], [2], [Enable 'ds'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_DS], [1], [Enable 'ds'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""DS=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugRM],
[ AS_HELP_STRING( [--enable-debugRM], [Enable 'rsrc_mgr'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_RM], [3], [Enable 'rsrc_mgr'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_RM], [2], [Enable 'rsrc_mgr'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_RM], [1], [Enable 'rsrc_mgr'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""RM=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugAPI],
[ AS_HELP_STRING( [--enable-debugAPI], [Enable 'api'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_API], [3], [Enable 'api'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_API], [2], [Enable 'api'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_API], [1], [Enable 'api'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""API=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugFUSE],
[ AS_HELP_STRING( [--enable-debugFUSE], [Enable 'fuse'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_FUSE], [3], [Enable 'fuse'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_FUSE], [2], [Enable 'fuse'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_FUSE], [1], [Enable 'fuse'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""FUSE=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugNE],
[ AS_HELP_STRING( [--enable-debugNE], [Enable 'ne'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_NE], [3], [Enable 'ne'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_NE], [2], [Enable 'ne'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_NE], [1], [Enable 'ne'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""NE=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugIO],
[ AS_HELP_STRING( [--enable-debugIO], [Enable 'io'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_IO], [3], [Enable 'io'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_IO], [2], [Enable 'io'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_IO], [1], [Enable 'io'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""IO=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugDAL],
[ AS_HELP_STRING( [--enable-debugDAL], [Enable 'dal'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_DAL], [3], [Enable 'dal'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_DAL], [2], [Enable 'dal'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_DAL], [1], [Enable 'dal'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""DAL=\"$enableval\" " ], []
)
AC_ARG_ENABLE( [debugTQ],
[ AS_HELP_STRING( [--enable-debugTQ], [Enable 'thread_queue'-subdir debug output] ) ],
[ AS_CASE( [ x"${enableval}" ],
[[ x[Ee]* ]],
[ AC_DEFINE( [DEBUG_TQ], [3], [Enable 'thread_queue'-subdir debug output] ) ],
[[ x[Ww]* ]],
[ AC_DEFINE( [DEBUG_TQ], [2], [Enable 'thread_queue'-subdir debug output] ) ],
[ AC_DEFINE( [DEBUG_TQ], [1], [Enable 'thread_queue'-subdir debug output] ) ]
) && fulldebugstr="$fulldebugstr""TQ=\"$enableval\" " ], []
)
# debugging-output should go to syslog, instead of stdout/stderr?
AC_ARG_ENABLE([syslog],
AS_HELP_STRING( [--enable-syslog], [Send debugging output to syslog, instead of stdout/stderr] ),
AC_DEFINE( [USE_SYSLOG], [], [Send debugging output to syslog, instead of stdout/stderr] ), [] )
#AM_COND_IF( [DEBUG_ALL], [test "$debug_all" = yes], [AC_DEFINE( [DEBUG_ALL] )], [])
#AM_CONDITIONAL([DEBUG_SOCKETS], [test "$enable_debug" = sockets || test "$enable_debug" = all ])
#AM_CONDITIONAL([DEBUG_SOCKETS_GDB], [test "x$debug_mode" = "xgdb" ])
AM_CONDITIONAL([DEBUG_FT], [test "$enable_debug" = ft ])
AM_CONDITIONAL([GPROF], [test "$enable_gprof" = yes ])
AM_CONDITIONAL([USE_SYSLOG], [test x"$enable_syslog" != xno])
AC_CONFIG_FILES([Makefile
src/Makefile
src/logging/Makefile
src/thread_queue/Makefile
src/dal/Makefile
src/io/Makefile
src/ne/Makefile
src/recursion/Makefile
src/isal_benchmark/Makefile
src/hash/Makefile
src/mdal/Makefile
src/tagging/Makefile
src/recovery/Makefile
src/config/Makefile
src/datastream/Makefile
src/api/Makefile
src/fuse/Makefile
src/rsrc_mgr/Makefile
etc/Makefile
])
AC_OUTPUT
# let the user know the configuration
cat << EOF
marfs configuration
#####################
PREFIX : $prefix
CC : $CC
CFLAGS : $CFLAGS
LDFLAGS : $LDFLAGS
LIBS : $LIBS
DEBUG : $fulldebugstr
EOF