[bf4b9f] | 1 | # -*- Autoconf -*-
|
---|
| 2 | # Process this file with autoconf to produce a configure script.
|
---|
| 3 |
|
---|
| 4 | AC_PREREQ(2.59)
|
---|
[d08ab3] | 5 | AC_INIT(LinearAlgebra, 1.0.4, [heber@ins.uni-bonn.de], [linearalgebra], [http://trac.ins.uni-bonn.de/projects/molecuilder/])
|
---|
[bf4b9f] | 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 |
|
---|
[dc322a] | 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])
|
---|
[bf4b9f] | 15 |
|
---|
| 16 | # Checks for programs.
|
---|
| 17 | AM_PATH_CPPUNIT(1.9.6)
|
---|
| 18 | AC_PROG_CXX
|
---|
| 19 | AC_PROG_CC
|
---|
| 20 | AC_PROG_INSTALL
|
---|
[ec188c] | 21 |
|
---|
| 22 | DX_HTML_FEATURE(ON)
|
---|
| 23 | DX_PS_FEATURE(OFF)
|
---|
| 24 | DX_PDF_FEATURE(OFF)
|
---|
[3158e6] | 25 | DX_INIT_DOXYGEN(LinearAlgebra, Doxyfile, ${docdir})
|
---|
[bf4b9f] | 26 |
|
---|
| 27 | LT_INIT([static])
|
---|
| 28 |
|
---|
| 29 | # Define these substitions here to keep all version information in one place.
|
---|
| 30 | # For information on how to properly maintain the library version information,
|
---|
| 31 | # refer to the libtool manual, section "Updating library version information":
|
---|
| 32 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
---|
[d08ab3] | 33 | AC_SUBST([LINEARALGEBRA_SO_VERSION], [3:1:0])
|
---|
| 34 | AC_SUBST([LINEARALGEBRA_API_VERSION], [1.0.4])
|
---|
[bf4b9f] | 35 |
|
---|
| 36 | dnl this macro is used to get the arguments supplied
|
---|
| 37 | dnl to the configure script (./configure --enable-debug)
|
---|
| 38 | dnl Check if we have enable debug support.
|
---|
| 39 | AC_MSG_CHECKING(whether to enable debugging)
|
---|
[f99714] | 40 | have_debug="no"
|
---|
| 41 | AC_ARG_ENABLE(
|
---|
| 42 | [debug],
|
---|
| 43 | AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]),
|
---|
| 44 | enable_debug=$enableval,
|
---|
| 45 | enable_debug="no")
|
---|
[f3b8a5] | 46 | AC_MSG_RESULT($enable_debug)
|
---|
[f99714] | 47 | AS_IF([test x"$enable_debug" = x"yes"],[
|
---|
[bf4b9f] | 48 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
|
---|
| 49 | AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
|
---|
[f99714] | 50 | have_debug="yes"
|
---|
| 51 | ],[
|
---|
| 52 | AS_IF([test x"$enable_debug" = x"full"],[
|
---|
| 53 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
|
---|
| 54 | AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
|
---|
| 55 | AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
|
---|
| 56 | AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."])
|
---|
| 57 | have_debug="full"
|
---|
| 58 | ],[
|
---|
| 59 | AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
|
---|
| 60 | AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
|
---|
| 61 | AC_DEFINE(QT_NO_DEBUG,, ["Disable Qt debug messages."])
|
---|
| 62 | have_debug="no"
|
---|
| 63 | ])
|
---|
| 64 | ])
|
---|
[bf4b9f] | 65 | AC_SUBST(HAVE_DEBUG)
|
---|
| 66 |
|
---|
| 67 | dnl this macro is used to get the arguments supplied
|
---|
| 68 | dnl to the configure script (./configure --enable-debug)
|
---|
| 69 | dnl Check if we have enable debug support.
|
---|
[f99714] | 70 | AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation)
|
---|
| 71 | AC_ARG_ENABLE(
|
---|
| 72 | [cache],
|
---|
| 73 | AS_HELP_STRING([--enable-cache],[turn on internal lazy evaluation [default=yes]]),
|
---|
| 74 | enable_cache=$enableval,
|
---|
| 75 | enable_cache="yes")
|
---|
[f3b8a5] | 76 | AC_MSG_RESULT($enable_cache)
|
---|
[f99714] | 77 | AS_IF([test x"$enable_cache" != x"no"],[
|
---|
| 78 | AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
|
---|
| 79 | ],[
|
---|
[bf4b9f] | 80 | AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
|
---|
| 81 | AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
|
---|
[f99714] | 82 | ])
|
---|
[bf4b9f] | 83 | AC_SUBST(HAVE_CACHE)
|
---|
| 84 |
|
---|
| 85 | # Checks for libraries.
|
---|
| 86 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
|
---|
| 87 |
|
---|
[c2e567] | 88 | # CodePatterns library (serialization header before MemDebug.hpp )
|
---|
| 89 | AM_PATH_CODEPATTERNS([1.1.5], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
|
---|
[bf4b9f] | 90 |
|
---|
[29cbe9] | 91 | # boost
|
---|
[f08ae7] | 92 | BOOST_REQUIRE([1.40])
|
---|
[29cbe9] | 93 |
|
---|
| 94 | # boost headers
|
---|
[f08ae7] | 95 | BOOST_BIND
|
---|
| 96 | BOOST_EXCEPTION
|
---|
| 97 |
|
---|
[29cbe9] | 98 | # boost libraries
|
---|
| 99 | BOOST_SERIALIZATION
|
---|
| 100 |
|
---|
[bf4b9f] | 101 | # Checks for header files.
|
---|
| 102 | AC_HEADER_STDC
|
---|
| 103 | AC_CHECK_HEADERS([sys/time.h])
|
---|
| 104 | AC_HEADER_STDBOOL
|
---|
| 105 |
|
---|
| 106 | AC_FUNC_MALLOC
|
---|
| 107 | AC_FUNC_REALLOC
|
---|
| 108 | AC_CHECK_FUNCS([floor pow sqrt strchr])
|
---|
| 109 |
|
---|
| 110 | # Checks for typedefs, structures, and compiler characteristics.
|
---|
| 111 | AC_C_CONST
|
---|
| 112 | AC_C_INLINE
|
---|
| 113 | AC_C_RESTRICT
|
---|
| 114 | AC_TYPE_SIZE_T
|
---|
| 115 |
|
---|
| 116 | # Checks for library functions.
|
---|
| 117 | # check for GNU Scientific Library
|
---|
| 118 | AC_CHECK_HEADERS([gsl/gsl_blas.h])
|
---|
[db1a72] | 119 | AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas)
|
---|
| 120 | AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas)
|
---|
| 121 | AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl)
|
---|
| 122 | #AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
|
---|
| 123 | AC_CHECK_LIB(gsl, main)
|
---|
[bf4b9f] | 124 |
|
---|
| 125 | # use CppUnit TestRunner or not
|
---|
[f99714] | 126 | AC_MSG_CHECKING(whether to enable ECut TestRunnerClient)
|
---|
| 127 | AC_ARG_ENABLE(
|
---|
| 128 | [ecut],
|
---|
| 129 | AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]),
|
---|
| 130 | enable_ecut=$disableval,
|
---|
| 131 | enable_ecut="no")
|
---|
| 132 | AC_MSG_RESULT($enable_ecut)
|
---|
| 133 | AS_IF([test x"$enable_ecut" = x"yes"],[
|
---|
[bf4b9f] | 134 | AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
|
---|
| 135 | AC_SUBST(HAVE_ECUT)
|
---|
[f99714] | 136 | ])
|
---|
[fbbcde] | 137 | AM_CONDITIONAL([CONDECUT], [test x"$enable_ecut" = x"yes"])
|
---|
[bf4b9f] | 138 |
|
---|
| 139 | # with valgrinding testsuite or not
|
---|
[f3b8a5] | 140 | AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite)
|
---|
[f99714] | 141 | AC_ARG_ENABLE(
|
---|
| 142 | [valgrind],
|
---|
| 143 | AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]),
|
---|
| 144 | enable_valgrind=$enableval,
|
---|
| 145 | enable_valgrind="no")
|
---|
| 146 | AC_MSG_RESULT($enable_valgrind)
|
---|
| 147 | AS_IF([test x"$enable_valgrind" = x"yes"], [
|
---|
[bf4b9f] | 148 | AC_CHECK_HEADER([valgrind/valgrind.h],
|
---|
| 149 | [
|
---|
| 150 | # check header
|
---|
| 151 | AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
|
---|
| 152 | # check path
|
---|
| 153 | AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
|
---|
| 154 | # set variables
|
---|
| 155 | AC_SUBST(HAVE_VALGRIND_TESTSUITE)
|
---|
| 156 | AC_SUBST(VALGRIND)
|
---|
| 157 | ],
|
---|
| 158 | [
|
---|
| 159 | AC_MSG_ERROR(["Valgrind support requested but headers not available."])
|
---|
| 160 | ]
|
---|
| 161 | )
|
---|
[f3b8a5] | 162 | ])
|
---|
[bf4b9f] | 163 |
|
---|
| 164 | # Check for "extern inline", using a modified version
|
---|
| 165 | # of the test for AC_C_INLINE from acspecific.mt
|
---|
| 166 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
|
---|
| 167 | [ac_cv_c_extern_inline=no
|
---|
| 168 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
|
---|
| 169 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
|
---|
| 170 | double foo (double x) { return x + 1.0; };],
|
---|
| 171 | [ foo(1.0) ],
|
---|
| 172 | [ac_cv_c_extern_inline="yes"])
|
---|
| 173 | ])
|
---|
| 174 |
|
---|
| 175 | if test "$ac_cv_c_inline" != no ; then
|
---|
| 176 | AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
|
---|
| 177 | AC_SUBST(HAVE_INLINE)
|
---|
| 178 | fi
|
---|
| 179 |
|
---|
| 180 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
|
---|
| 181 |
|
---|
| 182 | # test suite
|
---|
[689639] | 183 | AC_CONFIG_TESTDIR(tests/CodeChecks)
|
---|
[bf4b9f] | 184 | AC_CONFIG_FILES([
|
---|
| 185 | tests/CodeChecks/atlocal
|
---|
| 186 | tests/CodeChecks/Makefile])
|
---|
[689639] | 187 |
|
---|
[bf4b9f] | 188 | AC_CONFIG_FILES([
|
---|
| 189 | LinearAlgebra.pc:LinearAlgebra.pc.in
|
---|
| 190 | LinearAlgebra-debug.pc:LinearAlgebra-debug.pc.in])
|
---|
[689639] | 191 |
|
---|
[bf4b9f] | 192 | AC_CONFIG_FILES([
|
---|
| 193 | Makefile
|
---|
| 194 | doc/Makefile
|
---|
| 195 | src/LinearAlgebra/Makefile
|
---|
| 196 | ])
|
---|
[689639] | 197 |
|
---|
[bf4b9f] | 198 | AC_CONFIG_FILES([
|
---|
| 199 | src/unittests/Makefile
|
---|
| 200 | ])
|
---|
| 201 | AC_OUTPUT
|
---|