[bf4b9f] | 1 | # -*- Autoconf -*-
|
---|
| 2 | # Process this file with autoconf to produce a configure script.
|
---|
| 3 |
|
---|
| 4 | AC_PREREQ(2.59)
|
---|
[dc8827] | 5 | AC_INIT(LinearAlgebra, 1.0.2, [heber@ins.uni-bonn.de], [molecuilder], [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)
|
---|
| 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
|
---|
[dc8827] | 33 | AC_SUBST([LINEARALGEBRA_SO_VERSION], [2:0:0])
|
---|
| 34 | AC_SUBST([LINEARALGEBRA_API_VERSION], [1.0.2])
|
---|
[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)
|
---|
| 40 | default="no"
|
---|
| 41 | have_debug="no"
|
---|
| 42 | AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes/full] turn on debugging
|
---|
| 43 | [default=$default]],, enable_debug=$default)
|
---|
| 44 | if test "x$enable_debug" = "xyes"; then
|
---|
| 45 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
|
---|
| 46 | AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
|
---|
| 47 | have_debug="yes"
|
---|
| 48 | elif test "x$enable_debug" = "xfull"; then
|
---|
| 49 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
|
---|
| 50 | AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
|
---|
| 51 | AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
|
---|
| 52 | have_debug="full"
|
---|
| 53 | else
|
---|
| 54 | AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
|
---|
| 55 | AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
|
---|
| 56 | have_debug="no"
|
---|
| 57 | fi
|
---|
| 58 | AC_MSG_RESULT($have_debug)
|
---|
| 59 | AC_SUBST(HAVE_DEBUG)
|
---|
| 60 |
|
---|
| 61 | dnl this macro is used to get the arguments supplied
|
---|
| 62 | dnl to the configure script (./configure --enable-debug)
|
---|
| 63 | dnl Check if we have enable debug support.
|
---|
| 64 | AC_MSG_CHECKING([whether to enable internal caching of values (speedup!)])
|
---|
| 65 | default="yes"
|
---|
| 66 | AC_ARG_ENABLE(cache, [ --enable-cache=[no/yes] turn on caching
|
---|
| 67 | [default=$default]],, enable_cache=$default)
|
---|
| 68 | if test "x$enable_cache" = "xno"; then
|
---|
| 69 | AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
|
---|
| 70 | AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
|
---|
| 71 | AC_MSG_RESULT(no)
|
---|
| 72 | else
|
---|
| 73 | AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
|
---|
| 74 | AC_MSG_RESULT(yes)
|
---|
| 75 | fi
|
---|
| 76 | AC_SUBST(HAVE_CACHE)
|
---|
| 77 |
|
---|
| 78 | #AC_MSG_CHECKING(whether to enable profiling)
|
---|
| 79 | #default="no"
|
---|
| 80 | #AC_ARG_ENABLE(debug, [ --enable-profile=[no/yes] turn on profiling
|
---|
| 81 | # [default=$default]],, enable_profile=$default)
|
---|
| 82 | #if test "x$enable_profile" = "xyes"; then
|
---|
| 83 | # CXXFLAGS="$CXXFLAGS -g -DDEBUG -pg"
|
---|
| 84 | # DEBUG=-pg;
|
---|
| 85 | # AC_MSG_RESULT(yes)
|
---|
| 86 | #else
|
---|
| 87 | # AC_MSG_RESULT(no)
|
---|
| 88 | #fi
|
---|
| 89 |
|
---|
| 90 | #AC_MSG_CHECKING(whether to enable serialization)
|
---|
| 91 | #default="no"
|
---|
| 92 | #AC_ARG_ENABLE(debug, [ --enable-serialization=[no/yes] turn on serialization support
|
---|
| 93 | # [default=$default]],, enable_serialization=$default)
|
---|
| 94 | #if test "x$enable_serialization" = "xyes"; then
|
---|
| 95 | # CXXFLAGS="$CXXFLAGS -DSERIALIZATION"
|
---|
| 96 | # serialization=yes;
|
---|
| 97 | # AC_MSG_RESULT(yes)
|
---|
| 98 | #else
|
---|
| 99 | # serialization=no;
|
---|
| 100 | # AC_MSG_RESULT(no)
|
---|
| 101 | #fi
|
---|
| 102 |
|
---|
| 103 | # Checks for libraries.
|
---|
| 104 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
|
---|
| 105 |
|
---|
| 106 | # CodePatterns library (needs operator<<(.., range<>) )
|
---|
| 107 | AM_PATH_CODEPATTERNS([1.0.13], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
|
---|
| 108 |
|
---|
[f08ae7] | 109 | # boost headers
|
---|
| 110 | BOOST_REQUIRE([1.40])
|
---|
| 111 | BOOST_BIND
|
---|
| 112 | BOOST_EXCEPTION
|
---|
| 113 |
|
---|
[bf4b9f] | 114 | # Checks for header files.
|
---|
| 115 | AC_HEADER_STDC
|
---|
| 116 | AC_CHECK_HEADERS([sys/time.h])
|
---|
| 117 | AC_HEADER_STDBOOL
|
---|
| 118 |
|
---|
| 119 | AC_FUNC_MALLOC
|
---|
| 120 | AC_FUNC_REALLOC
|
---|
| 121 | AC_CHECK_FUNCS([floor pow sqrt strchr])
|
---|
| 122 |
|
---|
| 123 | # Checks for typedefs, structures, and compiler characteristics.
|
---|
| 124 | AC_C_CONST
|
---|
| 125 | AC_C_INLINE
|
---|
| 126 | AC_C_RESTRICT
|
---|
| 127 | AC_TYPE_SIZE_T
|
---|
| 128 |
|
---|
| 129 | # Checks for library functions.
|
---|
| 130 | # check for GNU Scientific Library
|
---|
| 131 | AC_CHECK_HEADERS([gsl/gsl_blas.h])
|
---|
| 132 | AC_SEARCH_LIBS(dnrm2, goto blas cblas gslblas gslcblas)
|
---|
| 133 | AC_CHECK_LIB(gsl, main, [],
|
---|
| 134 | [AC_SEARCH_LIBS(cblas_dnrm2, blas cblas gslblas gslcblas)])
|
---|
| 135 | AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
|
---|
| 136 |
|
---|
| 137 |
|
---|
| 138 | # use CppUnit TestRunner or not
|
---|
| 139 | AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]),
|
---|
| 140 | [enable_ecut=$enableval], [enable_ecut=no])
|
---|
| 141 | if test x"$enable_ecut" = xyes; then
|
---|
| 142 | AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
|
---|
| 143 | AC_SUBST(HAVE_ECUT)
|
---|
| 144 | fi
|
---|
| 145 |
|
---|
| 146 | # with valgrinding testsuite or not
|
---|
| 147 | AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]),
|
---|
| 148 | [with_valgrind=$withval], [with_valgrind=no])
|
---|
| 149 | if test x"$with_valgrind" = xyes; then
|
---|
| 150 | AC_CHECK_HEADER([valgrind/valgrind.h],
|
---|
| 151 | [
|
---|
| 152 | # check header
|
---|
| 153 | AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
|
---|
| 154 | # check path
|
---|
| 155 | AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
|
---|
| 156 | # set variables
|
---|
| 157 | AC_SUBST(HAVE_VALGRIND_TESTSUITE)
|
---|
| 158 | AC_SUBST(VALGRIND)
|
---|
| 159 | ],
|
---|
| 160 | [
|
---|
| 161 | AC_MSG_ERROR(["Valgrind support requested but headers not available."])
|
---|
| 162 | ]
|
---|
| 163 | )
|
---|
| 164 | fi
|
---|
| 165 |
|
---|
| 166 | # Check for "extern inline", using a modified version
|
---|
| 167 | # of the test for AC_C_INLINE from acspecific.mt
|
---|
| 168 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
|
---|
| 169 | [ac_cv_c_extern_inline=no
|
---|
| 170 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
|
---|
| 171 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
|
---|
| 172 | double foo (double x) { return x + 1.0; };],
|
---|
| 173 | [ foo(1.0) ],
|
---|
| 174 | [ac_cv_c_extern_inline="yes"])
|
---|
| 175 | ])
|
---|
| 176 |
|
---|
| 177 | if test "$ac_cv_c_inline" != no ; then
|
---|
| 178 | AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
|
---|
| 179 | AC_SUBST(HAVE_INLINE)
|
---|
| 180 | fi
|
---|
| 181 |
|
---|
| 182 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
|
---|
| 183 |
|
---|
| 184 | # test suite
|
---|
[689639] | 185 | AC_CONFIG_TESTDIR(tests/CodeChecks)
|
---|
[bf4b9f] | 186 | AC_CONFIG_FILES([
|
---|
| 187 | tests/CodeChecks/atlocal
|
---|
| 188 | tests/CodeChecks/Makefile])
|
---|
[689639] | 189 |
|
---|
[bf4b9f] | 190 | AC_CONFIG_FILES([
|
---|
| 191 | LinearAlgebra.pc:LinearAlgebra.pc.in
|
---|
| 192 | LinearAlgebra-debug.pc:LinearAlgebra-debug.pc.in])
|
---|
[689639] | 193 |
|
---|
[bf4b9f] | 194 | AC_CONFIG_FILES([
|
---|
| 195 | Makefile
|
---|
| 196 | doc/Makefile
|
---|
| 197 | src/LinearAlgebra/Makefile
|
---|
| 198 | ])
|
---|
[689639] | 199 |
|
---|
[bf4b9f] | 200 | AC_CONFIG_FILES([
|
---|
| 201 | src/unittests/Makefile
|
---|
| 202 | ])
|
---|
| 203 | AC_OUTPUT
|
---|