| 1 | #                                               -*- Autoconf -*- | 
|---|
| 2 | # Process this file with autoconf to produce a configure script. | 
|---|
| 3 |  | 
|---|
| 4 | AC_PREREQ(2.59) | 
|---|
| 5 | AC_INIT(MoleCuilder, 1.6.1, [bug@molecuilder.de], [molecuilder], [http://www.molecuilder.de/]) | 
|---|
| 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([ThirdParty/LinearAlgebra]) | 
|---|
| 11 | AC_CONFIG_SUBDIRS([ThirdParty/mpqc_open]) | 
|---|
| 12 |  | 
|---|
| 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) | 
|---|
| 16 | AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects]) | 
|---|
| 17 |  | 
|---|
| 18 | # Checks for programs. | 
|---|
| 19 | AC_PROG_CXX | 
|---|
| 20 | AC_PROG_INSTALL | 
|---|
| 21 |  | 
|---|
| 22 | # check for cppunit (taken from svn.apache.org/../xmlbeanscxx) | 
|---|
| 23 | AM_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 | ) | 
|---|
| 32 | AM_CONDITIONAL(CONDCPPUNIT, test "$CPPUNIT_LIBS") | 
|---|
| 33 |  | 
|---|
| 34 | dnl Check if we have enable python | 
|---|
| 35 | # python module- | 
|---|
| 36 | AC_MSG_CHECKING(whether to enable python module) | 
|---|
| 37 | AC_ARG_ENABLE( | 
|---|
| 38 | [python], | 
|---|
| 39 | AS_HELP_STRING([--enable-python],[turn on python module [default=yes]]), | 
|---|
| 40 | enable_python=$enableval, | 
|---|
| 41 | enable_python="yes") | 
|---|
| 42 | AC_MSG_RESULT($enable_python) | 
|---|
| 43 | AS_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 | ]) | 
|---|
| 48 | python_version_major=`echo $PYTHON_VERSION | sed -e "s#\([0-9]\)\..*#\1#"` | 
|---|
| 49 | AM_CONDITIONAL([CONDPYTHON], [test x"$enable_python" != x"no"]) | 
|---|
| 50 | AS_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 | ]) | 
|---|
| 55 | AC_SUBST(HAVE_PYTHON) | 
|---|
| 56 |  | 
|---|
| 57 | dnl Check whether no extra thread for ActionQueue shall be used | 
|---|
| 58 | AC_MSG_CHECKING(whether to enable ActionQueue's run thread) | 
|---|
| 59 | AC_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 | ) | 
|---|
| 65 | AC_MSG_RESULT($enable_action_thread) | 
|---|
| 66 | AS_IF([test x"$enable_action_thread" != x"no"],[ | 
|---|
| 67 | AC_DEFINE(HAVE_ACTION_THREAD,1, ["Have extra run thread for ActionQueue."]) | 
|---|
| 68 | ]) | 
|---|
| 69 | AM_CONDITIONAL([CONDACTIONTHREAD], [test x"$enable_action_thread" != x"no"]) | 
|---|
| 70 | AC_SUBST(HAVE_ACTION_THREAD) | 
|---|
| 71 |  | 
|---|
| 72 | dnl Check if we have enable qtgui | 
|---|
| 73 | # Qt programs | 
|---|
| 74 | AC_MSG_CHECKING(whether to enable Qt-based GUI) | 
|---|
| 75 | AC_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") | 
|---|
| 80 | AC_MSG_RESULT($enable_qtgui) | 
|---|
| 81 | AS_IF([test x"$enable_qtgui" != x"no"],[ | 
|---|
| 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="") | 
|---|
| 87 | AS_IF([test x"$have_qtgui_path" != x""],[ | 
|---|
| 88 | AC_PATH_PROGS([QT_MOC], | 
|---|
| 89 | [moc-qt5 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-qt5 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-qt5 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-qt5 moc], | 
|---|
| 106 | [AC_MSG_ERROR(["Qts moc not found, please use --with-Qt-bin."])] | 
|---|
| 107 | ) | 
|---|
| 108 | AC_PATH_PROGS([QT_RCC], | 
|---|
| 109 | [rcc-qt5 rcc], | 
|---|
| 110 | [AC_MSG_ERROR(["Qts rcc not found, please use --with-Qt-bin."])] | 
|---|
| 111 | ) | 
|---|
| 112 | AC_PATH_PROGS([QT_UIC], | 
|---|
| 113 | [uic-qt5 uic], | 
|---|
| 114 | [AC_MSG_ERROR(["Qts uic not found, please use --with-Qt-bin."])] | 
|---|
| 115 | ) | 
|---|
| 116 | ]) | 
|---|
| 117 | dnl     PKG_CHECK_MODULES([QT], [QtCore QtGui Qt3D], [ | 
|---|
| 118 | dnl     : | 
|---|
| 119 | dnl     ]) | 
|---|
| 120 | AC_SUBST([QT_CFLAGS]) | 
|---|
| 121 | AC_SUBST([QT_LIBS]) | 
|---|
| 122 | AC_DEFINE(HAVE_QTGUI,1, ["Build Qt-based GUI"]) | 
|---|
| 123 | ]) | 
|---|
| 124 | AM_CONDITIONAL([CONDQTGUI], [test x"$enable_qtgui" != x"no"]) | 
|---|
| 125 | AC_SUBST(HAVE_QTGUI) | 
|---|
| 126 |  | 
|---|
| 127 | dnl Check whether qtgui captures log or not | 
|---|
| 128 | AC_MSG_CHECKING(whether to capture stdout in qtgui) | 
|---|
| 129 | AC_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 | ) | 
|---|
| 135 | AC_MSG_RESULT($enable_qtgui_capture_log) | 
|---|
| 136 | AS_IF([test x"$enable_qtgui_capture_log" != x"no"],[ | 
|---|
| 137 | AC_DEFINE(QT_CAPTURES_LOG,1, ["Have QtGui capture the stdout."]) | 
|---|
| 138 | ]) | 
|---|
| 139 | AC_SUBST(QT_CAPTURES_LOG) | 
|---|
| 140 |  | 
|---|
| 141 |  | 
|---|
| 142 | # check additionally for QWT to enable plotting of potentials | 
|---|
| 143 | AC_MSG_CHECKING(whether to enable Qwt-based plotting) | 
|---|
| 144 | #enable_qwt=yes | 
|---|
| 145 | AC_ARG_ENABLE( | 
|---|
| 146 | [qwt], | 
|---|
| 147 | AS_HELP_STRING([--enable-qwt],[turn on Qwt compilation [default=yes]]), | 
|---|
| 148 | enable_qwt=$enableval, | 
|---|
| 149 | enable_qwt="yes") | 
|---|
| 150 | AC_MSG_RESULT($enable_qwt) | 
|---|
| 151 | AS_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 | ]) | 
|---|
| 163 | AM_CONDITIONAL([CONDQWT], [test x"$enable_qwt" != x"no"]) | 
|---|
| 164 | AC_SUBST(HAVE_QWT) | 
|---|
| 165 |  | 
|---|
| 166 | # use doxygen | 
|---|
| 167 | DX_HTML_FEATURE(ON) | 
|---|
| 168 | DX_PS_FEATURE(OFF) | 
|---|
| 169 | DX_PDF_FEATURE(OFF) | 
|---|
| 170 | DX_INIT_DOXYGEN(MoleCuilder, Doxyfile, ${docdir}) | 
|---|
| 171 |  | 
|---|
| 172 | # use docbook | 
|---|
| 173 | AX_CHECK_DOCBOOK | 
|---|
| 174 |  | 
|---|
| 175 | # use libtool | 
|---|
| 176 | LT_INIT([static]) | 
|---|
| 177 | AC_SUBST([LIBTOOL_DEPS]) | 
|---|
| 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 | 
|---|
| 183 | AC_SUBST([MOLECUILDER_SO_VERSION], [18:0:1]) | 
|---|
| 184 | AC_SUBST([MOLECUILDER_API_VERSION], [1.6.1]) | 
|---|
| 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 debugging) | 
|---|
| 190 | have_debug="no" | 
|---|
| 191 | AC_ARG_ENABLE( | 
|---|
| 192 | [debug], | 
|---|
| 193 | AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]), | 
|---|
| 194 | enable_debug=$enableval, | 
|---|
| 195 | enable_debug="no") | 
|---|
| 196 | AC_MSG_RESULT($enable_debug) | 
|---|
| 197 | AS_IF([test x"$enable_debug" = x"yes"],[ | 
|---|
| 198 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."]) | 
|---|
| 199 | AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."]) | 
|---|
| 200 | have_debug="yes" | 
|---|
| 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."]) | 
|---|
| 206 | dnl AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."]) | 
|---|
| 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."]) | 
|---|
| 211 | AC_DEFINE(QT_NO_DEBUG_OUTPUT,, ["Disable Qt debug messages."]) | 
|---|
| 212 | have_debug="no" | 
|---|
| 213 | ]) | 
|---|
| 214 | ]) | 
|---|
| 215 | AC_SUBST(HAVE_DEBUG) | 
|---|
| 216 |  | 
|---|
| 217 | dnl this macro is used to get the arguments supplied | 
|---|
| 218 | dnl to the configure script (./configure --enable-debug) | 
|---|
| 219 | dnl Check if we have enable debug support. | 
|---|
| 220 | AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation) | 
|---|
| 221 | AC_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") | 
|---|
| 226 | AC_MSG_RESULT($enable_cache) | 
|---|
| 227 | AS_IF([test x"$enable_cache" != x"no"],[ | 
|---|
| 228 | AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."]) | 
|---|
| 229 | ],[ | 
|---|
| 230 | AC_DEFINE(NO_CACHING,1, ["Don't use caching code."]) | 
|---|
| 231 | AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."]) | 
|---|
| 232 | ]) | 
|---|
| 233 | AC_SUBST(HAVE_CACHE) | 
|---|
| 234 |  | 
|---|
| 235 | # Checks for libraries. | 
|---|
| 236 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found])) | 
|---|
| 237 |  | 
|---|
| 238 | # Pthreads | 
|---|
| 239 | ACX_PTHREAD() | 
|---|
| 240 |  | 
|---|
| 241 | # Boost | 
|---|
| 242 | BOOST_REQUIRE([1.64]) | 
|---|
| 243 |  | 
|---|
| 244 | # Boost headers only | 
|---|
| 245 | BOOST_ANY | 
|---|
| 246 | BOOST_ARRAY | 
|---|
| 247 | BOOST_BIMAP | 
|---|
| 248 | BOOST_BIND | 
|---|
| 249 | BOOST_CAST | 
|---|
| 250 | BOOST_CHRONO | 
|---|
| 251 | BOOST_CONVERSION | 
|---|
| 252 | BOOST_EXCEPTION | 
|---|
| 253 | BOOST_FOREACH | 
|---|
| 254 | BOOST_FUNCTION | 
|---|
| 255 | BOOST_FUSION | 
|---|
| 256 | BOOST_GRAPH | 
|---|
| 257 | BOOST_ITERATOR | 
|---|
| 258 | BOOST_MULTIARRAY | 
|---|
| 259 | BOOST_MULTIINDEXCONTAINER | 
|---|
| 260 | BOOST_MPL | 
|---|
| 261 | BOOST_PREPROCESSOR | 
|---|
| 262 | BOOST_RANDOM | 
|---|
| 263 | BOOST_SMART_PTR | 
|---|
| 264 | BOOST_STRING_ALGO | 
|---|
| 265 | BOOST_TOKENIZER | 
|---|
| 266 |  | 
|---|
| 267 | # Boost headers with libraries | 
|---|
| 268 | BOOST_FILESYSTEM | 
|---|
| 269 | BOOST_IOSTREAMS | 
|---|
| 270 | BOOST_PROGRAM_OPTIONS | 
|---|
| 271 | AS_IF([test x"$enable_python" != x"no"], [ | 
|---|
| 272 | BOOST_PYTHON | 
|---|
| 273 | BOOST_NUMPY | 
|---|
| 274 | ]) | 
|---|
| 275 | BOOST_SERIALIZATION | 
|---|
| 276 | BOOST_THREADS | 
|---|
| 277 |  | 
|---|
| 278 |  | 
|---|
| 279 | # CodePatterns library (requiring UnobservedIterator) | 
|---|
| 280 | compile_codepatterns="no" | 
|---|
| 281 | AM_PATH_CODEPATTERNS([1.3.2], $have_debug,,[ | 
|---|
| 282 | # compile from ThirdParty | 
|---|
| 283 | AC_CONFIG_SUBDIRS([ThirdParty/CodePatterns]) | 
|---|
| 284 | compile_codepatterns="yes" | 
|---|
| 285 | [CodePatterns_LDFLAGS='-L$(top_builddir)/ThirdParty/CodePatterns/src'] | 
|---|
| 286 | [CodePatterns_CFLAGS='-I$(top_srcdir)/ThirdParty/CodePatterns/src'] | 
|---|
| 287 | AS_IF([test x"$enable_debug" != x"no"], [ | 
|---|
| 288 | [CodePatterns_LIBS='-lcodepatterns-debug'] | 
|---|
| 289 | ],[ | 
|---|
| 290 | [CodePatterns_LIBS='-lcodepatterns'] | 
|---|
| 291 | ]) | 
|---|
| 292 | AC_SUBST(CodePatterns_LDFLAGS) | 
|---|
| 293 | AC_SUBST(CodePatterns_CFLAGS) | 
|---|
| 294 | AC_SUBST(CodePatterns_LIBS) | 
|---|
| 295 | #AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...]) | 
|---|
| 296 | ]) | 
|---|
| 297 | AC_MSG_CHECKING(whether to compile codepatterns) | 
|---|
| 298 | AC_MSG_RESULT($compile_codepatterns) | 
|---|
| 299 | AM_CONDITIONAL([COND_COMPILE_CODEPATTERNS], [test x"$compile_codepatterns" = x"yes"]) | 
|---|
| 300 |  | 
|---|
| 301 | # JobMarket library (needs boost/archive/iserializer.hpp before MemDebug.hpp) | 
|---|
| 302 | AC_MSG_CHECKING(whether to enable jobmarket) | 
|---|
| 303 | AC_ARG_ENABLE( | 
|---|
| 304 | [jobmarket], | 
|---|
| 305 | AS_HELP_STRING([--enable-jobmarket],[turn on JobMarket feature [default=yes]]), | 
|---|
| 306 | enable_jobmarket=$enableval, | 
|---|
| 307 | enable_jobmarket="yes") | 
|---|
| 308 | AC_MSG_RESULT($enable_jobmarket) | 
|---|
| 309 | compile_jobmarket="no" | 
|---|
| 310 | AC_MSG_CHECKING(whether to compile jobmarket) | 
|---|
| 311 | AS_IF([test x"$enable_jobmarket" != x"no"],[ | 
|---|
| 312 | # the following is only required if we use JobMarket | 
|---|
| 313 | BOOST_ASIO | 
|---|
| 314 | AC_DEFINE(HAVE_JOBMARKET,1, ["use JobMarket to calculate fragment jobs."]) | 
|---|
| 315 | # JobMarket library (needs SystemCommandJob with suffix) | 
|---|
| 316 | AM_PATH_JOBMARKET([1.1.6], $have_debug, | 
|---|
| 317 | ,[ | 
|---|
| 318 | AC_CONFIG_SUBDIRS([ThirdParty/JobMarket]) | 
|---|
| 319 | compile_jobmarket="yes" | 
|---|
| 320 | [JobMarket_CFLAGS='-I$(top_srcdir)/ThirdParty/JobMarket/src'] | 
|---|
| 321 | [JobMarket_LDFLAGS='-L$(top_builddir)/ThirdParty/JobMarket/src/JobMarket'] | 
|---|
| 322 | [JobMarket_LIBS='-lJobMarket'] | 
|---|
| 323 | [JobMarket_Controller_LIBS='-lJobMarketController'] | 
|---|
| 324 | [JobMarket_Server_LIBS='-lJobMarketServer'] | 
|---|
| 325 | [JobMarket_PoolWorker_LIBS='-lJobMarketPoolWorker'] | 
|---|
| 326 | AC_SUBST(JobMarket_CFLAGS) | 
|---|
| 327 | AC_SUBST(JobMarket_LDFLAGS) | 
|---|
| 328 | AC_SUBST(JobMarket_LIBS) | 
|---|
| 329 | AC_SUBST(JobMarket_Controller_LIBS) | 
|---|
| 330 | AC_SUBST(JobMarket_Server_LIBS) | 
|---|
| 331 | AC_SUBST(JobMarket_PoolWorker_LIBS) | 
|---|
| 332 | ]) | 
|---|
| 333 | ] | 
|---|
| 334 | AC_MSG_RESULT($compile_jobmarket) | 
|---|
| 335 | #[ | 
|---|
| 336 | #  AC_DEFINE(HAVE_JOBMARKET,0, ["use JobMarket to calculate fragment jobs."]) | 
|---|
| 337 | #] | 
|---|
| 338 | ) | 
|---|
| 339 | AC_SUBST(HAVE_JOBMARKET) | 
|---|
| 340 | AM_CONDITIONAL([COND_COMPILE_JOBMARKET], [test x"$compile_jobmarket" = x"yes"]) | 
|---|
| 341 | AM_CONDITIONAL([CONDJOBMARKET], [test x"$enable_jobmarket" = x"yes"]) | 
|---|
| 342 |  | 
|---|
| 343 | # VMG library | 
|---|
| 344 | AC_MSG_CHECKING(whether to compile in long-range support via vmg) | 
|---|
| 345 | AC_ARG_ENABLE( | 
|---|
| 346 | [vmg], | 
|---|
| 347 | [AS_HELP_STRING([--enable-vmg], [turn on long-range potential calculation via VMG [default=no]])], | 
|---|
| 348 | [enable_vmg=$enableval], | 
|---|
| 349 | enable_vmg="no") | 
|---|
| 350 | AC_MSG_RESULT($enable_vmg) | 
|---|
| 351 | compile_vmg="no" | 
|---|
| 352 | AC_MSG_CHECKING(whether to compile vmg library) | 
|---|
| 353 | AS_IF([test x"$enable_vmg" != x"no"],[ | 
|---|
| 354 | PKG_CHECK_MODULES(VMG, VMG >= 0.1, [enable_vmg="yes"], [enable_vmg="no"]) | 
|---|
| 355 | AS_IF([test x"$enable_vmg" = x"no"],[ | 
|---|
| 356 | AC_CONFIG_SUBDIRS([ThirdParty/vmg]) | 
|---|
| 357 | compile_vmg="yes" | 
|---|
| 358 | enable_vmg="yes" | 
|---|
| 359 | [VMG_CFLAGS='-I$(top_srcdir)/ThirdParty/vmg/src'] | 
|---|
| 360 | [VMG_LDFLAGS='-L$(top_builddir)/ThirdParty/vmg/src'] | 
|---|
| 361 | [VMG_LIBS='-lvmg'] | 
|---|
| 362 | ]) | 
|---|
| 363 | AC_SUBST(VMG_CFLAGS) | 
|---|
| 364 | AC_SUBST(VMG_LDFLAGS) | 
|---|
| 365 | AC_SUBST(VMG_LIBS) | 
|---|
| 366 | AC_DEFINE(HAVE_VMG,1, ["use VMG to calculate long-range contributions."]) | 
|---|
| 367 |  | 
|---|
| 368 | # check whether to use mpi | 
|---|
| 369 | AC_ARG_WITH( | 
|---|
| 370 | [vmg-mpi], | 
|---|
| 371 | [AS_HELP_STRING([--with-vmg-mpi], [whether to use MPI for communication in VMGJobs])], | 
|---|
| 372 | [with_vmg_mpi=yes], | 
|---|
| 373 | [with_vmg_mpi=no]) | 
|---|
| 374 | AS_IF( | 
|---|
| 375 | [test "x$with_vmg_mpi" != xno], | 
|---|
| 376 | [ | 
|---|
| 377 | AC_LANG_SAVE | 
|---|
| 378 | AC_LANG_CPLUSPLUS | 
|---|
| 379 | LX_FIND_MPI | 
|---|
| 380 | AC_LANG_RESTORE | 
|---|
| 381 | AS_IF([test "x$have_CXX_mpi" = xyes],[ | 
|---|
| 382 | AC_DEFINE([MPICH_SKIP_MPICXX], [1], [Skip C++ bindings]) | 
|---|
| 383 | AC_DEFINE([OMPI_SKIP_MPICXX], [1], [Skip C++ bindings]) | 
|---|
| 384 | AC_DEFINE([MPI_NO_CPPBIND], [1], [Skip C++ bindings]) | 
|---|
| 385 | AC_DEFINE([_MPICC_H], [1], [Skip C++ bindings]) | 
|---|
| 386 | AC_DEFINE([MPIBULL_SKIP_MPICXX], [1], [Skip C++ bindings]) | 
|---|
| 387 | #ac_configure_args="$ac_configure_args --with-mpi-thread=single --with-default-parallel=mpi --with-include=\"$MPI_CXXFLAGS\" --with-libs=\"$MPI_CXXLDFLAGS\"" | 
|---|
| 388 | ac_configure_args="$ac_configure_args --with-default-parallel=none" | 
|---|
| 389 | ]) | 
|---|
| 390 | ], | 
|---|
| 391 | []) | 
|---|
| 392 | ]) | 
|---|
| 393 | AC_MSG_RESULT($compile_vmg) | 
|---|
| 394 | AM_CONDITIONAL([CONDVMG], [test x"$enable_vmg" = x"yes"]) | 
|---|
| 395 | AM_CONDITIONAL([CONDVMGMPI], [test x"$have_CXX_mpi" = x"yes"]) | 
|---|
| 396 | AM_CONDITIONAL([COND_COMPILE_VMG], [test x"$compile_vmg" = x"yes"]) | 
|---|
| 397 |  | 
|---|
| 398 |  | 
|---|
| 399 | # Check for Levenberg-Marquardt implementation | 
|---|
| 400 | AC_MSG_CHECKING(whether to enable function fitting via levmar) | 
|---|
| 401 | AC_ARG_ENABLE( | 
|---|
| 402 | [levmar], | 
|---|
| 403 | AS_HELP_STRING([--enable-levmar],[turn on LevMar feature [default=no]]), | 
|---|
| 404 | enable_levmar=$enableval, | 
|---|
| 405 | enable_levmar="no") | 
|---|
| 406 | AC_MSG_RESULT($enable_levmar) | 
|---|
| 407 | # don't use AS_IF here as it expands (and tests) AC_F77_FUN even if levmar | 
|---|
| 408 | # is disabled. | 
|---|
| 409 | compile_levmar="no" | 
|---|
| 410 | AS_IF([test x"$enable_levmar" = xyes],[ | 
|---|
| 411 | AC_MSG_CHECKING(for levmar presence via given path ) | 
|---|
| 412 | AC_ARG_WITH( | 
|---|
| 413 | [levmar], | 
|---|
| 414 | [AS_HELP_STRING([--with-levmar], [give path to LevMar package])], | 
|---|
| 415 | [have_levmar_path=$withval | 
|---|
| 416 | enable_levmar=yes], | 
|---|
| 417 | [ | 
|---|
| 418 | enable_levmar=no | 
|---|
| 419 | ]) | 
|---|
| 420 | AC_MSG_RESULT($enable_levmar) | 
|---|
| 421 | AS_IF([test -n "$have_levmar_path"],[ | 
|---|
| 422 | LEVMAR_CPPFLAGS="-I${have_levmar_path}/include" | 
|---|
| 423 | LEVMAR_LDFLAGS="-L${have_levmar_path}/lib" | 
|---|
| 424 | LEVMAR_LIBS="-llevmar"], | 
|---|
| 425 | [PKG_CHECK_MODULES([LEVMAR],[levmar],[enable_levmar=yes],[enable_levmar=no]) | 
|---|
| 426 | ]) | 
|---|
| 427 | ],[enable_levmar=no] | 
|---|
| 428 | ) | 
|---|
| 429 | if test x"$enable_levmar" = xyes; then | 
|---|
| 430 | AX_LAPACK([enable_levmar=yes], | 
|---|
| 431 | [enable_levmar=no | 
|---|
| 432 | AC_MSG_WARN(["Missing LAPACK, disabling off levmar"]) | 
|---|
| 433 | ] | 
|---|
| 434 | ) | 
|---|
| 435 | else | 
|---|
| 436 | AC_CONFIG_SUBDIRS([ThirdParty/levmar]) | 
|---|
| 437 | compile_levmar="yes" | 
|---|
| 438 | enable_levmar="yes" | 
|---|
| 439 | LEVMAR_CPPFLAGS='-I$(top_srcdir)/ThirdParty/levmar/src' | 
|---|
| 440 | LEVMAR_LDFLAGS='-L$(top_builddir)/ThirdParty/levmar/src' | 
|---|
| 441 | LEVMAR_LIBS='-llevmar' | 
|---|
| 442 | fi | 
|---|
| 443 | AC_MSG_CHECKING(for levmar usability) | 
|---|
| 444 | AS_IF([test x"$enable_levmar" = xyes],[ | 
|---|
| 445 | AC_SUBST(LEVMAR_CPPFLAGS) | 
|---|
| 446 | AC_SUBST(LEVMAR_LDFLAGS) | 
|---|
| 447 | AC_SUBST(LEVMAR_LIBS) | 
|---|
| 448 | AC_DEFINE(HAVE_LEVMAR,1, ["use levmar for non-linear minimisation/potential fitting."])]) | 
|---|
| 449 | AC_MSG_RESULT($enable_levmar) | 
|---|
| 450 | AM_CONDITIONAL([CONDLEVMAR], [test x"$enable_levmar" = x"yes"]) | 
|---|
| 451 | AM_CONDITIONAL([COND_COMPILE_LEVMAR], [test x"$compile_levmar" = x"yes"]) | 
|---|
| 452 |  | 
|---|
| 453 | # Checks for header files. | 
|---|
| 454 | AC_HEADER_STDC | 
|---|
| 455 | AC_CHECK_HEADERS([sys/time.h]) | 
|---|
| 456 | AC_HEADER_STDBOOL | 
|---|
| 457 |  | 
|---|
| 458 | AC_FUNC_MALLOC | 
|---|
| 459 | AC_FUNC_REALLOC | 
|---|
| 460 | AC_CHECK_FUNCS([floor pow sqrt strchr]) | 
|---|
| 461 |  | 
|---|
| 462 | # Checks for typedefs, structures, and compiler characteristics. | 
|---|
| 463 | AC_C_CONST | 
|---|
| 464 | AC_C_INLINE | 
|---|
| 465 | AC_C_RESTRICT | 
|---|
| 466 | AC_TYPE_SIZE_T | 
|---|
| 467 |  | 
|---|
| 468 | # Checks for library functions. | 
|---|
| 469 | # check for GNU Scientific Library | 
|---|
| 470 | AC_CHECK_HEADERS([gsl/gsl_blas.h]) | 
|---|
| 471 | AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas) | 
|---|
| 472 | AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas) | 
|---|
| 473 | AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl) | 
|---|
| 474 | #AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])]) | 
|---|
| 475 | AC_CHECK_LIB(gsl, main) | 
|---|
| 476 |  | 
|---|
| 477 | # use CppUnit TestRunner or not | 
|---|
| 478 | AC_MSG_CHECKING(whether to enable ECut TestRunnerClient) | 
|---|
| 479 | AC_ARG_ENABLE( | 
|---|
| 480 | [ecut], | 
|---|
| 481 | AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]), | 
|---|
| 482 | enable_ecut=$disableval, | 
|---|
| 483 | enable_ecut="no") | 
|---|
| 484 | AC_MSG_RESULT($enable_ecut) | 
|---|
| 485 | AS_IF([test x"$enable_ecut" = x"yes"],[ | 
|---|
| 486 | AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."]) | 
|---|
| 487 | AC_SUBST(HAVE_ECUT) | 
|---|
| 488 | ]) | 
|---|
| 489 | AM_CONDITIONAL([CONDECUT], [test x"$enable_ecut" = x"yes"]) | 
|---|
| 490 |  | 
|---|
| 491 | # with valgrinding testsuite or not | 
|---|
| 492 | AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite) | 
|---|
| 493 | AC_ARG_ENABLE( | 
|---|
| 494 | [valgrind], | 
|---|
| 495 | AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]), | 
|---|
| 496 | enable_valgrind=$enableval, | 
|---|
| 497 | enable_valgrind="no") | 
|---|
| 498 | AC_MSG_RESULT($enable_valgrind) | 
|---|
| 499 | AS_IF([test x"$enable_valgrind" = x"yes"], [ | 
|---|
| 500 | AC_CHECK_HEADER([valgrind/valgrind.h], | 
|---|
| 501 | [ | 
|---|
| 502 | # check header | 
|---|
| 503 | AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."]) | 
|---|
| 504 | # check path | 
|---|
| 505 | AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false]) | 
|---|
| 506 | # set variables | 
|---|
| 507 | AC_SUBST(HAVE_VALGRIND_TESTSUITE) | 
|---|
| 508 | AC_SUBST(VALGRIND) | 
|---|
| 509 | ], | 
|---|
| 510 | [ | 
|---|
| 511 | AC_MSG_ERROR(["Valgrind support requested but headers not available."]) | 
|---|
| 512 | ] | 
|---|
| 513 | ) | 
|---|
| 514 | ]) | 
|---|
| 515 |  | 
|---|
| 516 | # Check for "extern inline", using a modified version | 
|---|
| 517 | # of the test for AC_C_INLINE from acspecific.mt | 
|---|
| 518 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline, | 
|---|
| 519 | [ac_cv_c_extern_inline=no | 
|---|
| 520 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x); | 
|---|
| 521 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; }; | 
|---|
| 522 | double foo (double x) { return x + 1.0; };], | 
|---|
| 523 | [  foo(1.0)  ], | 
|---|
| 524 | [ac_cv_c_extern_inline="yes"]) | 
|---|
| 525 | ]) | 
|---|
| 526 |  | 
|---|
| 527 | if test "$ac_cv_c_inline" != no ; then | 
|---|
| 528 | AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"]) | 
|---|
| 529 | AC_SUBST(HAVE_INLINE) | 
|---|
| 530 | fi | 
|---|
| 531 |  | 
|---|
| 532 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"]) | 
|---|
| 533 |  | 
|---|
| 534 | # test suite | 
|---|
| 535 |  | 
|---|
| 536 | AC_CONFIG_FILES([ | 
|---|
| 537 | tests/Makefile]) | 
|---|
| 538 |  | 
|---|
| 539 | AC_CONFIG_TESTDIR(tests/Calculations) | 
|---|
| 540 | AC_CONFIG_FILES([ | 
|---|
| 541 | tests/Calculations/atlocal | 
|---|
| 542 | tests/Calculations/Makefile]) | 
|---|
| 543 | AC_CONFIG_FILES([tests/Calculations/molecuilder], [chmod +x tests/Calculations/molecuilder]) | 
|---|
| 544 | AC_CONFIG_FILES([tests/Calculations/molecuilder_poolworker], [chmod +x tests/Calculations/molecuilder_poolworker]) | 
|---|
| 545 |  | 
|---|
| 546 | AC_CONFIG_TESTDIR(tests/CodeChecks) | 
|---|
| 547 | AC_CONFIG_FILES([ | 
|---|
| 548 | tests/CodeChecks/atlocal | 
|---|
| 549 | tests/CodeChecks/Makefile]) | 
|---|
| 550 |  | 
|---|
| 551 | AC_CONFIG_TESTDIR(tests/Fragmentations) | 
|---|
| 552 | AC_CONFIG_FILES([ | 
|---|
| 553 | tests/Fragmentations/atlocal | 
|---|
| 554 | tests/Fragmentations/Makefile]) | 
|---|
| 555 | AC_CONFIG_FILES([tests/Fragmentations/molecuilder], [chmod +x tests/Fragmentations/molecuilder]) | 
|---|
| 556 |  | 
|---|
| 557 | AC_CONFIG_TESTDIR(tests/GuiChecks) | 
|---|
| 558 | AC_CONFIG_FILES([ | 
|---|
| 559 | tests/GuiChecks/atlocal | 
|---|
| 560 | tests/GuiChecks/Makefile]) | 
|---|
| 561 | AC_CONFIG_FILES([tests/GuiChecks/molecuilder], [chmod +x tests/GuiChecks/molecuilder]) | 
|---|
| 562 | AC_CONFIG_FILES([tests/GuiChecks/molecuilderguitest], [chmod +x tests/GuiChecks/molecuilderguitest]) | 
|---|
| 563 | AC_CONFIG_FILES([tests/GuiChecks/adjacencymatcher], [chmod +x tests/GuiChecks/adjacencymatcher]) | 
|---|
| 564 | AC_CONFIG_FILES([tests/GuiChecks/difffragmentresultcontainer], [chmod +x tests/GuiChecks/difffragmentresultcontainer]) | 
|---|
| 565 | AC_CONFIG_FILES([tests/GuiChecks/trianglematcher], [chmod +x tests/GuiChecks/trianglematcher]) | 
|---|
| 566 |  | 
|---|
| 567 | AC_CONFIG_TESTDIR(tests/JobMarket) | 
|---|
| 568 | AC_CONFIG_FILES([ | 
|---|
| 569 | tests/JobMarket/atlocal | 
|---|
| 570 | tests/JobMarket/Makefile]) | 
|---|
| 571 | AC_CONFIG_FILES([tests/JobMarket/molecuilder], [chmod +x tests/JobMarket/molecuilder]) | 
|---|
| 572 |  | 
|---|
| 573 | AC_CONFIG_TESTDIR(tests/integration) | 
|---|
| 574 | AC_CONFIG_FILES([ | 
|---|
| 575 | tests/integration/atlocal | 
|---|
| 576 | tests/integration/Makefile]) | 
|---|
| 577 | AC_CONFIG_FILES([tests/integration/molecuilder], [chmod +x tests/integration/molecuilder]) | 
|---|
| 578 | AC_CONFIG_FILES([tests/integration/molecuilder_poolworker], [chmod +x tests/integration/molecuilder_poolworker]) | 
|---|
| 579 |  | 
|---|
| 580 | AC_CONFIG_TESTDIR(tests/regression) | 
|---|
| 581 | AC_CONFIG_FILES([ | 
|---|
| 582 | tests/regression/atlocal | 
|---|
| 583 | tests/regression/Makefile]) | 
|---|
| 584 | AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder]) | 
|---|
| 585 | AC_CONFIG_FILES([tests/regression/adjacencymatcher], [chmod +x tests/regression/adjacencymatcher]) | 
|---|
| 586 | AC_CONFIG_FILES([tests/regression/difffragmentresultcontainer], [chmod +x tests/regression/difffragmentresultcontainer]) | 
|---|
| 587 | AC_CONFIG_FILES([tests/regression/trianglematcher], [chmod +x tests/regression/trianglematcher]) | 
|---|
| 588 | AC_CONFIG_FILES([tests/regression/runpython], [chmod +x tests/regression/runpython]) | 
|---|
| 589 |  | 
|---|
| 590 | AC_CONFIG_TESTDIR(tests/Tesselations) | 
|---|
| 591 | AC_CONFIG_FILES([ | 
|---|
| 592 | tests/Tesselations/atlocal | 
|---|
| 593 | tests/Tesselations/Makefile]) | 
|---|
| 594 | AC_CONFIG_FILES([tests/Tesselations/molecuilder], [chmod +x tests/Tesselations/molecuilder]) | 
|---|
| 595 | AC_CONFIG_FILES([tests/Tesselations/trianglematcher], [chmod +x tests/Tesselations/trianglematcher]) | 
|---|
| 596 |  | 
|---|
| 597 | AC_CONFIG_TESTDIR(tests/Examples) | 
|---|
| 598 | AC_CONFIG_FILES([ | 
|---|
| 599 | tests/Examples/atlocal | 
|---|
| 600 | tests/Examples/Makefile]) | 
|---|
| 601 | AC_CONFIG_FILES([tests/Examples/molecuilder], [chmod +x tests/Examples/molecuilder]) | 
|---|
| 602 | AC_CONFIG_FILES([tests/Examples/molecuilder_poolworker], [chmod +x tests/Examples/molecuilder_poolworker]) | 
|---|
| 603 |  | 
|---|
| 604 | AC_CONFIG_FILES([ | 
|---|
| 605 | doc/molecuilder.xml]) | 
|---|
| 606 | AC_CONFIG_FILES([ | 
|---|
| 607 | doc/userguide/catalog.xml:doc/userguide/catalog.xml.in]) | 
|---|
| 608 | AC_CONFIG_FILES([ | 
|---|
| 609 | MoleCuilder.pc:MoleCuilder.pc.in]) | 
|---|
| 610 | AC_CONFIG_FILES([ | 
|---|
| 611 | doc/Makefile | 
|---|
| 612 | doc/userguide/Makefile | 
|---|
| 613 | ]) | 
|---|
| 614 | AC_CONFIG_FILES([ | 
|---|
| 615 | Makefile | 
|---|
| 616 | python/Makefile | 
|---|
| 617 | src/Makefile | 
|---|
| 618 | src/Bond/AdjacencyMatcher/Makefile | 
|---|
| 619 | src/Tesselation/TriangleMatcher/Makefile | 
|---|
| 620 | ThirdParty/Makefile | 
|---|
| 621 | data/icons/Makefile | 
|---|
| 622 | utils/Makefile | 
|---|
| 623 | ]) | 
|---|
| 624 | AC_CONFIG_FILES([ | 
|---|
| 625 | src/unittests/Makefile | 
|---|
| 626 | ]) | 
|---|
| 627 |  | 
|---|
| 628 | # produce python scripts and tests only when python's present | 
|---|
| 629 | AC_CONFIG_TESTDIR([tests/Python]) | 
|---|
| 630 | AC_CONFIG_FILES([tests/Python/atlocal]) | 
|---|
| 631 | AM_COND_IF([CONDPYTHON],[ | 
|---|
| 632 | AC_CONFIG_FILES([utils/Python/boxmaker.py:utils/Python/boxmaker.py.in], [chmod +x utils/Python/boxmaker.py]) | 
|---|
| 633 | AC_CONFIG_FILES([utils/Python/python_wrapper:utils/Python/python_wrapper.in], [chmod +x utils/Python/python_wrapper]) | 
|---|
| 634 | AC_CONFIG_FILES([tests/Python/run], [chmod +x tests/Python/run]) | 
|---|
| 635 | ]) | 
|---|
| 636 | AC_CONFIG_FILES([tests/Python/Makefile]) | 
|---|
| 637 |  | 
|---|
| 638 | AC_OUTPUT | 
|---|