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