| 1 | # -*- Autoconf -*-
|
|---|
| 2 | # Process this file with autoconf to produce a configure script.
|
|---|
| 3 |
|
|---|
| 4 | AC_PREREQ([2.60])
|
|---|
| 5 | AC_INIT([VMG], [0.1], [tremolo-devel@ins.uni-bonn.de])
|
|---|
| 6 |
|
|---|
| 7 | AC_MSG_NOTICE([****************************************************************])
|
|---|
| 8 | AC_MSG_NOTICE([* Configuring solver VMG *])
|
|---|
| 9 | AC_MSG_NOTICE([****************************************************************])
|
|---|
| 10 |
|
|---|
| 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 | AC_DEFINE([DEBUGCMAT], [1], [Check matrices for nan])
|
|---|
| 27 | ])
|
|---|
| 28 |
|
|---|
| 29 | # Checks for programs.
|
|---|
| 30 | AM_MISSING_PROG([DOXYGEN], [doxygen])
|
|---|
| 31 |
|
|---|
| 32 | # Do not even look for a non-MPI C++ compiler if MPICXX is set.
|
|---|
| 33 | AX_PROG_CXX_MPI(,[AC_DEFINE([HAVE_MPI], [1],
|
|---|
| 34 | [Define if building the MPI parallel version])
|
|---|
| 35 | AC_DEFINE([MPICH_SKIP_CXX], [1], [Skip C++ bindings])
|
|---|
| 36 | AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])],
|
|---|
| 37 | [AC_DEFINE([sequent], [1],
|
|---|
| 38 | [Define if building the serial version])])
|
|---|
| 39 |
|
|---|
| 40 | # Get the Fortran MPI compiler, for Lapack.
|
|---|
| 41 | AC_LANG_PUSH([Fortran])
|
|---|
| 42 | # Do not even look for a non-MPI Fortran compiler if MPIFC is set.
|
|---|
| 43 | AX_PROG_FC_MPI(,,AC_MSG_FAILURE([The PP3MG solver requires an MPI Fortran compiler.]))
|
|---|
| 44 |
|
|---|
| 45 | # Find out how to call Fortran functions from C.
|
|---|
| 46 | AC_FC_WRAPPERS
|
|---|
| 47 | AC_LANG_POP([Fortran])
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | AM_OPTIONS_VTK
|
|---|
| 51 | AM_PATH_VTK([5.4.2],
|
|---|
| 52 | [AC_DEFINE([HAVE_VTK], [1], [VTK present on system])])
|
|---|
| 53 |
|
|---|
| 54 | AC_SUBST([VTK_CXXFLAGS])
|
|---|
| 55 | AC_SUBST([VTK_LDFLAGS])
|
|---|
| 56 |
|
|---|
| 57 | AX_BOOST_BASE
|
|---|
| 58 | AX_BOOST_FILESYSTEM
|
|---|
| 59 |
|
|---|
| 60 | AC_SUBST([LIBVMG])
|
|---|
| 61 | LIBVMG='$(top_builddir)/src/libvmg.a $(BOOST_FILESYSTEM_LIB)'
|
|---|
| 62 |
|
|---|
| 63 | AC_SUBST([LIBINTERFACES])
|
|---|
| 64 | LIBINTERFACES='$(top_builddir)/test/interfaces/libinterfaces.a'
|
|---|
| 65 |
|
|---|
| 66 | AC_PROG_RANLIB
|
|---|
| 67 |
|
|---|
| 68 | # Checks for libraries.
|
|---|
| 69 | AC_CHECK_LIB([m], [sqrt])
|
|---|
| 70 |
|
|---|
| 71 | AX_LAPACK
|
|---|
| 72 | AM_CONDITIONAL([HAVE_LAPACK], [test "x$ax_lapack_ok" = xyes])
|
|---|
| 73 |
|
|---|
| 74 | AC_CHECK_LIB([gsl], [gsl_qrng_init])
|
|---|
| 75 |
|
|---|
| 76 | AC_CACHE_CHECK([for cppunit], [vmg_cv_cppunit],
|
|---|
| 77 | [save_LIBS=$LIBS
|
|---|
| 78 | LIBS="-lcppunit $LIBS"
|
|---|
| 79 | AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
|---|
| 80 | #include <cppunit/TestResult.h>
|
|---|
| 81 | int main (void)
|
|---|
| 82 | {
|
|---|
| 83 | CppUnit::TestResult testresult;
|
|---|
| 84 | return 0;
|
|---|
| 85 | }]])],
|
|---|
| 86 | [vmg_cv_cppunit=yes], [vmg_cv_cppunit=no])
|
|---|
| 87 | LIBS=$save_LIBS
|
|---|
| 88 | ])
|
|---|
| 89 | AM_CONDITIONAL([HAVE_CPPUNIT], [test "$vmg_cv_cppunit" = yes])
|
|---|
| 90 |
|
|---|
| 91 | # Checks for header files.
|
|---|
| 92 |
|
|---|
| 93 | # Checks for types.
|
|---|
| 94 |
|
|---|
| 95 | # Set up FCS library arguments if inside the FCS tree.
|
|---|
| 96 | m4_ifdef([AX_FCS_CONFIG_SOLVER_ARGS],
|
|---|
| 97 | [AX_FCS_CONFIG_SOLVER_ARGS])
|
|---|
| 98 |
|
|---|
| 99 | # Set up FCS library if inside the FCS tree.
|
|---|
| 100 | m4_ifdef([AX_FCS_CONFIG_SOLVER],
|
|---|
| 101 | [AX_FCS_CONFIG_SOLVER
|
|---|
| 102 | AC_DEFINE([vmg_float], [fcs_float],
|
|---|
| 103 | [Define to the primary interface and computation floating type.])
|
|---|
| 104 | AC_DEFINE([vmg_int], [fcs_int],
|
|---|
| 105 | [Define to the primary integer type for particle indices.])],
|
|---|
| 106 | [AC_DEFINE([vmg_float], [double],
|
|---|
| 107 | [Define to the primary interface and computation floating type.])
|
|---|
| 108 | AC_DEFINE([vmg_int], [int],
|
|---|
| 109 | [Define to the primary integer type for particle indices.])])
|
|---|
| 110 |
|
|---|
| 111 | # Set up information for FCS package if inside the FCS tree.
|
|---|
| 112 | m4_ifdef([AX_FCS_PACKAGE_RESET],[
|
|---|
| 113 | AX_FCS_PACKAGE_RESET
|
|---|
| 114 | AX_FCS_PACKAGE_ADD([LIBS],[$BOOST_FILESYSTEM_LIB $LAPACK_LIBS $BLAS_LIBS])
|
|---|
| 115 | AX_FCS_PACKAGE_ADD([USE_CXXLIBS],[yes])
|
|---|
| 116 | ])
|
|---|
| 117 |
|
|---|
| 118 | # Checks for structures.
|
|---|
| 119 |
|
|---|
| 120 | # Checks for compiler characteristics.
|
|---|
| 121 |
|
|---|
| 122 | # Checks for library functions.
|
|---|
| 123 |
|
|---|
| 124 | # Checks for system services
|
|---|
| 125 |
|
|---|
| 126 | # we save the cache here because the tests below fail more commonly
|
|---|
| 127 |
|
|---|
| 128 | AC_CONFIG_FILES([Makefile
|
|---|
| 129 | src/Makefile
|
|---|
| 130 | doc/Makefile
|
|---|
| 131 | test/Makefile
|
|---|
| 132 | test/interfaces/Makefile
|
|---|
| 133 | test/unit_test/Makefile])
|
|---|
| 134 | AC_OUTPUT
|
|---|