# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.60]) AC_INIT([VMG], [0.1], [tremolo-devel@ins.uni-bonn.de]) AC_MSG_NOTICE([****************************************************************]) AC_MSG_NOTICE([* Configuring solver VMG *]) AC_MSG_NOTICE([****************************************************************]) AC_CONFIG_SRCDIR([src/mg.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.7 -Wall foreign]) # We use mostly C++, but may need Fortran compiler infos for Lapack. AC_LANG([C++]) AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging])) AS_IF([test "$enable_debug" = "yes"], [ CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"} AC_DEFINE([DEBUG], [1], [Debugging output]) ]) AC_ARG_ENABLE([debug-check-matrices], AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks])) AS_IF([test "$enable_debug_check_matrices" = "yes"], [ AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks]) ]) AC_ARG_ENABLE([debug-output], AS_HELP_STRING([--enable-debug-output], [Enable debugging output])) AS_IF([test "$enable_debug_output" = "yes"], [ AC_DEFINE([DEBUG_OUTPUT], [1], [Debugging output]) ]) AC_ARG_ENABLE([mpe], AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling])) AC_ARG_ENABLE([debug-measure-time], AS_HELP_STRING([--enable-debug-measure-time], [Enable runtime measurement])) AS_IF([test "$enable_debug_measure_time" = "yes"], [ AC_DEFINE([DEBUG_MEASURE_TIME], [1], [Runtime measurement]) ]) AC_ARG_ENABLE([debug-barrier], AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging])) AS_IF([test "$enable_debug_barrier" = "yes"], [ AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging]) ]) AC_ARG_ENABLE([release], AS_HELP_STRING([--enable-release], [Compile with release settings])) AS_IF([test "$enable_release" = "yes"], [ AC_DEFINE([RELEASE], [1], [Release]), AC_DEFINE([NDEBUG], [1], [Skip asserts]) ]) AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be [3-6].]) if test -z "$BSPLINE_DEG" then BSPLINE_DEG=3 fi AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree]) # Checks for programs. AM_MISSING_PROG([DOXYGEN], [doxygen]) # 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). AX_PROG_CC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI C compiler.])) # Do not even look for a non-MPI C++ compiler if MPICXX is set. if test -n "$MPICXX" && test -z "$CXX"; then CXX=$MPICXX fi ACX_MPI([AC_DEFINE([HAVE_MPI], [1], [Define if building the MPI parallel version]) CXX=$MPICXX LIBS="$MPILIBS $LIBS" AC_DEFINE([MPICH_SKIP_CXX], [1], [Skip C++ bindings]) AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])] if test "$enable_mpe" = "yes"; then AC_DEFINE([HAVE_MPE], [1], [Use MPE parallel profiler]) fi, [AC_DEFINE([sequent], [1], [Define if building the serial version])]) # Get the Fortran MPI compiler, for Lapack. AC_LANG_PUSH([Fortran]) # Do not even look for a non-MPI Fortran compiler if MPIFC is set. AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The VMG solver requires an MPI Fortran compiler.])) # Find out how to call Fortran functions from C. AC_FC_WRAPPERS AC_LANG_POP([Fortran]) # Check for the restrict keyword. AC_C_RESTRICT AM_OPTIONS_VTK AM_PATH_VTK([5.4.2], [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])]) AC_SUBST([VTK_CXXFLAGS]) AC_SUBST([VTK_LDFLAGS]) AX_BOOST_BASE([1.34]) AX_BOOST_SYSTEM AX_BOOST_FILESYSTEM AC_SUBST([LIBVMG]) LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)' AC_SUBST([LIBINTERFACES]) LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a' AC_PROG_RANLIB # Checks for libraries. AC_CHECK_LIB([m], [sqrt]) AX_LAPACK AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes]) AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit], [save_LIBS=$LIBS LIBS="-lcppunit $LIBS" AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include int main (void) { CppUnit::TestResult testresult; return 0; }]])], [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no]) LIBS=$save_LIBS ]) AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes]) # Checks for header files. # Checks for types. # Set up FCS types if inside the FCS tree. m4_ifdef([AX_FCS_TYPES], [AX_FCS_TYPES AC_DEFINE([vmg_float], [fcs_float], [Define to the primary interface and computation floating type.]) AC_DEFINE([vmg_int], [fcs_int], [Define to the primary integer type for particle indices.])], [AC_DEFINE([vmg_float], [double], [Define to the primary interface and computation floating type.]) AC_DEFINE([vmg_int], [int], [Define to the primary integer type for particle indices.])]) # Set up information for FCS package if inside the FCS tree. m4_ifdef([AX_FCS_PACKAGE_RESET],[ AX_FCS_PACKAGE_RESET AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lvmg]) AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libvmg.a]) AX_FCS_PACKAGE_ADD([vmg_LDADD],[$BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS]) AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes]) ]) # Checks for structures. # Checks for compiler characteristics. # Checks for library functions. # Checks for system services # we save the cache here because the tests below fail more commonly AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile test/Makefile test/interfaces/Makefile test/unit_test/Makefile vmg_particles/Makefile]) AC_OUTPUT