source: configure.ac@ 67a9d5

Last change on this file since 67a9d5 was 67a9d5, checked in by Frederik Heber <heber@…>, 11 years ago

FIX: QWT would fail compilation test when qt disabled or not found.

  • now we "notice" absent qt and don't try.
  • Property mode set to 100644
File size: 14.8 KB
Line 
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT(MoleCuilder, 1.4.8, [heber@ins.uni-bonn.de], [molecuilder], [http://trac.ins.uni-bonn.de/projects/molecuilder/])
6AC_CONFIG_AUX_DIR([build-aux])
7AC_CONFIG_SRCDIR([src/builder.cpp])
8AC_CONFIG_HEADER([config.h libmolecuilder_config.h])
9AC_CONFIG_MACRO_DIR([m4])
10AC_CONFIG_SUBDIRS([LinearAlgebra])
11
12# parallel-tests: use parallel test druver
13# color-tests: us coloring to indicate success/failure when available
14# tar-pax: use newer tar implementation with longer filename (>99 chars)
15AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects])
16
17# Checks for programs.
18AC_PROG_CXX
19AC_PROG_INSTALL
20
21# check for cppunit (taken from svn.apache.org/../xmlbeanscxx)
22AM_PATH_CPPUNIT(1.9.6)
23AM_CONDITIONAL(CONDCPPUNIT, test "$CPPUNIT_LIBS")
24
25dnl Check if we have enable python
26# python module
27AC_MSG_CHECKING(whether to enable python module)
28AC_ARG_ENABLE(
29 [python],
30 AS_HELP_STRING([--enable-python],[turn on python module [default=yes]]),
31 enable_python=$enableval,
32 enable_python="yes")
33AC_MSG_RESULT($enable_python)
34AS_IF([test x"$enable_python" != x"no"],[
35 # Python (for boost::python)
36 AM_PATH_PYTHON([2.2])
37 AX_PYTHON
38 AC_DEFINE(HAVE_PYTHON,1, ["Build python module and scripts."])
39])
40AM_CONDITIONAL([CONDPYTHON], [test x"$enable_python" != x"no"])
41AC_SUBST(HAVE_PYTHON)
42
43dnl Check whether no extra thread for ActionQueue shall be used
44AC_MSG_CHECKING(whether to enable ActionQueue's run thread)
45AC_ARG_ENABLE(
46 [action_thread],
47 AS_HELP_STRING([--enable-action-thread],[turn on extra run thread for ActionQueue [default=yes]]),
48 enable_action_thread=$enableval,
49 enable_action_thread="no"
50)
51AC_MSG_RESULT($enable_action_thread)
52AS_IF([test x"$enable_action_thread" != x"no"],[
53 AC_DEFINE(HAVE_ACTION_THREAD,1, ["Have extra run thread for ActionQueue."])
54])
55AM_CONDITIONAL([CONDACTIONTHREAD], [test x"$enable_action_thread" != x"no"])
56AC_SUBST(HAVE_ACTION_THREAD)
57
58dnl Check if we have enable qtgui
59# Qt programs
60AC_MSG_CHECKING(whether to enable Qt-based GUI)
61AC_ARG_ENABLE(
62 [qtgui],
63 AS_HELP_STRING([--enable-qtgui],[turn on Qt GUI compilation [default=yes]]),
64 enable_qtgui=$enableval,
65 enable_qtgui="yes")
66AC_MSG_RESULT($enable_qtgui)
67AS_IF([test x"$enable_qtgui" != x"no"],[
68 AC_ARG_WITH(
69 [Qt-bin],
70 [AS_HELP_STRING([--with-Qt-bin], [give path to Qt binaries])],
71 [have_qtgui_path=$withval],
72 have_qtgui_path="")
73 AC_PATH_PROGS([QT_MOC],
74 [moc-qt4 moc],
75 [AC_MSG_ERROR(["Qts moc not found, please use --with-Qt-bin."])],
76 [$have_qtgui_path]
77 )
78 AC_PATH_PROGS([QT_RCC],
79 [rcc-qt4 rcc],
80 [AC_MSG_ERROR(["Qts rcc not found, please use --with-Qt-bin."])],
81 [$have_qtgui_path]
82 )
83 AC_PATH_PROGS([QT_UIC],
84 [uic-qt4 uic],
85 [AC_MSG_ERROR(["Qts uic not found, please use --with-Qt-bin."])],
86 [$have_qtgui_path]
87 )
88 PKG_CHECK_MODULES([QT], [QtCore QtGui Qt3D], [
89 ])
90 AC_SUBST([QT_CFLAGS])
91 AC_SUBST([QT_LIBS])
92 AC_DEFINE(HAVE_QTGUI,1, ["Build Qt-based GUI"])
93])
94AM_CONDITIONAL([CONDQTGUI], [test x"$enable_qtgui" != x"no"])
95AC_SUBST(HAVE_QTGUI)
96
97# check additionally for QWT to enable plotting of potentials
98AS_IF([test x"$enable_qtgui" != x"no"],[
99AC_MSG_CHECKING(whether to enable Qwt-based plotting)
100#enable_qwt=yes
101AC_ARG_ENABLE(
102 [qwt],
103 AS_HELP_STRING([--enable-qwt],[turn on Qwt compilation [default=yes]]),
104 enable_qwt=$enableval,
105 enable_qwt="yes")
106AC_MSG_RESULT($enable_qwt)
107AS_IF([test x"$enable_qwt" != x"no"],[
108 MOL_AC_HAVE_QWT_IFELSE(
109 [
110 enable_qwt=yes
111 AC_DEFINE(HAVE_QWT,1, ["Build Qwt-based plotting"])
112 ],
113 [
114 enable_qwt=no
115 AC_MSG_WARN([Qwt not found, disabling plotting in QtUI.])
116 ]
117 )
118])
119],[
120 AC_MSG_NOTICE(["qwt disabled, as qt not found or disabled."])
121 enable_qwt=no
122])
123AM_CONDITIONAL([CONDQWT], [test x"$enable_qwt" != x"no"])
124AC_SUBST(HAVE_QWT)
125
126# use doxygen
127DX_HTML_FEATURE(ON)
128DX_PS_FEATURE(OFF)
129DX_PDF_FEATURE(OFF)
130DX_INIT_DOXYGEN(MoleCuilder, Doxyfile, ${docdir})
131
132# use docbook
133AX_CHECK_DOCBOOK
134
135# use libtool
136LT_INIT([static])
137
138# Define these substitions here to keep all version information in one place.
139# For information on how to properly maintain the library version information,
140# refer to the libtool manual, section "Updating library version information":
141# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
142AC_SUBST([MOLECUILDER_SO_VERSION], [14:1:0])
143AC_SUBST([MOLECUILDER_API_VERSION], [1.4.8])
144
145dnl this macro is used to get the arguments supplied
146dnl to the configure script (./configure --enable-debug)
147dnl Check if we have enable debug support.
148AC_MSG_CHECKING(whether to enable debugging)
149have_debug="no"
150AC_ARG_ENABLE(
151 [debug],
152 AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]),
153 enable_debug=$enableval,
154 enable_debug="no")
155AC_MSG_RESULT($enable_debug)
156AS_IF([test x"$enable_debug" = x"yes"],[
157 AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
158 AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
159 have_debug="yes"
160],[
161 AS_IF([test x"$enable_debug" = x"full"],[
162 AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
163 AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
164 AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
165 dnl AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."])
166 have_debug="full"
167 ],[
168 AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
169 AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
170 AC_DEFINE(QT_NO_DEBUG_OUTPUT,, ["Disable Qt debug messages."])
171 have_debug="no"
172 ])
173])
174AC_SUBST(HAVE_DEBUG)
175
176dnl this macro is used to get the arguments supplied
177dnl to the configure script (./configure --enable-debug)
178dnl Check if we have enable debug support.
179AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation)
180AC_ARG_ENABLE(
181 [cache],
182 AS_HELP_STRING([--enable-cache],[turn on internal lazy evaluation [default=yes]]),
183 enable_cache=$enableval,
184 enable_cache="yes")
185AC_MSG_RESULT($enable_cache)
186AS_IF([test x"$enable_cache" != x"no"],[
187 AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
188],[
189 AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
190 AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
191])
192AC_SUBST(HAVE_CACHE)
193
194# Checks for libraries.
195AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
196
197# Boost
198BOOST_REQUIRE([1.40])
199
200# Boost headers only
201BOOST_ANY
202BOOST_ARRAY
203BOOST_BIMAP
204BOOST_BIND
205BOOST_CAST
206BOOST_CONVERSION
207BOOST_EXCEPTION
208BOOST_FOREACH
209BOOST_FUNCTION
210BOOST_FUSION
211BOOST_GRAPH
212BOOST_ITERATOR
213BOOST_MULTIARRAY
214BOOST_MPL
215BOOST_PREPROCESSOR
216BOOST_RANDOM
217BOOST_SMART_PTR
218BOOST_STRING_ALGO
219BOOST_TOKENIZER
220
221# Boost headers with libraries
222BOOST_FILESYSTEM
223BOOST_IOSTREAMS
224BOOST_PROGRAM_OPTIONS
225AS_IF([test x"$enable_python" != x"no"], [BOOST_PYTHON])
226BOOST_SERIALIZATION
227BOOST_THREADS
228
229
230# CodePatterns library (extended toString.hpp)
231AM_PATH_CODEPATTERNS([1.2.7], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
232
233# JobMarket library (needs boost/archive/iserializer.hpp before MemDebug.hpp)
234AC_MSG_CHECKING(whether to enable jobmarket)
235AC_ARG_ENABLE(
236 [jobmarket],
237 AS_HELP_STRING([--enable-jobmarket],[turn on JobMarket feature [default=yes]]),
238 enable_jobmarket=$enableval,
239 enable_jobmarket="yes")
240AC_MSG_RESULT($enable_jobmarket)
241AS_IF([test x"$enable_jobmarket" != x"no"],[
242 # JobMarket library (needs SystemCommandJob with suffix)
243 AM_PATH_JOBMARKET([1.1.5], $have_debug,[
244 # the following is only required if we have JobMarket
245 BOOST_ASIO
246 AC_DEFINE(HAVE_JOBMARKET,1, ["use JobMarket to calculate fragment jobs."])
247 ],[
248 enable_jobmarket="no"
249 ])
250]
251#[
252# AC_DEFINE(HAVE_JOBMARKET,0, ["use JobMarket to calculate fragment jobs."])
253#]
254)
255AC_SUBST(HAVE_JOBMARKET)
256AM_CONDITIONAL([CONDJOBMARKET], [test x"$enable_jobmarket" = x"yes"])
257
258# VMG library
259AC_MSG_CHECKING(whether to compile in long-range support via VMG)
260AC_ARG_ENABLE(
261 [vmg],
262 [AS_HELP_STRING([--enable-vmg], [turn on long-range potential calculation via VMG [default=no]])],
263 [enable_vmg=$enableval],
264 enable_vmg="no")
265AC_MSG_RESULT($enable_vmg)
266AS_IF([test x"$enable_vmg" != x"no"],[
267 PKG_CHECK_MODULES(VMG, VMG >= 0.1)
268 AC_SUBST(VMG_CFLAGS)
269 AC_SUBST(VMG_LIBS)
270 AC_DEFINE(HAVE_VMG,1, ["use VMG to calculate long-range contributions."])
271
272 # check whether to use mpi
273 AC_ARG_WITH(
274 [vmg-mpi],
275 [AS_HELP_STRING([--with-vmg-mpi], [whether to use MPI for communication in VMGJobs])],
276 [with_vmg_mpi=yes],
277 [with_vmg_mpi=no])
278 AS_IF(
279 [test "x$with_vmg_mpi" != xno],
280 [
281 AC_LANG_SAVE
282 AC_LANG_CPLUSPLUS
283 LX_FIND_MPI
284 AC_LANG_RESTORE
285 AS_IF([test "x$have_CXX_mpi" = xyes],[
286 AC_DEFINE([MPICH_SKIP_MPICXX], [1], [Skip C++ bindings])
287 AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])
288 AC_DEFINE([MPI_NO_CPPBIND], [1], [Skip C++ bindings])
289 AC_DEFINE([_MPICC_H], [1], [Skip C++ bindings])
290 AC_DEFINE([MPIBULL_SKIP_MPICXX], [1], [Skip C++ bindings])
291 ])
292 ],
293 [])
294])
295AM_CONDITIONAL([CONDVMG], [test x"$enable_vmg" = x"yes"])
296AM_CONDITIONAL([CONDVMGMPI], [test x"$have_CXX_mpi" = x"yes"])
297
298
299# Check for Levenberg-Marquardt implementation
300AC_MSG_CHECKING(whether to enable function fitting via levmar)
301AC_ARG_ENABLE(
302 [levmar],
303 AS_HELP_STRING([--enable-levmar],[turn on LevMar feature [default=no]]),
304 enable_levmar=$enableval,
305 enable_levmar="no")
306AC_MSG_RESULT($enable_levmar)
307# don't use AS_IF here as it expands (and tests) AC_F77_FUN evene if levmar
308# is disabled.
309if test x"$enable_levmar" = x"yes"; then
310 AX_LAPACK([enable_levmar=yes],[enable_levmar=no])
311fi
312AS_IF([test x"$enable_levmar" = x"yes"],[
313 AC_ARG_WITH(
314 [levmar],
315 [AS_HELP_STRING([--with-levmar], [give path to LevMar package])],
316 [have_levmar_path=$withval],
317 [enable_levmar=no])
318 ],[enable_levmar=no])
319AS_IF([test x"$enable_levmar" = x"yes"],[
320 LEVMAR_CPPFLAGS="-I${have_levmar_path}/include"
321 LEVMAR_LDFLAGS="-L${have_levmar_path}/lib"
322 LEVMAR_LIBS="-llevmar"
323 AC_SUBST(LEVMAR_CPPFLAGS)
324 AC_SUBST(LEVMAR_LDFLAGS)
325 AC_SUBST(LEVMAR_LIBS)
326 AC_DEFINE(HAVE_LEVMAR,1, ["use levmar for non-linear minimisation/potential fitting."])
327 ],[AC_MSG_WARN(["Missing LAPACK, disabling off levmar"])])
328AM_CONDITIONAL([CONDLEVMAR], [test x"$enable_levmar" = x"yes"])
329
330# Checks for header files.
331AC_HEADER_STDC
332AC_CHECK_HEADERS([sys/time.h])
333AC_HEADER_STDBOOL
334
335AC_FUNC_MALLOC
336AC_FUNC_REALLOC
337AC_CHECK_FUNCS([floor pow sqrt strchr])
338
339# Checks for typedefs, structures, and compiler characteristics.
340AC_C_CONST
341AC_C_INLINE
342AC_C_RESTRICT
343AC_TYPE_SIZE_T
344
345# Checks for library functions.
346# check for GNU Scientific Library
347AC_CHECK_HEADERS([gsl/gsl_blas.h])
348AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas)
349AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas)
350AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl)
351#AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
352AC_CHECK_LIB(gsl, main)
353
354# use CppUnit TestRunner or not
355AC_MSG_CHECKING(whether to enable ECut TestRunnerClient)
356AC_ARG_ENABLE(
357 [ecut],
358 AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]),
359 enable_ecut=$disableval,
360 enable_ecut="no")
361AC_MSG_RESULT($enable_ecut)
362AS_IF([test x"$enable_ecut" = x"yes"],[
363 AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
364 AC_SUBST(HAVE_ECUT)
365])
366AM_CONDITIONAL([CONDECUT], [test x"$enable_ecut" = x"yes"])
367
368# with valgrinding testsuite or not
369AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite)
370AC_ARG_ENABLE(
371 [valgrind],
372 AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]),
373 enable_valgrind=$enableval,
374 enable_valgrind="no")
375AC_MSG_RESULT($enable_valgrind)
376AS_IF([test x"$enable_valgrind" = x"yes"], [
377 AC_CHECK_HEADER([valgrind/valgrind.h],
378 [
379 # check header
380 AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
381 # check path
382 AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
383 # set variables
384 AC_SUBST(HAVE_VALGRIND_TESTSUITE)
385 AC_SUBST(VALGRIND)
386 ],
387 [
388 AC_MSG_ERROR(["Valgrind support requested but headers not available."])
389 ]
390 )
391])
392
393# Check for "extern inline", using a modified version
394# of the test for AC_C_INLINE from acspecific.mt
395AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
396[ac_cv_c_extern_inline=no
397AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
398extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
399double foo (double x) { return x + 1.0; };],
400[ foo(1.0) ],
401[ac_cv_c_extern_inline="yes"])
402])
403
404if test "$ac_cv_c_inline" != no ; then
405 AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
406 AC_SUBST(HAVE_INLINE)
407fi
408
409#AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
410
411# test suite
412
413AC_CONFIG_FILES([
414 tests/Makefile])
415
416AC_CONFIG_TESTDIR(tests/Calculations)
417AC_CONFIG_FILES([
418 tests/Calculations/atlocal
419 tests/Calculations/Makefile])
420AC_CONFIG_FILES([tests/Calculations/molecuilder], [chmod +x tests/Calculations/molecuilder])
421
422AC_CONFIG_TESTDIR(tests/CodeChecks)
423AC_CONFIG_FILES([
424 tests/CodeChecks/atlocal
425 tests/CodeChecks/Makefile])
426
427AC_CONFIG_TESTDIR(tests/Fragmentations)
428AC_CONFIG_FILES([
429 tests/Fragmentations/atlocal
430 tests/Fragmentations/Makefile])
431AC_CONFIG_FILES([tests/Fragmentations/molecuilder], [chmod +x tests/Fragmentations/molecuilder])
432
433AC_CONFIG_TESTDIR(tests/JobMarket)
434AC_CONFIG_FILES([
435 tests/JobMarket/atlocal
436 tests/JobMarket/Makefile])
437AC_CONFIG_FILES([tests/JobMarket/molecuilder], [chmod +x tests/JobMarket/molecuilder])
438
439AC_CONFIG_TESTDIR(tests/regression)
440AC_CONFIG_FILES([
441 tests/regression/atlocal
442 tests/regression/Makefile])
443AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
444AC_CONFIG_FILES([tests/regression/runpython], [chmod +x tests/regression/runpython])
445
446AC_CONFIG_TESTDIR(tests/Tesselations)
447AC_CONFIG_FILES([
448 tests/Tesselations/atlocal
449 tests/Tesselations/Makefile])
450AC_CONFIG_FILES([tests/Tesselations/molecuilder], [chmod +x tests/Tesselations/molecuilder])
451
452AC_CONFIG_FILES([
453 doc/molecuilder.xml])
454AC_CONFIG_FILES([
455 doc/userguide/catalog.xml:doc/userguide/catalog.xml.in])
456AC_CONFIG_FILES([
457 MoleCuilder.pc:MoleCuilder.pc.in])
458AC_CONFIG_FILES([
459 doc/Makefile
460 doc/userguide/Makefile
461])
462AC_CONFIG_FILES([
463 Makefile
464 src/Makefile
465 data/icons/Makefile
466 utils/Makefile
467])
468AC_CONFIG_FILES([
469 src/unittests/Makefile
470])
471
472# produce python scripts and tests only when python's present
473AC_CONFIG_TESTDIR([tests/Python])
474AC_CONFIG_FILES([tests/Python/atlocal])
475AM_COND_IF([CONDPYTHON],[
476 AC_CONFIG_FILES([utils/Python/boxmaker.py:utils/Python/boxmaker.py.in], [chmod +x utils/Python/boxmaker.py])
477 AC_CONFIG_FILES([utils/Python/python_wrapper:utils/Python/python_wrapper.in], [chmod +x utils/Python/python_wrapper])
478 AC_CONFIG_FILES([tests/Python/run], [chmod +x tests/Python/run])
479])
480AC_CONFIG_FILES([tests/Python/Makefile])
481
482AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.