| 1 |
|
|---|
| 2 | # -*- Autoconf -*-
|
|---|
| 3 | # Process this file with autoconf to produce a configure script.
|
|---|
| 4 |
|
|---|
| 5 | AC_PREREQ([2.60])
|
|---|
| 6 | AC_INIT([VMG], [0.1], [tremolo-devel@ins.uni-bonn.de])
|
|---|
| 7 |
|
|---|
| 8 | AC_MSG_NOTICE([****************************************************************])
|
|---|
| 9 | AC_MSG_NOTICE([* Configuring solver VMG *])
|
|---|
| 10 | AC_MSG_NOTICE([****************************************************************])
|
|---|
| 11 |
|
|---|
| 12 | AC_CONFIG_SRCDIR([src/mg.cpp])
|
|---|
| 13 | AC_CONFIG_AUX_DIR([build-aux])
|
|---|
| 14 | AC_CONFIG_MACRO_DIR([m4])
|
|---|
| 15 | AC_CONFIG_HEADERS([config.h])
|
|---|
| 16 | AM_INIT_AUTOMAKE([1.7 -Wall foreign])
|
|---|
| 17 |
|
|---|
| 18 | # We use mostly C++, but may need Fortran compiler infos for Lapack.
|
|---|
| 19 | AC_LANG([C++])
|
|---|
| 20 |
|
|---|
| 21 | # switch for one-sided communications
|
|---|
| 22 | AC_MSG_CHECKING(whether to enable one-sided MPI2 communications)
|
|---|
| 23 | AC_ARG_ENABLE([one_sided],
|
|---|
| 24 | AS_HELP_STRING([--enable-one-sided], [Enable use of one-sided communications as according to MPI2 standard]),
|
|---|
| 25 | enable_one_sided=$enableval,
|
|---|
| 26 | enable_one_sided="yes")
|
|---|
| 27 | AC_MSG_RESULT($enable_one_sided)
|
|---|
| 28 | AS_IF([test "$enable_one_sided" = "yes"], [
|
|---|
| 29 | AC_DEFINE([VMG_ONE_SIDED], [1], [Enable use of one-sided MPI2 communications])
|
|---|
| 30 | ])
|
|---|
| 31 |
|
|---|
| 32 | # several debug output switches
|
|---|
| 33 | AC_MSG_CHECKING(whether to enable debugging)
|
|---|
| 34 | AC_ARG_ENABLE([debug],
|
|---|
| 35 | AS_HELP_STRING([--enable-debug], [Enable debugging]),
|
|---|
| 36 | enable_debug=$enableval,
|
|---|
| 37 | enable_debug="no")
|
|---|
| 38 | AC_MSG_RESULT($enable_debug)
|
|---|
| 39 | AS_IF([test "$enable_debug" = "yes"], [
|
|---|
| 40 | CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"}
|
|---|
| 41 | AC_DEFINE([DEBUG], [1], [Debugging output])
|
|---|
| 42 | ])
|
|---|
| 43 |
|
|---|
| 44 | AC_MSG_CHECKING(whether to enable debug checking of matrices)
|
|---|
| 45 | AC_ARG_ENABLE([debug-check-matrices],
|
|---|
| 46 | AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks]),
|
|---|
| 47 | enable_debug_check_matrices=$enableval,
|
|---|
| 48 | enable_debug_check_matrices="no")
|
|---|
| 49 | AC_MSG_RESULT($enable_debug_check_matrices)
|
|---|
| 50 | AS_IF([test "$enable_debug_check_matrices" = "yes"], [
|
|---|
| 51 | AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks])
|
|---|
| 52 | ])
|
|---|
| 53 |
|
|---|
| 54 | AC_MSG_CHECKING(whether to enable debug output)
|
|---|
| 55 | AC_ARG_ENABLE([debug-output],
|
|---|
| 56 | AS_HELP_STRING([--enable-debug-output], [Enable debugging output]),
|
|---|
| 57 | enable_debug_output=$enableval,
|
|---|
| 58 | enable_debug_output="no")
|
|---|
| 59 | AC_MSG_RESULT($enable_debug_output)
|
|---|
| 60 | AS_IF([test "$enable_debug_output" = "yes"], [
|
|---|
| 61 | AC_DEFINE([DEBUG_OUTPUT], [1], [Debugging output])
|
|---|
| 62 | ])
|
|---|
| 63 |
|
|---|
| 64 | AC_MSG_CHECKING(whether to enable MPE profiling)
|
|---|
| 65 | AC_ARG_ENABLE([mpe],
|
|---|
| 66 | AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling]),
|
|---|
| 67 | enable_mpe=$enableval,
|
|---|
| 68 | enable_mpe="no")
|
|---|
| 69 | AC_MSG_RESULT($enable_mpe)
|
|---|
| 70 |
|
|---|
| 71 | AC_MSG_CHECKING(whether to enable debug measurement of run times)
|
|---|
| 72 | AC_ARG_ENABLE([debug-measure-time],
|
|---|
| 73 | AS_HELP_STRING([--enable-debug-measure-time], [Enable runtime measurement]),
|
|---|
| 74 | enable_debug_measure_time=$enableval,
|
|---|
| 75 | enable_debug_measure_time="no")
|
|---|
| 76 | AC_MSG_RESULT($enable_debug_measure_time)
|
|---|
| 77 | AS_IF([test "$enable_debug_measure_time" = "yes"], [
|
|---|
| 78 | AC_DEFINE([DEBUG_MEASURE_TIME], [1], [Runtime measurement])
|
|---|
| 79 | ])
|
|---|
| 80 |
|
|---|
| 81 | AC_MSG_CHECKING(whether to enable MPI_Barrier debugging)
|
|---|
| 82 | AC_ARG_ENABLE([debug-barrier],
|
|---|
| 83 | AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging]),
|
|---|
| 84 | enable_debug_barrier=$enableval,
|
|---|
| 85 | enable_debug_barrier="no")
|
|---|
| 86 | AC_MSG_RESULT($enable_debug_barrier)
|
|---|
| 87 | AS_IF([test "$enable_debug_barrier" = "yes"], [
|
|---|
| 88 | AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging])
|
|---|
| 89 | ])
|
|---|
| 90 |
|
|---|
| 91 | AC_MSG_CHECKING(whether to enable release version)
|
|---|
| 92 | AC_ARG_ENABLE([release],
|
|---|
| 93 | AS_HELP_STRING([--enable-release], [Compile with release settings]),
|
|---|
| 94 | enable_release=$enableval,
|
|---|
| 95 | enable_release="no")
|
|---|
| 96 | AC_MSG_RESULT($enable_release)
|
|---|
| 97 | AS_IF([test "$enable_release" = "yes"], [
|
|---|
| 98 | AC_DEFINE([RELEASE], [1], [Release]),
|
|---|
| 99 | AC_DEFINE([NDEBUG], [1], [Skip asserts])
|
|---|
| 100 | ])
|
|---|
| 101 |
|
|---|
| 102 | AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be [3-6].])
|
|---|
| 103 |
|
|---|
| 104 | if test -z "$BSPLINE_DEG"
|
|---|
| 105 | then
|
|---|
| 106 | BSPLINE_DEG=3
|
|---|
| 107 | fi
|
|---|
| 108 |
|
|---|
| 109 | AC_MSG_CHECKING(interpolation b-spline degree)
|
|---|
| 110 | AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree])
|
|---|
| 111 | AC_MSG_RESULT(${BSPLINE_DEG})
|
|---|
| 112 |
|
|---|
| 113 | # Checks for programs.
|
|---|
| 114 | AM_MISSING_PROG([DOXYGEN], [doxygen])
|
|---|
| 115 |
|
|---|
| 116 | # Get the C MPI compiler, because the following AC_FC_WRAPPERS macro works better if CC is from the same "family" as FC (which is MPI).
|
|---|
| 117 | AX_PROG_CC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI C compiler.]))
|
|---|
| 118 |
|
|---|
| 119 | # Do not even look for a non-MPI C++ compiler if MPICXX is set.
|
|---|
| 120 | if test -n "$MPICXX" && test -z "$CXX"; then
|
|---|
| 121 | CXX=$MPICXX
|
|---|
| 122 | fi
|
|---|
| 123 | ACX_MPI([AC_DEFINE([HAVE_MPI], [1],
|
|---|
| 124 | [Define if building the MPI parallel version])
|
|---|
| 125 | CXX=$MPICXX
|
|---|
| 126 | LIBS="$MPILIBS $LIBS"
|
|---|
| 127 | AC_DEFINE([MPICH_SKIP_CXX], [1], [Skip C++ bindings])
|
|---|
| 128 | AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])]
|
|---|
| 129 | if test "$enable_mpe" = "yes"; then
|
|---|
| 130 | AC_DEFINE([HAVE_MPE], [1], [Use MPE parallel profiler])
|
|---|
| 131 | fi,
|
|---|
| 132 | [AC_DEFINE([sequent], [1],
|
|---|
| 133 | [Define if building the serial version])])
|
|---|
| 134 |
|
|---|
| 135 | # Get the Fortran MPI compiler, for Lapack.
|
|---|
| 136 | AC_LANG_PUSH([Fortran])
|
|---|
| 137 | # Do not even look for a non-MPI Fortran compiler if MPIFC is set.
|
|---|
| 138 | AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI Fortran compiler.]))
|
|---|
| 139 |
|
|---|
| 140 | # Find out how to call Fortran functions from C.
|
|---|
| 141 | AC_FC_WRAPPERS
|
|---|
| 142 | AC_LANG_POP([Fortran])
|
|---|
| 143 |
|
|---|
| 144 | # Check for the restrict keyword.
|
|---|
| 145 | AC_C_RESTRICT
|
|---|
| 146 |
|
|---|
| 147 | AM_OPTIONS_VTK
|
|---|
| 148 | AM_PATH_VTK([5.4.2],
|
|---|
| 149 | [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
|
|---|
| 150 |
|
|---|
| 151 | AC_SUBST([VTK_CXXFLAGS])
|
|---|
| 152 | AC_SUBST([VTK_LDFLAGS])
|
|---|
| 153 |
|
|---|
| 154 | AX_BOOST_BASE([1.34],[have_boost=yes],[have_boost=no])
|
|---|
| 155 | if test "x$have_boost" = xyes ; then
|
|---|
| 156 | AX_BOOST_SYSTEM
|
|---|
| 157 | AX_BOOST_FILESYSTEM
|
|---|
| 158 | fi
|
|---|
| 159 |
|
|---|
| 160 | AC_SUBST([LIBVMG])
|
|---|
| 161 | LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)'
|
|---|
| 162 |
|
|---|
| 163 | AC_SUBST([LIBINTERFACES])
|
|---|
| 164 | LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a'
|
|---|
| 165 |
|
|---|
| 166 | AC_PROG_RANLIB
|
|---|
| 167 |
|
|---|
| 168 | # Checks for libraries.
|
|---|
| 169 | AC_CHECK_LIB([m], [sqrt])
|
|---|
| 170 | AX_LAPACK
|
|---|
| 171 | AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
|
|---|
| 172 |
|
|---|
| 173 | AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit],
|
|---|
| 174 | [save_LIBS=$LIBS
|
|---|
| 175 | LIBS="-lcppunit $LIBS"
|
|---|
| 176 | AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
|---|
| 177 | #include <cppunit/TestResult.h>
|
|---|
| 178 | int main (void)
|
|---|
| 179 | {
|
|---|
| 180 | CppUnit::TestResult testresult;
|
|---|
| 181 | return 0;
|
|---|
| 182 | }]])],
|
|---|
| 183 | [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no])
|
|---|
| 184 | LIBS=$save_LIBS
|
|---|
| 185 | ])
|
|---|
| 186 | AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes])
|
|---|
| 187 |
|
|---|
| 188 | # Checks for header files.
|
|---|
| 189 |
|
|---|
| 190 | # Checks for types.
|
|---|
| 191 |
|
|---|
| 192 | # Set up FCS types if inside the FCS tree.
|
|---|
| 193 | m4_ifdef([AX_FCS_TYPES],
|
|---|
| 194 | [AX_FCS_TYPES
|
|---|
| 195 | AC_DEFINE([vmg_float], [fcs_float],
|
|---|
| 196 | [Define to the primary interface and computation floating type.])
|
|---|
| 197 | AC_DEFINE([vmg_int], [fcs_int],
|
|---|
| 198 | [Define to the primary integer type for particle indices.])],
|
|---|
| 199 | [AC_DEFINE([vmg_float], [double],
|
|---|
| 200 | [Define to the primary interface and computation floating type.])
|
|---|
| 201 | AC_DEFINE([vmg_int], [int],
|
|---|
| 202 | [Define to the primary integer type for particle indices.])])
|
|---|
| 203 |
|
|---|
| 204 | # Set up information for FCS package if inside the FCS tree.
|
|---|
| 205 | m4_ifdef([AX_FCS_PACKAGE_RESET],[
|
|---|
| 206 | AX_FCS_PACKAGE_RESET
|
|---|
| 207 | AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lfcs_vmg])
|
|---|
| 208 | AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libfcs_vmg.a])
|
|---|
| 209 | AX_FCS_PACKAGE_ADD([vmg_LDADD],[$BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
|
|---|
| 210 | AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes])
|
|---|
| 211 | ])
|
|---|
| 212 |
|
|---|
| 213 | # Checks for structures.
|
|---|
| 214 |
|
|---|
| 215 | # Checks for compiler characteristics.
|
|---|
| 216 |
|
|---|
| 217 | # Checks for library functions.
|
|---|
| 218 |
|
|---|
| 219 | # Checks for system services
|
|---|
| 220 |
|
|---|
| 221 | # we save the cache here because the tests below fail more commonly
|
|---|
| 222 |
|
|---|
| 223 | AC_CONFIG_FILES([Makefile
|
|---|
| 224 | src/Makefile
|
|---|
| 225 | doc/Makefile
|
|---|
| 226 | test/Makefile
|
|---|
| 227 | test/interfaces/Makefile
|
|---|
| 228 | test/unit_test/Makefile
|
|---|
| 229 | vmg_particles/Makefile])
|
|---|
| 230 | AC_OUTPUT
|
|---|