-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
476 lines (428 loc) · 17.9 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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
###########################################################################
# Prelude.
###########################################################################
AC_PREREQ([2.68])
AC_INIT([IBAMR],[101029],[griffith AT cims DOT nyu DOT edu])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config/IBAMR_config.h])
AX_PREFIX_CONFIG_H([config/IBAMR_prefix_config.h])
AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror dist-bzip2 foreign -Wno-extra-portability])
AM_MAINTAINER_MODE([disable])
AC_LANG(C++)
###########################################################################
# Checks for programs.
###########################################################################
AC_ARG_VAR(LDFLAGS,[linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>])
AC_ARG_VAR(LIBS,[linker commands, e.g. -l<lib> if you require a nonstandard library <lib>])
AC_ARG_VAR(FCLIBS,[linker flags and commands, e.g. -L<lib dir> and -l<lib> for the "Fortran intrinsic and run-time libraries" that are required to successfully link a Fortran program or shared library])
AC_PROG_CC # Check for a C compiler.
AC_PROG_CXX # Check for a C++ compiler.
AC_PROG_CXXCPP # Check for a C++ preprocessor.
AC_PROG_FC # Check for a Fortran compiler.
AC_PROG_F77 # Check for a Fortran 77 compiler.
AC_FC_LIBRARY_LDFLAGS # Determine the linker flags for the Fortran intrinsic and runtime libraries.
AC_FC_WRAPPERS
LIBS="$LIBS $FCLIBS"
AM_PROG_AR
if test "x$F77" != "x" -a "$F77" != "$FC" ; then
AC_MSG_WARN([environment variables F77 and FC differ; using F77=$FC])
fi
F77=$FC
if test "x$FFLAGS" != "x" -a "$FFLAGS" != "$FCFLAGS" ; then
AC_MSG_WARN([environment variables FFLAGS and FCFLAGS differ; using FFLAGS=$FCFLAGS])
fi
FFLAGS=$FCFLAGS
if test "x$FLIBS" != "x" -a "$FLIBS" != "$FCLIBS" ; then
AC_MSG_WARN([environment variables FCLIBS and FLIBS differ; using FLIBS=$FCLIBS])
fi
FLIBS=$FCLIBS
AC_LIB_PREPARE_PREFIX
AC_LIB_RPATH
# Check for MPICC and MPICXX and configure MPI options.
AC_ARG_WITH([mpi],
AS_HELP_STRING(--with-mpi=PATH,location of required MPI installation),
[if test ! -d "$withval" ; then
AC_MSG_ERROR([you must specify an existing directory when using --with-mpi=PATH])
fi
if test -d "$withval" ; then
PATH="${withval}:$PATH"
fi
if test -d "$withval/bin" ; then
PATH="${withval}/bin:$PATH"
fi
if test -d "$withval/include" ; then
CPPFLAGS="-I${withval}/include $CPPFLAGS"
fi],)
AC_ARG_WITH([mpicc],
AS_HELP_STRING(--with-mpicc=ARG,MPI C compiler command),
[MPICC=$withval],)
AC_ARG_WITH([mpicxx],
AS_HELP_STRING(--with-mpicxx=ARG,MPI C++ compiler command),
[MPICXX=$withval],)
AC_LANG_PUSH([C])
AX_MPI([],[AC_MSG_WARN([unable to find working MPI C complier wrapper])])
AC_LANG_POP([C])
AX_MPI([],[AC_MSG_WARN([unable to find working MPI C++ compiler wrapper])])
if test "$MPILIBS" != "" ; then
LIBS="$MPILIBS $LIBS"
fi
# Checks for C and C++ compiler features.
AC_HEADER_MAJOR
AC_HEADER_STDC
AX_CXX_NAMESPACES
if test "$ax_cv_cxx_namespaces" != "yes" ; then
AC_MSG_ERROR([the specified C++ compiler does not appear to support namespaces])
fi
AX_CXX_HAVE_STL
if test "$ax_cv_cxx_have_stl" != "yes" ; then
AC_MSG_ERROR([the specified C++ compiler does not appear support the Standard Template Library])
fi
AC_MSG_CHECKING([whether compiler supports __builtin_expect keyword])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
if (__builtin_expect(true,1))
{
return 0;
}
else
{
return -1;
}
]])],[
have_builtin_expect=1
AC_MSG_RESULT(yes)],[
have_builtin_expect=0
AC_MSG_RESULT(no)])
AC_DEFINE_UNQUOTED(HAVE_BUILTIN_EXPECT,$have_builtin_expect,[Boolean value indicating whether the C++ compiler supports the __builtin_expect keyword])
AC_MSG_CHECKING([whether compiler supports __builtin_prefetch keyword])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
__builtin_prefetch(0,0,0);
return 0;
]])],[
have_builtin_prefetch=1
AC_MSG_RESULT(yes)],[
have_builtin_prefetch=0
AC_MSG_RESULT(no)])
AC_DEFINE_UNQUOTED(HAVE_BUILTIN_PREFETCH,$have_builtin_prefetch,[Boolean value indicating whether the C++ compiler supports the __builtin_prefetch keyword])
# Checks for other programs.
AC_PROG_RANLIB
AC_ARG_WITH([ar],
AS_HELP_STRING([--with-ar=ARG],[manually set ar to ARG]))
AC_CHECK_PROGS(AR, $with_ar ar,,)
if test -z "$AR" ; then
AC_MSG_ERROR([ar not found, specify via --with-ar=ARG])
fi
AC_ARG_WITH([M4],
AS_HELP_STRING([--with-M4=ARG],[manually set M4 to ARG]))
AC_CHECK_PROGS(M4, $with_M4 gm4 m4,,)
if test -z "$M4" ; then
AC_MSG_ERROR([m4 preprocessor not found, specify via --with-M4=ARG])
fi
AC_ARG_WITH([doxygen-dir],
AS_HELP_STRING([--with-doxygen-dir=PATH],[manually set directory where the doxygen executable resides to PATH]),
DOXYGEN_PATH=$withval
AC_CHECK_PROGS(DOXYGEN, "$DOXYGEN_PATH/doxygen" doxygen,,),
DOXYGEN_PATH=""
AC_CHECK_PROGS(DOXYGEN, doxygen,,))
if test -z "$DOXYGEN" ; then
AC_MSG_WARN([doxygen not found])
echo "if doxygen is installed, specify its location via --with-doxygen-dir=PATH"
HAVE_DOXYGEN="NO"
else
HAVE_DOXYGEN="YES"
fi
AC_SUBST(HAVE_DOXYGEN,$HAVE_DOXYGEN)
AC_SUBST(DOXYGEN,$DOXYGEN)
AC_SUBST(DOXYGEN_PATH,$DOXYGEN_PATH)
AC_ARG_WITH([dot-dir],
AS_HELP_STRING([--with-dot-dir=PATH],[manually set directory where the Graphviz dot executable resides to PATH]),
DOT_PATH=$withval
AC_CHECK_PROGS(DOT, "$DOT_PATH/dot" dot,,),
DOT_PATH=""
AC_CHECK_PROGS(DOT, dot,,))
if test -z "$DOT" ; then
AC_MSG_WARN([dot not found])
echo "if the Graphviz dot tool is installed, specify its location via --with-dot-dir=PATH"
HAVE_DOT="NO"
else
HAVE_DOT="YES"
fi
AC_SUBST(HAVE_DOT,$HAVE_DOT)
AC_SUBST(DOT,$DOT)
AC_SUBST(DOT_PATH,$DOT_PATH)
###########################################################################
# Checks for IBAMR configuration.
###########################################################################
echo
echo "========================="
echo "Configuring IBAMR options"
echo "========================="
# Checks to see whether large ghost cell widths should be enabled.
AC_ARG_ENABLE([large-ghost-cell-width],
AS_HELP_STRING(--enable-large-ghost-cell-width,[enable the use of large ghost cell regions (this feature must be enabled for certain types of physical boundary condition routines to function properly) @<:@default=no@:>@]),
[LARGE_GHOST_CELL_WIDTH=$enable_large_ghost_cell_width], [LARGE_GHOST_CELL_WIDTH=no])
if test "$LARGE_GHOST_CELL_WIDTH" == "yes" ; then
echo "large ghost cell widths are ENABLED!"
AC_DEFINE([USING_LARGE_GHOST_CELL_WIDTH],[true],[Boolean value indicating whether we are using large ghost cell widths])
else
echo "large ghost cell widths are DISABLED!"
echo " certain physical boundary condition handling routines may not function properly"
echo " if you wish to enable support for large ghost cell widths, specify --enable-large-ghost-cell-width"
AC_DEFINE([USING_LARGE_GHOST_CELL_WIDTH],[false],[Boolean value indicating whether we are using large ghost cell widths])
fi
# Checks to see whether expensive coarse-fine interface code should be
# enabled.
AC_ARG_ENABLE([expensive-cf-interpolation],
AS_HELP_STRING(--enable-expensive-cf-interpolation,[enable the use of the expensive version of the quadratic coarse-fine interface interpolation code (this feature must be enabled for certain use cases, e.g. general anisotropic diffusion tensors) @<:@default=no@:>@]),
[EXPENSIVE_CF_INTERPOLATION=$enable_expensive_cf_interpolation], [EXPENSIVE_CF_INTERPOLATION=no])
if test "$EXPENSIVE_CF_INTERPOLATION" == "yes" ; then
echo "expensive version of the quadratic coarse-fine interface interpolation code is ENABLED!"
AC_DEFINE([USING_EXPENSIVE_CF_INTERPOLATION],[true],[Boolean value indicating whether we are using the expensive version of the quadratic coarse-fine interface code])
else
echo "expensive version of the quadratic coarse-fine interface interpolation code is DISABLED!"
echo " this feature must be enabled for certain use cases, e.g. general anisotropic diffusion tensors"
echo " if you wish to enable support for large ghost cell widths, specify --enable-expensive-cf-interpolation"
AC_DEFINE([USING_EXPENSIVE_CF_INTERPOLATION],[false],[Boolean value indicating whether we are using the expensive version of the quadratic coarse-fine interface code])
fi
###########################################################################
# Checks for libraries.
###########################################################################
AC_ARG_WITH([hdf5],
AS_HELP_STRING(--with-hdf5=PATH,location of required hdf5 installation @<:@default=/usr/local/sfw/hdf5/current@:>@),
[if test ! -d "$withval" ; then
AC_MSG_ERROR([you must specify an existing directory when using --with-hdf5=PATH])
fi
HDF5_DIR=$withval],
[HDF5_DIR=/usr/local/sfw/hdf5/current])
AC_ARG_WITH([hypre],
AS_HELP_STRING(--with-hypre=PATH,location of required hypre installation @<:@default=/usr/local/sfw/hypre/current@:>@),
[if test ! -d "$withval" ; then
AC_MSG_ERROR([you must specify an existing directory when using --with-hypre=PATH])
fi
HYPRE_DIR=$withval],
[HYPRE_DIR=/usr/local/sfw/hypre/current])
AC_ARG_ENABLE([libmesh],
AS_HELP_STRING(--enable-libmesh,enable support for the optional libMesh library @<:@default=no@:>@),
[LIBMESH_ENABLED=$enableval], [LIBMESH_ENABLED=no])
if test "$LIBMESH_ENABLED" == "" ; then
LIBMESH_ENABLED=no
fi
AC_ARG_WITH([libmesh],
AS_HELP_STRING([--with-libmesh=PATH],[location of optional libMesh installation @<:@default=/usr/local/sfw/libmesh/current@:>@]),
[if test "$LIBMESH_ENABLED" == "no" ; then
AC_MSG_WARN([--with-libmesh is specified, but support for libMesh is DISABLED])
LIBMESH_DIR=NONE
else
if test ! -d "$withval" ; then
AC_MSG_ERROR([you must specify an existing directory when using --with-libmesh=PATH])
fi
LIBMESH_DIR=$withval
fi],
[LIBMESH_DIR=/usr/local/sfw/libmesh/current])
AC_ARG_WITH([libmesh-compile-mode],
AS_HELP_STRING([--with-libmesh-compile-mode=METHOD],[libMesh compile mode options include opt, devel, dbg, prof, oprof @<:@default=dbg@:>@]),
[if test "$LIBMESH_ENABLED" == "no" ; then
AC_MSG_WARN([--with-libmesh-compile-mode is specified, but support for libMesh is DISABLED])
LIBMESH_COMPILE_MODE=NONE
else
LIBMESH_COMPILE_MODE=$withval
fi],
[LIBMESH_COMPILE_MODE=dbg])
AC_ARG_VAR(PETSC_DIR,[the location of the PETSc installation that is to be used. Note that multiple versions of PETSc may be installed within the same filesystem, with each version corresponding to a different value of PETSC_DIR.])
AC_ARG_VAR(PETSC_ARCH,[the PETSc configuration that is to be used, corresponding to the configuration located in ${PETSC_DIR}/${PETSC_ARCH}. Note that multiple configurations of PETSc can be installed for a particular version of the PETSc library. Each configuration will correspond to a different value of PETSC_ARCH.])
AC_ARG_WITH([petsc],
AS_HELP_STRING(--with-petsc=PATH,location of required PETSc installation @<:@default=PETSC_DIR@:>@),
[if test ! -d "$withval" ; then
AC_MSG_ERROR([you must specify an existing directory when using --with-petsc=PATH])
fi
PETSC_DIR=$withval],)
AC_ARG_WITH([petsc-arch],
AS_HELP_STRING(--with-petsc-arch=ARCH,PETSc architecture @<:@default=PETSC_ARCH@:>@),
[PETSC_ARCH=$withval],)
AC_SUBST(PETSC_DIR,$PETSC_DIR)
AC_SUBST(PETSC_ARCH,$PETSC_ARCH)
AC_ARG_WITH([samrai],
AS_HELP_STRING(--with-samrai=PATH,location of required SAMRAI installation @<:@default=/usr/local/sfw/samrai/current@:>@),
[if test ! -d "$withval" ; then
AC_MSG_ERROR([you must specify an existing directory when using --with-samrai=PATH])
fi
SAMRAI_DIR=$withval],
[SAMRAI_DIR=/usr/local/sfw/samrai/current])
AC_ARG_ENABLE([silo],
AS_HELP_STRING(--enable-silo,enable support for the optional Silo library @<:@default=yes@:>@),
[SILO_ENABLED=$enableval], [SILO_ENABLED=yes])
if test "$SILO_ENABLED" == "" ; then
SILO_ENABLED=yes
fi
AC_ARG_WITH([silo],
AS_HELP_STRING(--with-silo=PATH,location of optional Silo installation @<:@default=/usr/local/sfw/silo/current@:>@),
[if test "$SILO_ENABLED" == "no" ; then
AC_MSG_WARN([--with-silo is specified, but support for Silo is DISABLED])
SILO_DIR=NONE
else
if test ! -d "$withval" ; then
AC_MSG_ERROR([you must specify an existing directory when using --with-silo=PATH])
fi
SILO_DIR=$withval
fi],
[SILO_DIR=/usr/local/sfw/silo/current])
###########################################################################
# Configure libraries.
###########################################################################
echo
echo "========================================"
echo "Configuring required package BLAS/LAPACK"
echo "========================================"
if (test -r $PETSC_DIR/$PETSC_ARCH/conf/petscvariables) ; then
PETSC_BLASLAPACK_LIB=`grep "BLASLAPACK_LIB" $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | sed -e 's/.*BLASLAPACK_LIB = //'`
if test "x$PETSC_BLASLAPACK_LIB" != x ; then
if test "x$with_blas" != "x" -a "$with_blas" != "$PETSC_BLASLAPACK_LIB" ; then
AC_MSG_WARN([BLAS flags specified by --with-blas appear to disagree with PETSc BLAS/LAPACK flags; using PETSc settings])
fi
if test "x$with_lapack" != "x" -a "$with_lapack" != "$PETSC_BLASLAPACK_LIB" ; then
AC_MSG_WARN([LAPACK flags specified by --with-lapack appear to disagree with PETSc BLAS/LAPACK flags; using PETSc settings])
fi
echo "using PETSc BLAS/LAPACK library flags: $PETSC_BLASLAPACK_LIB"
with_blas="$PETSC_BLASLAPACK_LIB"
with_lapack=""
fi
PETSC_BLASLAPACK_INCLUDE=`grep "BLASLAPACK_INCLUDE" $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | sed -e 's/.*BLASLAPACK_INCLUDE = //'`
if test "x$PETSC_BLASLAPACK_INCLUDE" != x ; then
CPPFLAGS="${PETSC_BLASLAPACK_INCLUDE} $CPPFLAGS"
fi
fi
AX_BLAS(,)
AX_LAPACK(,)
LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FCLIBS"
AM_CONDITIONAL([SILO_ENABLED],[test "$SILO_ENABLED" == "yes"])
if test "$SILO_ENABLED" == "yes"; then
echo
echo "================================="
echo "Configuring optional package Silo"
echo "================================="
CONFIGURE_SILO
else
echo
echo "================================="
echo "Optional package Silo is DISABLED"
echo "================================="
fi
echo
echo "================================="
echo "Configuring required package hdf5"
echo "================================="
CONFIGURE_HDF5
echo
echo "=================================="
echo "Configuring required package hypre"
echo "=================================="
CONFIGURE_HYPRE
echo
echo "=================================="
echo "Configuring required package PETSc"
echo "=================================="
CONFIGURE_PETSC
AM_CONDITIONAL([LIBMESH_ENABLED],[test "$LIBMESH_ENABLED" == "yes"])
if test "$LIBMESH_ENABLED" == "yes"; then
echo
echo "===================================="
echo "Configuring optional package libMesh"
echo "===================================="
CONFIGURE_LIBMESH
else
echo
echo "===================================="
echo "Optional package libMesh is DISABLED"
echo "===================================="
fi
echo
echo "==================================="
echo "Configuring required package SAMRAI"
echo "==================================="
CONFIGURE_SAMRAI
###########################################################################
# Output files.
###########################################################################
echo
echo "================"
echo "Outputting files"
echo "================"
AC_CONFIG_FILES([
Makefile
bin/Makefile
config/make.inc
doc/Doxyfile
doc/Makefile
doc/online_Doxyfile
examples/Makefile
examples/IB/Makefile
examples/IB/explicit/Makefile
examples/IB/explicit/ex0/Makefile
examples/IB/explicit/ex1/Makefile
examples/IB/explicit/ex2/Makefile
examples/IB/explicit/ex3/Makefile
examples/IB/explicit/ex4/Makefile
examples/IB/explicit/ex5/Makefile
examples/IB/explicit/ex6/Makefile
examples/IB/implicit/Makefile
examples/IB/implicit/ex0/Makefile
examples/IB/implicit/ex1/Makefile
examples/IB/implicit/ex2/Makefile
examples/IBFE/Makefile
examples/IBFE/explicit/Makefile
examples/IBFE/explicit/ex0/Makefile
examples/IBFE/explicit/ex1/Makefile
examples/IBFE/explicit/ex2/Makefile
examples/IBFE/explicit/ex3/Makefile
examples/IBFE/explicit/ex4/Makefile
examples/IBFE/explicit/ex5/Makefile
examples/IBFE/explicit/ex6/Makefile
examples/IBFE/explicit/ex7/Makefile
examples/IMP/Makefile
examples/IMP/explicit/Makefile
examples/IMP/explicit/ex0/Makefile
examples/adv_diff/Makefile
examples/adv_diff/ex0/Makefile
examples/adv_diff/ex1/Makefile
examples/adv_diff/ex2/Makefile
examples/advect/Makefile
examples/navier_stokes/Makefile
examples/navier_stokes/ex0/Makefile
examples/navier_stokes/ex1/Makefile
examples/navier_stokes/ex2/Makefile
examples/navier_stokes/ex3/Makefile
examples/navier_stokes/ex4/Makefile
examples/navier_stokes/ex5/Makefile
examples/navier_stokes/ex6/Makefile
lib/Makefile
src/Makefile
src/fortran/Makefile
src/IB/Makefile
src/adv_diff/Makefile
src/adv_diff/fortran/Makefile
src/advect/Makefile
src/advect/fortran/Makefile
src/navier_stokes/Makefile
src/navier_stokes/fortran/Makefile
src/solid_mechanics/Makefile
src/utilities/Makefile
src/tools/Makefile
])
AC_CONFIG_SUBDIRS([ibtk])
AC_OUTPUT
echo
echo "===================================================================="
echo "===================================================================="
echo
AC_MSG_NOTICE([IBAMR appears to have been configured successfully. Now:
make lib Build the IBAMR library and its supporting IBTK library
make check Build and run basic library tests
make examples Build all of the IBAMR and IBTK example programs
Note that the IBAMR and IBTK example programs are not run by "make examples".
To run the examples, e.g.,
make examples
cd examples/IB/cell_centered/ex0
./main2d input2d
You may also build and run individual example programs, e.g., via
cd examples/IB/cell_centered/ex0
make examples
./main2d input2d])