| 1 | #                                               -*- Autoconf -*-
 | 
|---|
| 2 | # Process this file with autoconf to produce a configure script.
 | 
|---|
| 3 | 
 | 
|---|
| 4 | AC_PREREQ(2.59)
 | 
|---|
| 5 | AC_INIT(LinearAlgebra, 1.0.0, [heber@ins.uni-bonn.de], [molecuilder], [http://trac.ins.uni-bonn.de/projects/molecuilder/])
 | 
|---|
| 6 | AC_CONFIG_AUX_DIR([build-aux])
 | 
|---|
| 7 | AC_CONFIG_SRCDIR([src/LinearAlgebra/Vector.cpp])
 | 
|---|
| 8 | AC_CONFIG_HEADER([config.h libLinearAlgebra_config.h])
 | 
|---|
| 9 | AC_CONFIG_MACRO_DIR([m4])
 | 
|---|
| 10 | 
 | 
|---|
| 11 | # parallel-tests: use parallel test druver
 | 
|---|
| 12 | # color-tests: us coloring to indicate success/failure when available
 | 
|---|
| 13 | # tar-pax: use newer tar implementation with longer filename (>99 chars)
 | 
|---|
| 14 | AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests tar-pax])
 | 
|---|
| 15 | 
 | 
|---|
| 16 | # Checks for programs.
 | 
|---|
| 17 | AM_PATH_CPPUNIT(1.9.6)
 | 
|---|
| 18 | AC_PROG_CXX
 | 
|---|
| 19 | AC_PROG_CC
 | 
|---|
| 20 | AC_PROG_INSTALL
 | 
|---|
| 21 | AC_CHECK_PROG([LATEX],[latex],[latex],[:])
 | 
|---|
| 22 | AC_CHECK_PROG([BIBTEX],[bibtex],[bibtex],[:])
 | 
|---|
| 23 | AC_CHECK_PROG([DVIPS],[dvips],[dvips],[:])
 | 
|---|
| 24 | AC_CHECK_PROG([PDFLATEX],[pdflatex],[pdflatex],[:])
 | 
|---|
| 25 | AC_CHECK_PROG([XMLTO],[xmlto],[xmlto],[:])
 | 
|---|
| 26 | AM_MISSING_PROG([DOXYGEN], [doxygen])
 | 
|---|
| 27 | 
 | 
|---|
| 28 | LT_INIT([static])
 | 
|---|
| 29 | 
 | 
|---|
| 30 | # Define these substitions here to keep all version information in one place.
 | 
|---|
| 31 | # For information on how to properly maintain the library version information,
 | 
|---|
| 32 | # refer to the libtool manual, section "Updating library version information":
 | 
|---|
| 33 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
 | 
|---|
| 34 | AC_SUBST([LINEARALGEBRA_SO_VERSION], [1:0:0])
 | 
|---|
| 35 | AC_SUBST([LINEARALGEBRA_API_VERSION], [1.0.0])
 | 
|---|
| 36 | 
 | 
|---|
| 37 | dnl this macro is used to get the arguments supplied
 | 
|---|
| 38 | dnl to the configure script (./configure --enable-debug)
 | 
|---|
| 39 | dnl Check if we have enable debug support.
 | 
|---|
| 40 | AC_MSG_CHECKING(whether to enable debugging)
 | 
|---|
| 41 | default="no"
 | 
|---|
| 42 | have_debug="no"
 | 
|---|
| 43 | AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes/full] turn on debugging
 | 
|---|
| 44 |                      [default=$default]],, enable_debug=$default)
 | 
|---|
| 45 | if test "x$enable_debug" = "xyes"; then
 | 
|---|
| 46 |   AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
 | 
|---|
| 47 |   AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
 | 
|---|
| 48 |   have_debug="yes"
 | 
|---|
| 49 | elif test "x$enable_debug" = "xfull"; then
 | 
|---|
| 50 |   AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
 | 
|---|
| 51 |   AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
 | 
|---|
| 52 |   AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
 | 
|---|
| 53 |   have_debug="full"
 | 
|---|
| 54 | else
 | 
|---|
| 55 |   AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
 | 
|---|
| 56 |   AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
 | 
|---|
| 57 |   have_debug="no"
 | 
|---|
| 58 | fi
 | 
|---|
| 59 | AC_MSG_RESULT($have_debug)
 | 
|---|
| 60 | AC_SUBST(HAVE_DEBUG)
 | 
|---|
| 61 | 
 | 
|---|
| 62 | dnl this macro is used to get the arguments supplied
 | 
|---|
| 63 | dnl to the configure script (./configure --enable-debug)
 | 
