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