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