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