source: configure.ac@ f01bb3

Candidate_v1.7.0 stable
Last change on this file since f01bb3 was f01bb3, checked in by Frederik Heber <frederik.heber@…>, 5 years ago

CppUnit detected by pkg-config as fallback.

  • ubunntu 18.04 no longer has cppunit-config but relies on pkg-config to detect compilation flags.
  • Property mode set to 100644
File size: 20.7 KB
RevLine 
[14de469]1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
[425516]5AC_INIT(MoleCuilder, 1.6.1, [bug@molecuilder.de], [molecuilder], [http://www.molecuilder.de/])
[bf4b9f]6AC_CONFIG_AUX_DIR([build-aux])
[14de469]7AC_CONFIG_SRCDIR([src/builder.cpp])
[861874]8AC_CONFIG_HEADER([config.h libmolecuilder_config.h])
9AC_CONFIG_MACRO_DIR([m4])
[4ecb2d]10AC_CONFIG_SUBDIRS([ThirdParty/LinearAlgebra])
[482400e]11AC_CONFIG_SUBDIRS([ThirdParty/mpqc_open])
[14de469]12
[dc322a]13# parallel-tests: use parallel test druver
14# color-tests: us coloring to indicate success/failure when available
15# tar-pax: use newer tar implementation with longer filename (>99 chars)
[3b35e7]16AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects])
[14de469]17
18# Checks for programs.
19AC_PROG_CXX
[54a746]20AC_PROG_INSTALL
[14de469]21
[0cfc27]22# check for cppunit (taken from svn.apache.org/../xmlbeanscxx)
[f01bb3]23AM_PATH_CPPUNIT(1.9.6,
24 [AM_CONDITIONAL([CPPUNIT], [true])],
25 [
26 PKG_CHECK_MODULES(CPPUNIT, [cppunit >= 1.9.6],
27 [AM_CONDITIONAL([CPPUNIT], [true])],
28 [AM_CONDITIONAL([CPPUNIT], [false])]
29 )
30 ]
31)
[0cfc27]32AM_CONDITIONAL(CONDCPPUNIT, test "$CPPUNIT_LIBS")
33
[c015b3]34dnl Check if we have enable python
[557b39]35# python module-
[c015b3]36AC_MSG_CHECKING(whether to enable python module)
[f99714]37AC_ARG_ENABLE(
38 [python],
39 AS_HELP_STRING([--enable-python],[turn on python module [default=yes]]),
40 enable_python=$enableval,
41 enable_python="yes")
[c015b3]42AC_MSG_RESULT($enable_python)
43AS_IF([test x"$enable_python" != x"no"],[
44 # Python (for boost::python)
45 AM_PATH_PYTHON([2.2])
46 AC_DEFINE(HAVE_PYTHON,1, ["Build python module and scripts."])
47])
[1ca493a]48python_version_major=`echo $PYTHON_VERSION | sed -e "s#\([0-9]\)\..*#\1#"`
[c015b3]49AM_CONDITIONAL([CONDPYTHON], [test x"$enable_python" != x"no"])
[1ca493a]50AS_IF([test x"$python_version_major" = x"2"],[
51 AC_DEFINE(HAVE_PYTHON2, 1, ["using python version 2"])
52],[test x"$python_version_major" = x"3"],[
53 AC_DEFINE(HAVE_PYTHON3, 1, ["using python version 3"])
54])
[c015b3]55AC_SUBST(HAVE_PYTHON)
56
[74459a]57dnl Check whether no extra thread for ActionQueue shall be used
58AC_MSG_CHECKING(whether to enable ActionQueue's run thread)
59AC_ARG_ENABLE(
60 [action_thread],
61 AS_HELP_STRING([--enable-action-thread],[turn on extra run thread for ActionQueue [default=yes]]),
62 enable_action_thread=$enableval,
63 enable_action_thread="no"
64)
65AC_MSG_RESULT($enable_action_thread)
66AS_IF([test x"$enable_action_thread" != x"no"],[
67 AC_DEFINE(HAVE_ACTION_THREAD,1, ["Have extra run thread for ActionQueue."])
68])
69AM_CONDITIONAL([CONDACTIONTHREAD], [test x"$enable_action_thread" != x"no"])
70AC_SUBST(HAVE_ACTION_THREAD)
71
[c015b3]72dnl Check if we have enable qtgui
[e5cec4]73# Qt programs
[c015b3]74AC_MSG_CHECKING(whether to enable Qt-based GUI)
[f99714]75AC_ARG_ENABLE(
76 [qtgui],
77 AS_HELP_STRING([--enable-qtgui],[turn on Qt GUI compilation [default=yes]]),
78 enable_qtgui=$enableval,
79 enable_qtgui="yes")
[c015b3]80AC_MSG_RESULT($enable_qtgui)
81AS_IF([test x"$enable_qtgui" != x"no"],[
[93909a]82 AC_ARG_WITH(
83 [Qt-bin],
84 [AS_HELP_STRING([--with-Qt-bin], [give path to Qt binaries])],
85 [have_qtgui_path=$withval],
86 have_qtgui_path="")
[196702]87 AS_IF([test x"$have_qtgui_path" != x""],[
88 AC_PATH_PROGS([QT_MOC],
89 [moc-qt4 moc],
90 [AC_MSG_ERROR(["Qts moc not found, please use --with-Qt-bin."])],
91 [$have_qtgui_path]
92 )
93 AC_PATH_PROGS([QT_RCC],
94 [rcc-qt4 rcc],
95 [AC_MSG_ERROR(["Qts rcc not found, please use --with-Qt-bin."])],
96 [$have_qtgui_path]
97 )
98 AC_PATH_PROGS([QT_UIC],
99 [uic-qt4 uic],
100 [AC_MSG_ERROR(["Qts uic not found, please use --with-Qt-bin."])],
101 [$have_qtgui_path]
102 )
103 ],[
104 AC_PATH_PROGS([QT_MOC],
105 [moc-qt4 moc],
106 [AC_MSG_ERROR(["Qts moc not found, please use --with-Qt-bin."])]
107 )
108 AC_PATH_PROGS([QT_RCC],
109 [rcc-qt4 rcc],
110 [AC_MSG_ERROR(["Qts rcc not found, please use --with-Qt-bin."])]
111 )
112 AC_PATH_PROGS([QT_UIC],
113 [uic-qt4 uic],
114 [AC_MSG_ERROR(["Qts uic not found, please use --with-Qt-bin."])]
115 )
116 ])
[c015b3]117 PKG_CHECK_MODULES([QT], [QtCore QtGui Qt3D], [
[a844d8]118 :
[c015b3]119 ])
120 AC_SUBST([QT_CFLAGS])
121 AC_SUBST([QT_LIBS])
122 AC_DEFINE(HAVE_QTGUI,1, ["Build Qt-based GUI"])
[e5cec4]123])
[c015b3]124AM_CONDITIONAL([CONDQTGUI], [test x"$enable_qtgui" != x"no"])
125AC_SUBST(HAVE_QTGUI)
[e5cec4]126
[3d61c7]127dnl Check whether qtgui captures log or not
128AC_MSG_CHECKING(whether to capture stdout in qtgui)
129AC_ARG_ENABLE(
130 [qtgui_capture_log],
131 AS_HELP_STRING([--enable-qtgui-capture-log],[turn on capturing of log inside qtgui [default=yes]]),
132 enable_qtgui_capture_log=$enableval,
133 enable_qtgui_capture_log="yes"
134)
135AC_MSG_RESULT($enable_qtgui_capture_log)
136AS_IF([test x"$enable_qtgui_capture_log" != x"no"],[
137 AC_DEFINE(QT_CAPTURES_LOG,1, ["Have QtGui capture the stdout."])
138])
139AC_SUBST(QT_CAPTURES_LOG)
140
141
[c76b8b]142# check additionally for QWT to enable plotting of potentials
143AC_MSG_CHECKING(whether to enable Qwt-based plotting)
144#enable_qwt=yes
145AC_ARG_ENABLE(
146 [qwt],
147 AS_HELP_STRING([--enable-qwt],[turn on Qwt compilation [default=yes]]),
148 enable_qwt=$enableval,
149 enable_qwt="yes")
150AC_MSG_RESULT($enable_qwt)
151AS_IF([test x"$enable_qwt" != x"no"],[
152 MOL_AC_HAVE_QWT_IFELSE(
153 [
154 enable_qwt=yes
155 AC_DEFINE(HAVE_QWT,1, ["Build Qwt-based plotting"])
156 ],
157 [
158 enable_qwt=no
159 AC_MSG_WARN([Qwt not found, disabling plotting in QtUI.])
160 ]
161 )
162])
163AM_CONDITIONAL([CONDQWT], [test x"$enable_qwt" != x"no"])
164AC_SUBST(HAVE_QWT)
165
[ec188c]166# use doxygen
167DX_HTML_FEATURE(ON)
168DX_PS_FEATURE(OFF)
169DX_PDF_FEATURE(OFF)
[3158e6]170DX_INIT_DOXYGEN(MoleCuilder, Doxyfile, ${docdir})
[ec188c]171
[6029a6]172# use docbook
173AX_CHECK_DOCBOOK
174
[ec188c]175# use libtool
[a0064e]176LT_INIT([static])
[4e8108]177AC_SUBST([LIBTOOL_DEPS])
[861874]178
179# Define these substitions here to keep all version information in one place.
180# For information on how to properly maintain the library version information,
181# refer to the libtool manual, section "Updating library version information":
182# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
[425516]183AC_SUBST([MOLECUILDER_SO_VERSION], [18:0:1])
184AC_SUBST([MOLECUILDER_API_VERSION], [1.6.1])
[06aedc]185
[dc031c]186dnl this macro is used to get the arguments supplied
187dnl to the configure script (./configure --enable-debug)
188dnl Check if we have enable debug support.
189AC_MSG_CHECKING(whether to enable debugging)
190have_debug="no"
[f99714]191AC_ARG_ENABLE(
192 [debug],
193 AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]),
194 enable_debug=$enableval,
195 enable_debug="no")
196AC_MSG_RESULT($enable_debug)
197AS_IF([test x"$enable_debug" = x"yes"],[
[dc031c]198 AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
199 AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
200 have_debug="yes"
[f99714]201],[
202 AS_IF([test x"$enable_debug" = x"full"],[
203 AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
204 AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
205 AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
[4d6d6a]206 dnl AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."])
[f99714]207 have_debug="full"
208 ],[
209 AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
210 AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
[4d6d6a]211 AC_DEFINE(QT_NO_DEBUG_OUTPUT,, ["Disable Qt debug messages."])
[f99714]212 have_debug="no"
213 ])
214])
[dc031c]215AC_SUBST(HAVE_DEBUG)
216
217dnl this macro is used to get the arguments supplied
218dnl to the configure script (./configure --enable-debug)
219dnl Check if we have enable debug support.
[f3b8a5]220AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation)
[f99714]221AC_ARG_ENABLE(
222 [cache],
223 AS_HELP_STRING([--enable-cache],[turn on internal lazy evaluation [default=yes]]),
224 enable_cache=$enableval,
225 enable_cache="yes")
[f3b8a5]226AC_MSG_RESULT($enable_cache)
[f99714]227AS_IF([test x"$enable_cache" != x"no"],[
228 AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
229],[
[dc031c]230 AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
231 AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
[f99714]232])
[dc031c]233AC_SUBST(HAVE_CACHE)
234
[14de469]235# Checks for libraries.
[861874]236AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
[14de469]237
[7d0a4e]238# Pthreads
239ACX_PTHREAD()
240
[f08ae7]241# Boost
[79de12]242BOOST_REQUIRE([1.40])
[f08ae7]243
244# Boost headers only
245BOOST_ANY
[794bc8]246BOOST_ARRAY
[4f04ab8]247BOOST_BIMAP
[f08ae7]248BOOST_BIND
[503acc1]249BOOST_CAST
[f08ae7]250BOOST_CONVERSION
[79de12]251BOOST_EXCEPTION
[f08ae7]252BOOST_FOREACH
253BOOST_FUNCTION
[619a0e]254BOOST_FUSION
[4f04ab8]255BOOST_GRAPH
[30c753]256BOOST_ITERATOR
[794bc8]257BOOST_MULTIARRAY
[4da4de]258BOOST_MULTIINDEXCONTAINER
[619a0e]259BOOST_MPL
[f08ae7]260BOOST_PREPROCESSOR
261BOOST_RANDOM
262BOOST_SMART_PTR
[7f570c]263BOOST_STRING_ALGO
[f08ae7]264BOOST_TOKENIZER
265
266# Boost headers with libraries
[79de12]267BOOST_FILESYSTEM
[d920b9]268BOOST_IOSTREAMS
[79de12]269BOOST_PROGRAM_OPTIONS
[c015b3]270AS_IF([test x"$enable_python" != x"no"], [BOOST_PYTHON])
[d7d022]271BOOST_SERIALIZATION
[79de12]272BOOST_THREADS
[fa861b]273
[f08ae7]274
[e2c2b1]275# CodePatterns library (requiring UnobservedIterator)
[26dc12]276compile_codepatterns="no"
277AM_PATH_CODEPATTERNS([1.3.2], $have_debug,,[
278 # compile from ThirdParty
279 AC_CONFIG_SUBDIRS([ThirdParty/CodePatterns])
280 compile_codepatterns="yes"
281 [CodePatterns_LDFLAGS='-L$(top_builddir)/ThirdParty/CodePatterns/src']
282 [CodePatterns_CFLAGS='-I$(top_srcdir)/ThirdParty/CodePatterns/src']
283 AS_IF([test x"$enable_debug" != x"no"], [
284 [CodePatterns_LIBS='-lcodepatterns-debug']
285 ],[
286 [CodePatterns_LIBS='-lcodepatterns']
287 ])
288 AC_SUBST(CodePatterns_LDFLAGS)
289 AC_SUBST(CodePatterns_CFLAGS)
290 AC_SUBST(CodePatterns_LIBS)
291 #AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])
292])
[79b089]293AC_MSG_CHECKING(whether to compile codepatterns)
294AC_MSG_RESULT($compile_codepatterns)
[26dc12]295AM_CONDITIONAL([COND_COMPILE_CODEPATTERNS], [test x"$compile_codepatterns" = x"yes"])
[3027f8]296
[004d5c]297# JobMarket library (needs boost/archive/iserializer.hpp before MemDebug.hpp)
[830adf]298AC_MSG_CHECKING(whether to enable jobmarket)
[004d5c]299AC_ARG_ENABLE(
300 [jobmarket],
301 AS_HELP_STRING([--enable-jobmarket],[turn on JobMarket feature [default=yes]]),
302 enable_jobmarket=$enableval,
303 enable_jobmarket="yes")
304AC_MSG_RESULT($enable_jobmarket)
[2f5562]305compile_jobmarket="no"
[79b089]306AC_MSG_CHECKING(whether to compile jobmarket)
[004d5c]307AS_IF([test x"$enable_jobmarket" != x"no"],[
[b0af1d]308 # the following is only required if we use JobMarket
309 BOOST_ASIO
310 AC_DEFINE(HAVE_JOBMARKET,1, ["use JobMarket to calculate fragment jobs."])
[d6a7b9]311 # JobMarket library (needs SystemCommandJob with suffix)
[b0af1d]312 AM_PATH_JOBMARKET([1.1.6], $have_debug,
313 ,[
[2f5562]314 AC_CONFIG_SUBDIRS([ThirdParty/JobMarket])
315 compile_jobmarket="yes"
316 [JobMarket_CFLAGS='-I$(top_srcdir)/ThirdParty/JobMarket/src']
317 [JobMarket_LDFLAGS='-L$(top_builddir)/ThirdParty/JobMarket/src/JobMarket']
318 [JobMarket_LIBS='-lJobMarket']
319 [JobMarket_Controller_LIBS='-lJobMarketController']
320 [JobMarket_Server_LIBS='-lJobMarketServer']
321 [JobMarket_PoolWorker_LIBS='-lJobMarketPoolWorker']
322 AC_SUBST(JobMarket_CFLAGS)
323 AC_SUBST(JobMarket_LDFLAGS)
324 AC_SUBST(JobMarket_LIBS)
325 AC_SUBST(JobMarket_Controller_LIBS)
326 AC_SUBST(JobMarket_Server_LIBS)
327 AC_SUBST(JobMarket_PoolWorker_LIBS)
[004d5c]328 ])
329]
[79b089]330AC_MSG_RESULT($compile_jobmarket)
[004d5c]331#[
332# AC_DEFINE(HAVE_JOBMARKET,0, ["use JobMarket to calculate fragment jobs."])
333#]
334)
335AC_SUBST(HAVE_JOBMARKET)
[0b738b]336AM_CONDITIONAL([COND_COMPILE_JOBMARKET], [test x"$compile_jobmarket" = x"yes"])
[004d5c]337AM_CONDITIONAL([CONDJOBMARKET], [test x"$enable_jobmarket" = x"yes"])
[3027f8]338
[d2a0f6d]339# VMG library
[79b089]340AC_MSG_CHECKING(whether to compile in long-range support via vmg)
[d2a0f6d]341AC_ARG_ENABLE(
342 [vmg],
343 [AS_HELP_STRING([--enable-vmg], [turn on long-range potential calculation via VMG [default=no]])],
344 [enable_vmg=$enableval],
345 enable_vmg="no")
346AC_MSG_RESULT($enable_vmg)
[79b089]347compile_vmg="no"
348AC_MSG_CHECKING(whether to compile vmg library)
[d2a0f6d]349AS_IF([test x"$enable_vmg" != x"no"],[
[79b089]350 PKG_CHECK_MODULES(VMG, VMG >= 0.1, [enable_vmg="yes"], [enable_vmg="no"])
351 AS_IF([test x"$enable_vmg" = x"no"],[
352 AC_CONFIG_SUBDIRS([ThirdParty/vmg])
353 compile_vmg="yes"
354 enable_vmg="yes"
355 [VMG_CFLAGS='-I$(top_srcdir)/ThirdParty/vmg/src']
356 [VMG_LDFLAGS='-L$(top_builddir)/ThirdParty/vmg/src']
357 [VMG_LIBS='-lvmg']
358 ])
[d2a0f6d]359 AC_SUBST(VMG_CFLAGS)
[79b089]360 AC_SUBST(VMG_LDFLAGS)
[d2a0f6d]361 AC_SUBST(VMG_LIBS)
[69c733]362 AC_DEFINE(HAVE_VMG,1, ["use VMG to calculate long-range contributions."])
[8a8c8c]363
364 # check whether to use mpi
365 AC_ARG_WITH(
366 [vmg-mpi],
367 [AS_HELP_STRING([--with-vmg-mpi], [whether to use MPI for communication in VMGJobs])],
368 [with_vmg_mpi=yes],
369 [with_vmg_mpi=no])
370 AS_IF(
371 [test "x$with_vmg_mpi" != xno],
372 [
373 AC_LANG_SAVE
374 AC_LANG_CPLUSPLUS
375 LX_FIND_MPI
376 AC_LANG_RESTORE
377 AS_IF([test "x$have_CXX_mpi" = xyes],[
378 AC_DEFINE([MPICH_SKIP_MPICXX], [1], [Skip C++ bindings])
379 AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings])
380 AC_DEFINE([MPI_NO_CPPBIND], [1], [Skip C++ bindings])
381 AC_DEFINE([_MPICC_H], [1], [Skip C++ bindings])
382 AC_DEFINE([MPIBULL_SKIP_MPICXX], [1], [Skip C++ bindings])
[27760e]383 #ac_configure_args="$ac_configure_args --with-mpi-thread=single --with-default-parallel=mpi --with-include=\"$MPI_CXXFLAGS\" --with-libs=\"$MPI_CXXLDFLAGS\""
384 ac_configure_args="$ac_configure_args --with-default-parallel=none"
[8a8c8c]385 ])
386 ],
387 [])
[d2a0f6d]388])
[79b089]389AC_MSG_RESULT($compile_vmg)
[d2a0f6d]390AM_CONDITIONAL([CONDVMG], [test x"$enable_vmg" = x"yes"])
[8a8c8c]391AM_CONDITIONAL([CONDVMGMPI], [test x"$have_CXX_mpi" = x"yes"])
[79b089]392AM_CONDITIONAL([COND_COMPILE_VMG], [test x"$compile_vmg" = x"yes"])
[d2a0f6d]393
394
[f06d52]395# Check for Levenberg-Marquardt implementation
[830adf]396AC_MSG_CHECKING(whether to enable function fitting via levmar)
[48d20d]397AC_ARG_ENABLE(
398 [levmar],
399 AS_HELP_STRING([--enable-levmar],[turn on LevMar feature [default=no]]),
400 enable_levmar=$enableval,
401 enable_levmar="no")
[4d5dfa]402AC_MSG_RESULT($enable_levmar)
[b61bd5]403# don't use AS_IF here as it expands (and tests) AC_F77_FUN even if levmar
[4d5dfa]404# is disabled.
[93ea13d]405compile_levmar="no"
[b61bd5]406AS_IF([test x"$enable_levmar" = xyes],[
407 AC_MSG_CHECKING(for levmar presence via given path )
[f06d52]408 AC_ARG_WITH(
409 [levmar],
410 [AS_HELP_STRING([--with-levmar], [give path to LevMar package])],
[b61bd5]411 [have_levmar_path=$withval
412 enable_levmar=yes],
[93ea13d]413 [
414 enable_levmar=no
415 ])
[b61bd5]416 AC_MSG_RESULT($enable_levmar)
417 AS_IF([test -n "$have_levmar_path"],[
418 LEVMAR_CPPFLAGS="-I${have_levmar_path}/include"
419 LEVMAR_LDFLAGS="-L${have_levmar_path}/lib"
[93ea13d]420 LEVMAR_LIBS="-llevmar"],
421 [PKG_CHECK_MODULES([LEVMAR],[levmar],[enable_levmar=yes],[enable_levmar=no])
[b61bd5]422 ])
423 ],[enable_levmar=no]
424)
[93ea13d]425if test x"$enable_levmar" = xyes; then
426 AX_LAPACK([enable_levmar=yes],
427 [enable_levmar=no
428 AC_MSG_WARN(["Missing LAPACK, disabling off levmar"])
429 ]
430 )
431else
432 AC_CONFIG_SUBDIRS([ThirdParty/levmar])
433 compile_levmar="yes"
434 enable_levmar="yes"
435 LEVMAR_CPPFLAGS='-I$(top_srcdir)/ThirdParty/levmar/src'
436 LEVMAR_LDFLAGS='-L$(top_builddir)/ThirdParty/levmar/src'
437 LEVMAR_LIBS='-llevmar'
438fi
[b61bd5]439AC_MSG_CHECKING(for levmar usability)
440AS_IF([test x"$enable_levmar" = xyes],[
[f06d52]441 AC_SUBST(LEVMAR_CPPFLAGS)
442 AC_SUBST(LEVMAR_LDFLAGS)
443 AC_SUBST(LEVMAR_LIBS)
[b61bd5]444 AC_DEFINE(HAVE_LEVMAR,1, ["use levmar for non-linear minimisation/potential fitting."])])
445AC_MSG_RESULT($enable_levmar)
[f06d52]446AM_CONDITIONAL([CONDLEVMAR], [test x"$enable_levmar" = x"yes"])
[93ea13d]447AM_CONDITIONAL([COND_COMPILE_LEVMAR], [test x"$compile_levmar" = x"yes"])
[f06d52]448
[14de469]449# Checks for header files.
450AC_HEADER_STDC
451AC_CHECK_HEADERS([sys/time.h])
452AC_HEADER_STDBOOL
453
[d3a46d]454AC_FUNC_MALLOC
455AC_FUNC_REALLOC
456AC_CHECK_FUNCS([floor pow sqrt strchr])
457
[14de469]458# Checks for typedefs, structures, and compiler characteristics.
459AC_C_CONST
460AC_C_INLINE
461AC_C_RESTRICT
462AC_TYPE_SIZE_T
463
464# Checks for library functions.
465# check for GNU Scientific Library
[bd3e55]466AC_CHECK_HEADERS([gsl/gsl_blas.h])
[db1a72]467AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas)
468AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas)
469AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl)
470#AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
471AC_CHECK_LIB(gsl, main)
[14de469]472
[490038]473# use CppUnit TestRunner or not
[f99714]474AC_MSG_CHECKING(whether to enable ECut TestRunnerClient)
475AC_ARG_ENABLE(
476 [ecut],
477 AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]),
478 enable_ecut=$disableval,
479 enable_ecut="no")
480AC_MSG_RESULT($enable_ecut)
481AS_IF([test x"$enable_ecut" = x"yes"],[
[9b6b2f]482 AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
483 AC_SUBST(HAVE_ECUT)
[f99714]484])
[fbbcde]485AM_CONDITIONAL([CONDECUT], [test x"$enable_ecut" = x"yes"])
[9b6b2f]486
[490038]487# with valgrinding testsuite or not
[f3b8a5]488AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite)
[f99714]489AC_ARG_ENABLE(
490 [valgrind],
491 AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]),
492 enable_valgrind=$enableval,
493 enable_valgrind="no")
494AC_MSG_RESULT($enable_valgrind)
495AS_IF([test x"$enable_valgrind" = x"yes"], [
[490038]496 AC_CHECK_HEADER([valgrind/valgrind.h],
497 [
498 # check header
499 AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
500 # check path
501 AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
502 # set variables
503 AC_SUBST(HAVE_VALGRIND_TESTSUITE)
504 AC_SUBST(VALGRIND)
505 ],
506 [
507 AC_MSG_ERROR(["Valgrind support requested but headers not available."])
508 ]
509 )
[f3b8a5]510])
[490038]511
[14de469]512# Check for "extern inline", using a modified version
513# of the test for AC_C_INLINE from acspecific.mt
514AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
515[ac_cv_c_extern_inline=no
516AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
517extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
518double foo (double x) { return x + 1.0; };],
519[ foo(1.0) ],
520[ac_cv_c_extern_inline="yes"])
521])
522
523if test "$ac_cv_c_inline" != no ; then
524 AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
525 AC_SUBST(HAVE_INLINE)
526fi
527
[bd3e55]528#AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
[a19da5d]529
[0ca39c]530# test suite
[878044]531
[5079a0]532AC_CONFIG_FILES([
[689639]533 tests/Makefile])
534
[abfc95]535AC_CONFIG_TESTDIR(tests/Calculations)
536AC_CONFIG_FILES([
537 tests/Calculations/atlocal
538 tests/Calculations/Makefile])
539AC_CONFIG_FILES([tests/Calculations/molecuilder], [chmod +x tests/Calculations/molecuilder])
[fbf005]540AC_CONFIG_FILES([tests/Calculations/molecuilder_poolworker], [chmod +x tests/Calculations/molecuilder_poolworker])
[abfc95]541
[689639]542AC_CONFIG_TESTDIR(tests/CodeChecks)
[d0a719]543AC_CONFIG_FILES([
544 tests/CodeChecks/atlocal
545 tests/CodeChecks/Makefile])
[689639]546
[740d40]547AC_CONFIG_TESTDIR(tests/Fragmentations)
[038713]548AC_CONFIG_FILES([
[740d40]549 tests/Fragmentations/atlocal
550 tests/Fragmentations/Makefile])
551AC_CONFIG_FILES([tests/Fragmentations/molecuilder], [chmod +x tests/Fragmentations/molecuilder])
[689639]552
[0f0407]553AC_CONFIG_TESTDIR(tests/GuiChecks)
554AC_CONFIG_FILES([
555 tests/GuiChecks/atlocal
556 tests/GuiChecks/Makefile])
557AC_CONFIG_FILES([tests/GuiChecks/molecuilder], [chmod +x tests/GuiChecks/molecuilder])
558AC_CONFIG_FILES([tests/GuiChecks/molecuilderguitest], [chmod +x tests/GuiChecks/molecuilderguitest])
[c66ae6]559AC_CONFIG_FILES([tests/GuiChecks/adjacencymatcher], [chmod +x tests/GuiChecks/adjacencymatcher])
[b10593]560AC_CONFIG_FILES([tests/GuiChecks/difffragmentresultcontainer], [chmod +x tests/GuiChecks/difffragmentresultcontainer])
[42b40a]561AC_CONFIG_FILES([tests/GuiChecks/trianglematcher], [chmod +x tests/GuiChecks/trianglematcher])
[0f0407]562
[004d5c]563AC_CONFIG_TESTDIR(tests/JobMarket)
564AC_CONFIG_FILES([
565 tests/JobMarket/atlocal
566 tests/JobMarket/Makefile])
567AC_CONFIG_FILES([tests/JobMarket/molecuilder], [chmod +x tests/JobMarket/molecuilder])
568
[83fa5c]569AC_CONFIG_TESTDIR(tests/integration)
570AC_CONFIG_FILES([
571 tests/integration/atlocal
572 tests/integration/Makefile])
573AC_CONFIG_FILES([tests/integration/molecuilder], [chmod +x tests/integration/molecuilder])
[fbf005]574AC_CONFIG_FILES([tests/integration/molecuilder_poolworker], [chmod +x tests/integration/molecuilder_poolworker])
[83fa5c]575
[689639]576AC_CONFIG_TESTDIR(tests/regression)
577AC_CONFIG_FILES([
578 tests/regression/atlocal
579 tests/regression/Makefile])
580AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
[c66ae6]581AC_CONFIG_FILES([tests/regression/adjacencymatcher], [chmod +x tests/regression/adjacencymatcher])
[557b39]582AC_CONFIG_FILES([tests/regression/difffragmentresultcontainer], [chmod +x tests/regression/difffragmentresultcontainer])
[7d146a]583AC_CONFIG_FILES([tests/regression/trianglematcher], [chmod +x tests/regression/trianglematcher])
[893426]584AC_CONFIG_FILES([tests/regression/runpython], [chmod +x tests/regression/runpython])
[689639]585
586AC_CONFIG_TESTDIR(tests/Tesselations)
[5079a0]587AC_CONFIG_FILES([
[a85f45]588 tests/Tesselations/atlocal
589 tests/Tesselations/Makefile])
590AC_CONFIG_FILES([tests/Tesselations/molecuilder], [chmod +x tests/Tesselations/molecuilder])
[7d146a]591AC_CONFIG_FILES([tests/Tesselations/trianglematcher], [chmod +x tests/Tesselations/trianglematcher])
[689639]592
[4464ef]593AC_CONFIG_TESTDIR(tests/Examples)
594AC_CONFIG_FILES([
595 tests/Examples/atlocal
596 tests/Examples/Makefile])
597AC_CONFIG_FILES([tests/Examples/molecuilder], [chmod +x tests/Examples/molecuilder])
[fbf005]598AC_CONFIG_FILES([tests/Examples/molecuilder_poolworker], [chmod +x tests/Examples/molecuilder_poolworker])
[4464ef]599
[5079a0]600AC_CONFIG_FILES([
601 doc/molecuilder.xml])
[6029a6]602AC_CONFIG_FILES([
603 doc/userguide/catalog.xml:doc/userguide/catalog.xml.in])
[861874]604AC_CONFIG_FILES([
[878044]605 MoleCuilder.pc:MoleCuilder.pc.in])
[5079a0]606AC_CONFIG_FILES([
[ec188c]607 doc/Makefile
[6029a6]608 doc/userguide/Makefile
609])
610AC_CONFIG_FILES([
611 Makefile
[7672284]612 python/Makefile
[938ffd]613 src/Makefile
[c66ae6]614 src/Bond/AdjacencyMatcher/Makefile
[7d146a]615 src/Tesselation/TriangleMatcher/Makefile
[6e12a6]616 ThirdParty/Makefile
[5b991a]617 data/icons/Makefile
[04e1fb]618 utils/Makefile
[85949a]619])
620AC_CONFIG_FILES([
[878044]621 src/unittests/Makefile
[85949a]622])
[d0b3aca]623
[c015b3]624# produce python scripts and tests only when python's present
[24e19e]625AC_CONFIG_TESTDIR([tests/Python])
626AC_CONFIG_FILES([tests/Python/atlocal])
[c015b3]627AM_COND_IF([CONDPYTHON],[
[9fd196]628 AC_CONFIG_FILES([utils/Python/boxmaker.py:utils/Python/boxmaker.py.in], [chmod +x utils/Python/boxmaker.py])
629 AC_CONFIG_FILES([utils/Python/python_wrapper:utils/Python/python_wrapper.in], [chmod +x utils/Python/python_wrapper])
[c015b3]630 AC_CONFIG_FILES([tests/Python/run], [chmod +x tests/Python/run])
631])
[24e19e]632AC_CONFIG_FILES([tests/Python/Makefile])
[d0b3aca]633
[14de469]634AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.