| [dfed1c] | 1 |
|
|---|
| [48b662] | 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 |
|
|---|
| [2fad0e0] | 8 | AC_MSG_NOTICE([****************************************************************])
|
|---|
| 9 | AC_MSG_NOTICE([* Configuring solver VMG *])
|
|---|
| 10 | AC_MSG_NOTICE([****************************************************************])
|
|---|
| [48b662] | 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 | AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging]))
|
|---|
| 22 |
|
|---|
| 23 | AS_IF([test "$enable_debug" = "yes"], [
|
|---|
| 24 | CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"}
|
|---|
| 25 | AC_DEFINE([DEBUG], [1], [Debugging output])
|
|---|
| 26 | ])
|
|---|
| 27 |
|
|---|
| [dfed1c] | 28 | AC_ARG_ENABLE([debug-check-matrices], AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks]))
|
|---|
| 29 |
|
|---|
| 30 | AS_IF([test "$enable_debug_check_matrices" = "yes"], [
|
|---|
| 31 | AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks])
|
|---|
| 32 | ])
|
|---|
| 33 |
|
|---|
| 34 | AC_ARG_ENABLE([debug-output], AS_HELP_STRING([--enable-debug-output], [Enable debugging output]))
|
|---|
| 35 |
|
|---|
| 36 | AS_IF([test "$enable_debug_output" = "yes"], [
|
|---|
| 37 | AC_DEFINE([DEBUG_OUTPUT], [1], [Debugging output])
|
|---|
| 38 | ])
|
|---|
| 39 |
|
|---|
| 40 | AC_ARG_ENABLE([mpe], AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling]))
|
|---|
| 41 |
|
|---|
| 42 | AC_ARG_ENABLE([debug-measure-time], AS_HELP_STRING([--enable-debug-measure-time], [Enable runtime measurement]))
|
|---|
| 43 |
|
|---|
| 44 | AS_IF([test "$enable_debug_measure_time" = "yes"], [
|
|---|
| 45 | AC_DEFINE([DEBUG_MEASURE_TIME], [1], [Runtime measurement])
|
|---|
| 46 | ])
|
|---|
| 47 |
|
|---|
| 48 | AC_ARG_ENABLE([debug-barrier], AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging]))
|
|---|
| 49 |
|
|---|
| 50 | AS_IF([test "$enable_debug_barrier" = "yes"], [
|
|---|
| 51 | AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging])
|
|---|
| 52 | ])
|
|---|
| 53 |
|
|---|
| 54 | AC_ARG_ENABLE([release], AS_HELP_STRING([--enable-release], [Compile with release settings]))
|
|---|
| 55 |
|
|---|
| 56 | AS_IF([test "$enable_release" = "yes"], [
|
|---|
| 57 | AC_DEFINE([RELEASE], [1], [Release]),
|
|---|
| 58 | AC_DEFINE([NDEBUG], [1], [Skip asserts])
|
|---|
| 59 | ])
|
|---|
| 60 |
|
|---|
| 61 | AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be [3-6].])
|
|---|
| 62 |
|
|---|
| 63 | if test -z "$BSPLINE_DEG"
|
|---|
| 64 | then
|
|---|
| 65 | BSPLINE_DEG=3
|
|---|
| 66 | fi
|
|---|
| 67 |
|
|---|
| 68 | AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree])
|
|---|
| 69 |
|
|---|
| [48b662] | 70 | # Checks for programs.
|
|---|
| 71 | AM_MISSING_PROG([DOXYGEN], [doxygen])
|
|---|
| 72 |
|
|---|
| [62f19a] | 73 | # 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).
|
|---|
| 74 | AX_PROG_CC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI C compiler.]))
|
|---|
| 75 |
|
|---|
| [48b662] | 76 | # Do not even look for a non-MPI C++ compiler if MPICXX is set.
|
|---|
| [dfed1c] | 77 | if test -n "$MPICXX" && test -z "$CXX"; then
|
|---|
| 78 | CXX=$MPICXX
|
|---|
| 79 | fi
|
|---|
| 80 | ACX_MPI([AC_DEFINE([HAVE_MPI], [1],
|
|---|
| 81 | [Define if building the MPI parallel version])
|
|---|
| 82 | CXX=$MPICXX
|
|---|
| 83 | LIBS="$MPILIBS $LIBS"
|
|---|
| 84 | AC_DEFINE([MPICH_SKIP_CXX], [1], [Skip C++ bindings])
|
|---|
| 85 | AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])]
|
|---|
| 86 | if test "$enable_mpe" = "yes"; then
|
|---|
| 87 | AC_DEFINE([HAVE_MPE], [1], [Use MPE parallel profiler])
|
|---|
| 88 | fi,
|
|---|
| 89 | [AC_DEFINE([sequent], [1],
|
|---|
| 90 | [Define if building the serial version])])
|
|---|
| [48b662] | 91 |
|
|---|
| 92 | # Get the Fortran MPI compiler, for Lapack.
|
|---|
| 93 | AC_LANG_PUSH([Fortran])
|
|---|
| 94 | # Do not even look for a non-MPI Fortran compiler if MPIFC is set.
|
|---|
| [62f19a] | 95 | AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI Fortran compiler.]))
|
|---|
| [48b662] | 96 |
|
|---|
| 97 | # Find out how to call Fortran functions from C.
|
|---|
| 98 | AC_FC_WRAPPERS
|
|---|
| 99 | AC_LANG_POP([Fortran])
|
|---|
| 100 |
|
|---|
| [62f19a] | 101 | # Check for the restrict keyword.
|
|---|
| 102 | AC_C_RESTRICT
|
|---|
| [48b662] | 103 |
|
|---|
| 104 | AM_OPTIONS_VTK
|
|---|
| [dfed1c] | 105 | AM_PATH_VTK([5.4.2],
|
|---|
| [48b662] | 106 | [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
|
|---|
| 107 |
|
|---|
| 108 | AC_SUBST([VTK_CXXFLAGS])
|
|---|
| 109 | AC_SUBST([VTK_LDFLAGS])
|
|---|
| 110 |
|
|---|
| [dfed1c] | 111 | AX_BOOST_BASE([1.34])
|
|---|
| [336861] | 112 | AX_BOOST_SYSTEM
|
|---|
| [48b662] | 113 | AX_BOOST_FILESYSTEM
|
|---|
| 114 |
|
|---|
| 115 | AC_SUBST([LIBVMG])
|
|---|
| [336861] | 116 | LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)'
|
|---|
| [48b662] | 117 |
|
|---|
| 118 | AC_SUBST([LIBINTERFACES])
|
|---|
| 119 | LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a'
|
|---|
| 120 |
|
|---|
| 121 | AC_PROG_RANLIB
|
|---|
| 122 |
|
|---|
| 123 | # Checks for libraries.
|
|---|
| 124 | AC_CHECK_LIB([m], [sqrt])
|
|---|
| 125 | AX_LAPACK
|
|---|
| 126 | AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
|
|---|
| 127 |
|
|---|
| 128 | AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit],
|
|---|
| 129 | [save_LIBS=$LIBS
|
|---|
| 130 | LIBS="-lcppunit $LIBS"
|
|---|
| 131 | AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
|---|
| 132 | #include <cppunit/TestResult.h>
|
|---|
| 133 | int main (void)
|
|---|
| 134 | {
|
|---|
| 135 | CppUnit::TestResult testresult;
|
|---|
| 136 | return 0;
|
|---|
| 137 | }]])],
|
|---|
| 138 | [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no])
|
|---|
| 139 | LIBS=$save_LIBS
|
|---|
| 140 | ])
|
|---|
| 141 | AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes])
|
|---|
| 142 |
|
|---|
| 143 | # Checks for header files.
|
|---|
| 144 |
|
|---|
| 145 | # Checks for types.
|
|---|
| 146 |
|
|---|
| [dfed1c] | 147 | # Set up FCS types if inside the FCS tree.
|
|---|
| 148 | m4_ifdef([AX_FCS_TYPES],
|
|---|
| 149 | [AX_FCS_TYPES
|
|---|
| [48b662] | 150 | AC_DEFINE([vmg_float], [fcs_float],
|
|---|
| 151 | [Define to the primary interface and computation floating type.])
|
|---|
| 152 | AC_DEFINE([vmg_int], [fcs_int],
|
|---|
| 153 | [Define to the primary integer type for particle indices.])],
|
|---|
| 154 | [AC_DEFINE([vmg_float], [double],
|
|---|
| 155 | [Define to the primary interface and computation floating type.])
|
|---|
| 156 | AC_DEFINE([vmg_int], [int],
|
|---|
| 157 | [Define to the primary integer type for particle indices.])])
|
|---|
| 158 |
|
|---|
| [8e985b] | 159 | # Set up information for FCS package if inside the FCS tree.
|
|---|
| 160 | m4_ifdef([AX_FCS_PACKAGE_RESET],[
|
|---|
| 161 | AX_FCS_PACKAGE_RESET
|
|---|
| [7853e0e] | 162 | AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lvmg])
|
|---|
| 163 | AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libvmg.a])
|
|---|
| 164 | AX_FCS_PACKAGE_ADD([vmg_LDADD],[$BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
|
|---|
| [c2f74f] | 165 | AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes])
|
|---|
| [8e985b] | 166 | ])
|
|---|
| 167 |
|
|---|
| [48b662] | 168 | # Checks for structures.
|
|---|
| 169 |
|
|---|
| 170 | # Checks for compiler characteristics.
|
|---|
| 171 |
|
|---|
| 172 | # Checks for library functions.
|
|---|
| 173 |
|
|---|
| 174 | # Checks for system services
|
|---|
| 175 |
|
|---|
| 176 | # we save the cache here because the tests below fail more commonly
|
|---|
| 177 |
|
|---|
| 178 | AC_CONFIG_FILES([Makefile
|
|---|
| 179 | src/Makefile
|
|---|
| 180 | doc/Makefile
|
|---|
| 181 | test/Makefile
|
|---|
| 182 | test/interfaces/Makefile
|
|---|
| [dfed1c] | 183 | test/unit_test/Makefile
|
|---|
| 184 | vmg_particles/Makefile])
|
|---|
| [48b662] | 185 | AC_OUTPUT
|
|---|