[7faa5c] | 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([libvmg_config.h])
|
---|
| 16 | AM_INIT_AUTOMAKE([1.7 dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects])
|
---|
| 17 |
|
---|
| 18 | # We use mostly C++, but may need Fortran compiler infos for Lapack.
|
---|
| 19 | AC_LANG([C++])
|
---|
| 20 |
|
---|
[ac9dc8] | 21 | # use libtool
|
---|
| 22 | LT_INIT([static])
|
---|
| 23 |
|
---|
[7faa5c] | 24 | # Release version switch
|
---|
| 25 | AC_MSG_CHECKING(whether to enable debug version)
|
---|
| 26 | AC_ARG_ENABLE([debug],
|
---|
| 27 | AS_HELP_STRING([--enable-debug], [Compile with debug settings]),
|
---|
| 28 | enable_debug=$enableval,
|
---|
| 29 | enable_debug="no")
|
---|
| 30 | AC_MSG_RESULT($enable_debug)
|
---|
| 31 | AS_IF([test "$enable_debug" = "no"], [
|
---|
| 32 | AC_DEFINE([RELEASE], [1], [Release])
|
---|
| 33 | AC_DEFINE([NDEBUG], [1], [Skip asserts])
|
---|
| 34 | ])
|
---|
| 35 |
|
---|
| 36 | # One-sided communications
|
---|
| 37 | AC_MSG_CHECKING(whether to enable one-sided MPI2 communications)
|
---|
| 38 | AC_ARG_ENABLE([one_sided],
|
---|
| 39 | AS_HELP_STRING([--enable-one-sided], [Enable use of one-sided communications as according to MPI2 standard]),
|
---|
| 40 | enable_one_sided=$enableval,
|
---|
| 41 | enable_one_sided="no")
|
---|
| 42 | AC_MSG_RESULT($enable_one_sided)
|
---|
| 43 | AS_IF([test "$enable_one_sided" = "yes"], [
|
---|
| 44 | AC_DEFINE([VMG_ONE_SIDED], [1], [Enable use of one-sided MPI2 communications])
|
---|
| 45 | ])
|
---|
| 46 |
|
---|
| 47 | # Interpolating B-Spline degree
|
---|
| 48 | AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be in [3-6].])
|
---|
| 49 | if test -z "$BSPLINE_DEG"
|
---|
| 50 | then
|
---|
| 51 | BSPLINE_DEG=3
|
---|
| 52 | fi
|
---|
| 53 | AC_MSG_CHECKING(interpolation b-spline degree)
|
---|
| 54 | AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree])
|
---|
| 55 | AC_MSG_RESULT(${BSPLINE_DEG})
|
---|
| 56 |
|
---|
| 57 | # Debugging switches
|
---|
| 58 | AC_MSG_CHECKING(whether to enable debugging)
|
---|
| 59 | AC_ARG_ENABLE([debug],
|
---|
| 60 | AS_HELP_STRING([--enable-debug], [Enable debugging]),
|
---|
| 61 | enable_debug=$enableval,
|
---|
| 62 | enable_debug="no")
|
---|
| 63 | AS_IF([test "x$enable_fcs_debug" != "x"],[enable_debug="yes"])
|
---|
| 64 | AC_MSG_RESULT($enable_debug)
|
---|
| 65 | AS_IF([test "$enable_debug" = "yes"], [
|
---|
| 66 | CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"}
|
---|
| 67 | AC_DEFINE([DEBUG], [1], [Debugging])
|
---|
| 68 | ])
|
---|
| 69 |
|
---|
| 70 | AC_MSG_CHECKING(whether to enable debug checking of matrices)
|
---|
| 71 | AC_ARG_ENABLE([debug-check-matrices],
|
---|
| 72 | AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks]),
|
---|
| 73 | enable_debug_check_matrices=$enableval,
|
---|
| 74 | enable_debug_check_matrices="no")
|
---|
| 75 | AC_MSG_RESULT($enable_debug_check_matrices)
|
---|
| 76 | AS_IF([test "$enable_debug_check_matrices" = "yes"], [
|
---|
| 77 | AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks])
|
---|
| 78 | ])
|
---|
| 79 |
|
---|
| 80 | AC_MSG_CHECKING(whether to enable MPE profiling)
|
---|
| 81 | AC_ARG_ENABLE([mpe],
|
---|
| 82 | AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling]),
|
---|
| 83 | enable_mpe=$enableval,
|
---|
| 84 | enable_mpe="no")
|
---|
| 85 | AC_MSG_RESULT($enable_mpe)
|
---|
| 86 |
|
---|
| 87 | AC_MSG_CHECKING(whether to enable MPI_Barrier debugging)
|
---|
| 88 | AC_ARG_ENABLE([debug-barrier],
|
---|
| 89 | AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging]),
|
---|
| 90 | enable_debug_barrier=$enableval,
|
---|
| 91 | enable_debug_barrier="no")
|
---|
| 92 | AC_MSG_RESULT($enable_debug_barrier)
|
---|
| 93 | AS_IF([test "$enable_debug_barrier" = "yes"], [
|
---|
| 94 | AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging])
|
---|
| 95 | ])
|
---|
| 96 |
|
---|
| 97 | # Several output switches
|
---|
| 98 | AC_MSG_CHECKING(whether to enable info output)
|
---|
| 99 | AC_ARG_ENABLE([output-info],
|
---|
| 100 | AS_HELP_STRING([--enable-output-info], [Enable info output]),
|
---|
| 101 | enable_output_info=$enableval,
|
---|
| 102 | enable_output_info="no")
|
---|
| 103 | AS_IF([test "x$enable_fcs_info" != "x"],[enable_output_info="yes"])
|
---|
| 104 | AC_MSG_RESULT($enable_output_info)
|
---|
| 105 | AS_IF([test "$enable_output_info" = "yes"], [
|
---|
| 106 | AC_DEFINE([OUTPUT_INFO], [1], [Output level info])
|
---|
| 107 | ])
|
---|
| 108 |
|
---|
| 109 | AC_MSG_CHECKING(whether to enable debug output)
|
---|
| 110 | AC_ARG_ENABLE([output-debug],
|
---|
| 111 | AS_HELP_STRING([--enable-output-debug], [Enable debug output]),
|
---|
| 112 | enable_output_debug=$enableval,
|
---|
| 113 | enable_output_debug="no")
|
---|
| 114 | AS_IF([test "x$enable_fcs_debug" != "x"],[enable_output_debug="yes"])
|
---|
| 115 | AC_MSG_RESULT($enable_output_debug)
|
---|
| 116 | AS_IF([test "$enable_output_debug" = "yes"], [
|
---|
| 117 | AC_DEFINE([OUTPUT_DEBUG], [1], [Output level debug])
|
---|
| 118 | ])
|
---|
| 119 |
|
---|
| 120 | AC_MSG_CHECKING(whether to enable timing output)
|
---|
| 121 | AC_ARG_ENABLE([output-timing],
|
---|
| 122 | AS_HELP_STRING([--enable-output-timing], [Enable timing output]),
|
---|
| 123 | enable_output_timing=$enableval,
|
---|
| 124 | enable_output_timing="no")
|
---|
| 125 | AS_IF([test "x$enable_fcs_timing" != "x"],[enable_output_timing="yes"])
|
---|
| 126 | AC_MSG_RESULT($enable_output_timing)
|
---|
| 127 | AS_IF([test "$enable_output_timing" = "yes"], [
|
---|
| 128 | AC_DEFINE([OUTPUT_TIMING], [1], [Output level timing])
|
---|
| 129 | ])
|
---|
| 130 |
|
---|
| 131 |
|
---|
| 132 | # Checks for programs.
|
---|
| 133 | AM_MISSING_PROG([DOXYGEN], [doxygen])
|
---|
| 134 |
|
---|
| 135 | # 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).
|
---|
| 136 | AX_PROG_CC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI C compiler.]))
|
---|
| 137 |
|
---|
| 138 | # Do not even look for a non-MPI C++ compiler if MPICXX is set.
|
---|
| 139 | if test -n "$MPICXX" && test -z "$CXX"; then
|
---|
| 140 | CXX=$MPICXX
|
---|
| 141 | fi
|
---|
| 142 | ACX_MPI([AC_DEFINE([HAVE_MPI], [1],
|
---|
| 143 | [Define if building the MPI parallel version])
|
---|
| 144 | CXX=$MPICXX
|
---|
| 145 | LIBS="$MPILIBS $LIBS"
|
---|
| 146 | AC_DEFINE([MPICH_SKIP_MPICXX], [1], [Skip C++ bindings])
|
---|
| 147 | AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])
|
---|
| 148 | AC_DEFINE([MPI_NO_CPPBIND], [1], [Skip C++ bindings])
|
---|
| 149 | AC_DEFINE([_MPICC_H], [1], [Skip C++ bindings])
|
---|
| 150 | AC_DEFINE([MPIBULL_SKIP_MPICXX], [1], [Skip C++ bindings])]
|
---|
| 151 | if test "$enable_mpe" = "yes"; then
|
---|
| 152 | AC_DEFINE([HAVE_MPE], [1], [Use MPE parallel profiler])
|
---|
| 153 | fi,
|
---|
| 154 | [AC_DEFINE([sequent], [1],
|
---|
| 155 | [Define if building the serial version])])
|
---|
| 156 |
|
---|
| 157 | # Get the Fortran MPI compiler, for Lapack.
|
---|
| 158 | AC_LANG_PUSH([Fortran])
|
---|
| 159 | # Do not even look for a non-MPI Fortran compiler if MPIFC is set.
|
---|
| 160 | AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI Fortran compiler.]))
|
---|
| 161 |
|
---|
| 162 | # Find out how to call Fortran functions from C.
|
---|
| 163 | AC_FC_WRAPPERS
|
---|
| 164 | AC_LANG_POP([Fortran])
|
---|
| 165 |
|
---|
| 166 | # Check for the restrict keyword.
|
---|
| 167 | AC_C_RESTRICT
|
---|
| 168 |
|
---|
| 169 | AM_OPTIONS_VTK
|
---|
| 170 | AM_PATH_VTK([5.8.0],
|
---|
| 171 | [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
|
---|
| 172 |
|
---|
| 173 | AC_SUBST([VTK_CXXFLAGS])
|
---|
| 174 | AC_SUBST([VTK_LDFLAGS])
|
---|
| 175 | AC_SUBST([VTK_LIBS])
|
---|
| 176 |
|
---|
| 177 | # Boost
|
---|
| 178 | BOOST_REQUIRE([1.34])
|
---|
| 179 |
|
---|
| 180 | # Boost headers with libraries
|
---|
| 181 | BOOST_SYSTEM
|
---|
| 182 | BOOST_FILESYSTEM
|
---|
| 183 | BOOST_TEST
|
---|
| 184 |
|
---|
| 185 | AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST], [test x"$boost_cv_lib_unit_test_framework" = xyes])
|
---|
| 186 | AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST_LIB], [test x"$boost_cv_lib_unit_test_framework" = xyes])
|
---|
| 187 |
|
---|
| 188 | # use libtool
|
---|
| 189 | LT_INIT([static])
|
---|
[4e8108] | 190 | AC_SUBST([LIBTOOL_DEPS])
|
---|
[7faa5c] | 191 |
|
---|
[4e8108] | 192 | dnl superceded by libtool
|
---|
| 193 | dnl AC_PROG_RANLIB
|
---|
| 194 | dnl 4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
---|
[7faa5c] | 195 |
|
---|
| 196 | # Define these substitions here to keep all version information in one place.
|
---|
| 197 | # For information on how to properly maintain the library version information,
|
---|
| 198 | # refer to the libtool manual, section "Updating library version information":
|
---|
| 199 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
---|
| 200 | AC_SUBST([VMG_SO_VERSION], [1:0:0])
|
---|
| 201 | AC_SUBST([VMG_API_VERSION], [1.0.0])
|
---|
| 202 |
|
---|
| 203 | # Checks for libraries.
|
---|
| 204 | AC_CHECK_LIB([m], [sqrt])
|
---|
| 205 | AX_LAPACK
|
---|
| 206 | AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
|
---|
| 207 |
|
---|
| 208 | # Checks for header files.
|
---|
| 209 |
|
---|
| 210 | # Checks for types.
|
---|
| 211 |
|
---|
| 212 | # Set up FCS library arguments.
|
---|
| 213 | m4_ifdef([AX_FCS_CONFIG_SOLVER_ARGS],[AX_FCS_CONFIG_SOLVER_ARGS])
|
---|
| 214 |
|
---|
| 215 | # Set up FCS library.
|
---|
| 216 | m4_ifdef([AX_FCS_CONFIG_SOLVER],[AX_FCS_CONFIG_SOLVER])
|
---|
| 217 |
|
---|
| 218 | # Set up FCS types
|
---|
| 219 | m4_ifdef([AX_FCS_TYPES],
|
---|
| 220 | [AC_DEFINE([vmg_float], [fcs_float],
|
---|
| 221 | [Define to the primary interface and computation floating type.])
|
---|
| 222 | AC_DEFINE([vmg_int], [fcs_int],
|
---|
| 223 | [Define to the primary integer type for particle indices.])],
|
---|
| 224 | [AC_DEFINE([vmg_float], [double],
|
---|
| 225 | [Define to the primary interface and computation floating type.])
|
---|
| 226 | AC_DEFINE([vmg_int], [int],
|
---|
| 227 | [Define to the primary integer type for particle indices.])])
|
---|
| 228 |
|
---|
| 229 | # Set up information for FCS package if inside the FCS tree.
|
---|
| 230 | have_fcs="no"
|
---|
| 231 | m4_ifdef([AX_FCS_PACKAGE_RESET],[
|
---|
| 232 | AX_FCS_PACKAGE_RESET
|
---|
| 233 | AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lfcs_vmg])
|
---|
| 234 | AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libfcs_vmg.a])
|
---|
| 235 | AX_FCS_PACKAGE_ADD([vmg_LDADD],[$VTK_LDFLAGS $VTK_LIBS $BOOST_SYSTEM_LDFLAGS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LDFLAGS $BOOST_FILESYSTEM_LIBS $LAPACK_LIBS $BLAS_LIBS])
|
---|
| 236 | AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes])
|
---|
| 237 | have_fsc="yes"
|
---|
| 238 | ])
|
---|
| 239 | AM_CONDITIONAL(COND_HAVE_FCS, [test x"have_fcs" = xyes])
|
---|
| 240 |
|
---|
| 241 | # Checks for structures.
|
---|
| 242 |
|
---|
| 243 | # Checks for compiler characteristics.
|
---|
| 244 |
|
---|
| 245 | # Checks for library functions.
|
---|
| 246 |
|
---|
| 247 | # Checks for system services
|
---|
| 248 |
|
---|
| 249 | # we save the cache here because the tests below fail more commonly
|
---|
| 250 |
|
---|
| 251 | # package information
|
---|
| 252 | AC_CONFIG_FILES([
|
---|
| 253 | VMG.pc:VMG.pc.in])
|
---|
| 254 |
|
---|
| 255 | AC_CONFIG_FILES([Makefile
|
---|
| 256 | src/Makefile
|
---|
| 257 | doc/Makefile
|
---|
| 258 | test/Makefile])
|
---|
| 259 |
|
---|
| 260 | AC_OUTPUT
|
---|