|---|
| 64 | dnl Check if we have enable debug support.
 | 
|---|
| 65 | AC_MSG_CHECKING([whether to enable internal caching of values (speedup!)])
 | 
|---|
| 66 | default="yes"
 | 
|---|
| 67 | AC_ARG_ENABLE(cache, [  --enable-cache=[no/yes] turn on caching
 | 
|---|
| 68 |                      [default=$default]],, enable_cache=$default)
 | 
|---|
| 69 | if test "x$enable_cache" = "xno"; then
 | 
|---|
| 70 |   AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
 | 
|---|
| 71 |   AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
 | 
|---|
| 72 |   AC_MSG_RESULT(no)
 | 
|---|
| 73 | else
 | 
|---|
| 74 |   AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
 | 
|---|
| 75 |   AC_MSG_RESULT(yes)
 | 
|---|
| 76 | fi
 | 
|---|
| 77 | AC_SUBST(HAVE_CACHE)
 | 
|---|
| 78 | 
 | 
|---|
| 79 | #AC_MSG_CHECKING(whether to enable profiling)
 | 
|---|
| 80 | #default="no"
 | 
|---|
| 81 | #AC_ARG_ENABLE(debug, [  --enable-profile=[no/yes] turn on profiling
 | 
|---|
| 82 | #                       [default=$default]],, enable_profile=$default)
 | 
|---|
| 83 | #if test "x$enable_profile" = "xyes"; then
 | 
|---|
| 84 | #  CXXFLAGS="$CXXFLAGS -g -DDEBUG -pg"
 | 
|---|
| 85 | #  DEBUG=-pg;
 | 
|---|
| 86 | #  AC_MSG_RESULT(yes)
 | 
|---|
| 87 | #else
 | 
|---|
| 88 | #  AC_MSG_RESULT(no)
 | 
|---|
| 89 | #fi
 | 
|---|
| 90 | 
 | 
|---|
| 91 | #AC_MSG_CHECKING(whether to enable serialization)
 | 
|---|
| 92 | #default="no"
 | 
|---|
| 93 | #AC_ARG_ENABLE(debug, [  --enable-serialization=[no/yes] turn on serialization support
 | 
|---|
| 94 | #                       [default=$default]],, enable_serialization=$default)
 | 
|---|
| 95 | #if test "x$enable_serialization" = "xyes"; then
 | 
|---|
| 96 | #  CXXFLAGS="$CXXFLAGS -DSERIALIZATION"
 | 
|---|
| 97 | #  serialization=yes;
 | 
|---|
| 98 | #  AC_MSG_RESULT(yes)
 | 
|---|
| 99 | #else
 | 
|---|
| 100 | #  serialization=no;
 | 
|---|
| 101 | #  AC_MSG_RESULT(no)
 | 
|---|
| 102 | #fi
 | 
|---|
| 103 | 
 | 
|---|
| 104 | # Checks for libraries.
 | 
|---|
| 105 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
 | 
|---|
| 106 | 
 | 
|---|
| 107 | # Boost libraries
 | 
|---|
| 108 | AX_BOOST_BASE([1.40])
 | 
|---|
| 109 | AX_BOOST_PROGRAM_OPTIONS
 | 
|---|
| 110 | AX_BOOST_SYSTEM
 | 
|---|
| 111 | AX_BOOST_FILESYSTEM
 | 
|---|
| 112 | AX_BOOST_THREAD
 | 
|---|
| 113 | #AX_BOOST_SERIALIZATION
 | 
|---|
| 114 | 
 | 
|---|
| 115 | # CodePatterns library (needs operator<<(.., range<>) ) 
 | 
|---|
| 116 | AM_PATH_CODEPATTERNS([1.0.13], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
 | 
|---|
| 117 | 
 | 
|---|
| 118 | # Checks for header files.
 | 
|---|
| 119 | AC_HEADER_STDC
 | 
|---|
| 120 | AC_CHECK_HEADERS([sys/time.h])
 | 
|---|
| 121 | AC_HEADER_STDBOOL
 | 
|---|
| 122 | 
 | 
|---|
| 123 | AC_FUNC_MALLOC
 | 
|---|
| 124 | AC_FUNC_REALLOC
 | 
|---|
| 125 | AC_CHECK_FUNCS([floor pow sqrt strchr])
 | 
|---|
| 126 | 
 | 
|---|
| 127 | # Checks for typedefs, structures, and compiler characteristics.
 | 
|---|
| 128 | AC_C_CONST
 | 
|---|
| 129 | AC_C_INLINE
 | 
|---|
| 130 | AC_C_RESTRICT
 | 
|---|
| 131 | AC_TYPE_SIZE_T
 | 
|---|
| 132 | 
 | 
|---|
| 133 | # Checks for library functions.
 | 
|---|
| 134 | # check for GNU Scientific Library
 | 
|---|
| 135 | AC_CHECK_HEADERS([gsl/gsl_blas.h])
 | 
|---|
| 136 | AC_SEARCH_LIBS(dnrm2, goto blas cblas gslblas gslcblas)
 | 
|---|
| 137 | AC_CHECK_LIB(gsl, main, [], 
 | 
|---|
| 138 |         [AC_SEARCH_LIBS(cblas_dnrm2, blas cblas gslblas gslcblas)])
 | 
|---|
| 139 | AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
 | 
|---|
| 140 | 
 | 
|---|
| 141 | 
 | 
|---|
| 142 | # use CppUnit TestRunner or not
 | 
|---|
| 143 | AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]),
 | 
