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