# -*- 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([libvmg_config.h]) AM_INIT_AUTOMAKE([1.7 dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects]) # We use mostly C++, but may need Fortran compiler infos for Lapack. AC_LANG([C++]) # use libtool LT_INIT([static]) # Release version switch AC_MSG_CHECKING(whether to enable debug version) AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Compile with debug settings]), enable_debug=$enableval, enable_debug="no") AC_MSG_RESULT($enable_debug) AS_IF([test "$enable_debug" = "no"], [ AC_DEFINE([RELEASE], [1], [Release]) AC_DEFINE([NDEBUG], [1], [Skip asserts]) ]) # One-sided communications AC_MSG_CHECKING(whether to enable one-sided MPI2 communications) AC_ARG_ENABLE([one_sided], AS_HELP_STRING([--enable-one-sided], [Enable use of one-sided communications as according to MPI2 standard]), enable_one_sided=$enableval, enable_one_sided="no") AC_MSG_RESULT($enable_one_sided) AS_IF([test "$enable_one_sided" = "yes"], [ AC_DEFINE([VMG_ONE_SIDED], [1], [Enable use of one-sided MPI2 communications]) ]) # Interpolating B-Spline degree AC_ARG_VAR(BSPLINE_DEG, [Degree of interpolating B-Splines. Must be in [3-6].]) if test -z "$BSPLINE_DEG" then BSPLINE_DEG=3 fi AC_MSG_CHECKING(interpolation b-spline degree) AC_DEFINE_UNQUOTED([BSPLINE_DEGREE], ${BSPLINE_DEG}, [Interpolating B-Spline degree]) AC_MSG_RESULT(${BSPLINE_DEG}) # Debugging switches AC_MSG_CHECKING(whether to enable debugging) AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging]), enable_debug=$enableval, enable_debug="no") AS_IF([test "x$enable_fcs_debug" != "x"],[enable_debug="yes"]) AC_MSG_RESULT($enable_debug) AS_IF([test "$enable_debug" = "yes"], [ CXXFLAGS=${CXXFLAGS-"-g -O0 -Wall"} AC_DEFINE([DEBUG], [1], [Debugging]) ]) AC_MSG_CHECKING(whether to enable debug checking of matrices) AC_ARG_ENABLE([debug-check-matrices], AS_HELP_STRING([--enable-debug-check-matrices], [Enable matrix validity checks]), enable_debug_check_matrices=$enableval, enable_debug_check_matrices="no") AC_MSG_RESULT($enable_debug_check_matrices) AS_IF([test "$enable_debug_check_matrices" = "yes"], [ AC_DEFINE([DEBUG_MATRIX_CHECKS], [1], [Matrix validity checks]) ]) AC_MSG_CHECKING(whether to enable MPE profiling) AC_ARG_ENABLE([mpe], AS_HELP_STRING([--enable-mpe], [Enable MPE parallel profiling]), enable_mpe=$enableval, enable_mpe="no") AC_MSG_RESULT($enable_mpe) AC_MSG_CHECKING(whether to enable MPI_Barrier debugging) AC_ARG_ENABLE([debug-barrier], AS_HELP_STRING([--enable-debug-barrier], [Enable MPI_Barrier debugging]), enable_debug_barrier=$enableval, enable_debug_barrier="no") AC_MSG_RESULT($enable_debug_barrier) AS_IF([test "$enable_debug_barrier" = "yes"], [ AC_DEFINE([DEBUG_BARRIER], [1], [MPI_Barrier debugging]) ]) # Several output switches AC_MSG_CHECKING(whether to enable info output) AC_ARG_ENABLE([output-info], AS_HELP_STRING([--enable-output-info], [Enable info output]), enable_output_info=$enableval, enable_output_info="no") AS_IF([test "x$enable_fcs_info" != "x"],[enable_output_info="yes"]) AC_MSG_RESULT($enable_output_info) AS_IF([test "$enable_output_info" = "yes"], [ AC_DEFINE([OUTPUT_INFO], [1], [Output level info]) ]) AC_MSG_CHECKING(whether to enable debug output) AC_ARG_ENABLE([output-debug], AS_HELP_STRING([--enable-output-debug], [Enable debug output]), enable_output_debug=$enableval, enable_output_debug="no") AS_IF([test "x$enable_fcs_debug" != "x"],[enable_output_debug="yes"]) AC_MSG_RESULT($enable_output_debug) AS_IF([test "$enable_output_debug" = "yes"], [ AC_DEFINE([OUTPUT_DEBUG], [1], [Output level debug]) ]) AC_MSG_CHECKING(whether to enable timing output) AC_ARG_ENABLE([output-timing], AS_HELP_STRING([--enable-output-timing], [Enable timing output]), enable_output_timing=$enableval, enable_output_timing="no") AS_IF([test "x$enable_fcs_timing" != "x"],[enable_output_timing="yes"]) AC_MSG_RESULT($enable_output_timing) AS_IF([test "$enable_output_timing" = "yes"], [ AC_DEFINE([OUTPUT_TIMING], [1], [Output level timing]) ]) # 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_MPICXX], [1], [Skip C++ bindings]) AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings]) AC_DEFINE([MPI_NO_CPPBIND], [1], [Skip C++ bindings]) AC_DEFINE([_MPICC_H], [1], [Skip C++ bindings]) AC_DEFINE([MPIBULL_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.8.0], [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])]) AC_SUBST([VTK_CXXFLAGS]) AC_SUBST([VTK_LDFLAGS]) AC_SUBST([VTK_LIBS]) # Boost BOOST_REQUIRE([1.34]) # Boost headers with libraries BOOST_SYSTEM BOOST_FILESYSTEM BOOST_TEST AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST], [test x"$boost_cv_lib_unit_test_framework" = xyes]) AM_CONDITIONAL([COND_HAVE_BOOST_UNIT_TEST_LIB], [test x"$boost_cv_lib_unit_test_framework" = xyes]) # use libtool LT_INIT([static]) AC_SUBST([LIBTOOL_DEPS]) dnl superceded by libtool dnl AC_PROG_RANLIB dnl 4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # Define these substitions here to keep all version information in one place. # For information on how to properly maintain the library version information, # refer to the libtool manual, section "Updating library version information": # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST([VMG_SO_VERSION], [1:0:0]) AC_SUBST([VMG_API_VERSION], [1.0.0]) # Checks for libraries. AC_CHECK_LIB([m], [sqrt]) AX_LAPACK AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes]) # Checks for header files. # Checks for types. # Set up FCS library arguments. m4_ifdef([AX_FCS_CONFIG_SOLVER_ARGS],[AX_FCS_CONFIG_SOLVER_ARGS]) # Set up FCS library. m4_ifdef([AX_FCS_CONFIG_SOLVER],[AX_FCS_CONFIG_SOLVER]) # Set up FCS types m4_ifdef([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. have_fcs="no" m4_ifdef([AX_FCS_PACKAGE_RESET],[ AX_FCS_PACKAGE_RESET AX_FCS_PACKAGE_ADD([vmg_LIBS],[-lfcs_vmg]) AX_FCS_PACKAGE_ADD([vmg_LIBS_A],[src/libfcs_vmg.a]) 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]) AX_FCS_PACKAGE_ADD([CXXLIBS_USE],[yes]) have_fsc="yes" ]) AM_CONDITIONAL(COND_HAVE_FCS, [test x"have_fcs" = xyes]) # 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 # package information AC_CONFIG_FILES([ VMG.pc:VMG.pc.in]) AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile test/Makefile]) AC_OUTPUT