|---|
| 144 |               [enable_ecut=$enableval], [enable_ecut=no])
 | 
|---|
| 145 | if test x"$enable_ecut" = xyes; then
 | 
|---|
| 146 |   AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
 | 
|---|
| 147 |   AC_SUBST(HAVE_ECUT)
 | 
|---|
| 148 | fi
 | 
|---|
| 149 | 
 | 
|---|
| 150 | # with valgrinding testsuite or not
 | 
|---|
| 151 | AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]),
 | 
|---|
| 152 |               [with_valgrind=$withval], [with_valgrind=no])
 | 
|---|
| 153 | if test x"$with_valgrind" = xyes; then
 | 
|---|
| 154 |   AC_CHECK_HEADER([valgrind/valgrind.h],
 | 
|---|
| 155 |     [
 | 
|---|
| 156 |       # check header
 | 
|---|
| 157 |       AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
 | 
|---|
| 158 |       # check path
 | 
|---|
| 159 |       AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
 | 
|---|
| 160 |       # set variables 
 | 
|---|
| 161 |       AC_SUBST(HAVE_VALGRIND_TESTSUITE)
 | 
|---|
| 162 |       AC_SUBST(VALGRIND)
 | 
|---|
| 163 |     ],
 | 
|---|
| 164 |     [
 | 
|---|
| 165 |       AC_MSG_ERROR(["Valgrind support requested but headers not available."])
 | 
|---|
| 166 |     ]
 | 
|---|
| 167 |   )
 | 
|---|
| 168 | fi
 | 
|---|
| 169 | 
 | 
|---|
| 170 | # Check for "extern inline", using a modified version
 | 
|---|
| 171 | # of the test for AC_C_INLINE from acspecific.mt
 | 
|---|
| 172 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
 | 
|---|
| 173 | [ac_cv_c_extern_inline=no
 | 
|---|
| 174 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
 | 
|---|
| 175 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
 | 
|---|
| 176 | double foo (double x) { return x + 1.0; };], 
 | 
|---|
| 177 | [  foo(1.0)  ],
 | 
|---|
| 178 | [ac_cv_c_extern_inline="yes"])
 | 
|---|
| 179 | ])
 | 
|---|
| 180 | 
 | 
|---|
| 181 | if test "$ac_cv_c_inline" != no ; then
 | 
|---|
| 182 |   AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
 | 
|---|
| 183 |   AC_SUBST(HAVE_INLINE)
 | 
|---|
| 184 | fi
 | 
|---|
| 185 | 
 | 
|---|
| 186 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
 | 
|---|
| 187 | 
 | 
|---|
| 188 | # test suite
 | 
|---|
| 189 | AC_CONFIG_FILES([
 | 
|---|
| 190 |         tests/CodeChecks/atlocal 
 | 
|---|
| 191 |         tests/CodeChecks/Makefile])
 | 
|---|
| 192 | AC_CONFIG_FILES([
 | 
|---|
| 193 |   LinearAlgebra.pc:LinearAlgebra.pc.in
 | 
|---|
| 194 |   LinearAlgebra-debug.pc:LinearAlgebra-debug.pc.in])
 | 
|---|
| 195 | AC_CONFIG_FILES([
 | 
|---|
| 196 |         Makefile 
 | 
|---|
| 197 |         doc/Makefile 
 | 
|---|
| 198 |         src/LinearAlgebra/Makefile 
 | 
|---|
| 199 | ])
 | 
|---|
| 200 | AC_CONFIG_FILES([
 | 
|---|
| 201 |         src/unittests/Makefile
 | 
|---|
| 202 | ])
 | 
|---|
| 203 | AC_OUTPUT
 | 
|---|