1 AC_INIT(mrbayes, 3.2, http://www.mrbayes.net)
2 AC_CONFIG_SRCDIR(bayes.c)
3 AC_CONFIG_HEADER(config.h)
6 [--enable-debug=[no/yes] compile with debug support [default="no"]]
8 CFLAGS_DEFINED="NOTICE: Because the variable \$CFLAGS is defined in your shell, the
9 default MrBayes flags will be overridden. To ensure optimal performance, please check
10 that your \$CFLAGS variable is set correctly. Alternatively, unset the \$CFLAGS
11 variable in your shell in order to use the default MrBayes compiler options."
12 if test -n "${CFLAGS+x}"; then
13 AC_MSG_NOTICE([$CFLAGS_DEFINED]);
15 if test "x$enable_debug" == "xyes"; then
16 : ${CFLAGS="-ggdb -Wall"}
18 : ${CFLAGS="-O3"}; CFLAGS=$CFLAGS" -DNDEBUG";
23 AC_CHECK_LIB([m], [exp])
26 NOMPICC="No compiler for mpi has been found. If this is incorrect, please adjust your
27 path and rerun configure."
29 [--enable-mpi=[no/yes] compile the parallel version of mrbayes [default="no"]]
31 if test "x$enable_mpi" == "xyes"; then
32 AC_CHECK_PROG(mpicc,mpicc,yes,no)
33 if test "x$mpicc" == "xno"; then
34 AC_MSG_ERROR($NOMPICC);
36 AC_DEFINE(MPI_ENABLED)
39 # AC_ARG_ENABLE(fastlog,
40 # [--enable-fastlog=[no/yes] enable fast log operations [default="no"]]
41 # ,,enable_fastlog="no")
42 # if test "x$enable_fastlog" == "xyes"; then
43 # AC_DEFINE(FAST_VERSION)
49 [--enable-sse=[no/yes] enable sse instructions [default="yes"]]
51 if test "x$enable_sse" == "xyes"; then
52 AC_MSG_CHECKING(for SSE support)
56 #include <xmmintrin.h>
60 void *ptr = (void *) NULL;
61 const size_t align = 32;
62 res = posix_memalign(&ptr, align, align);
63 m1 = _mm_add_ps (m2, m1);
68 AC_DEFINE(SSE_ENABLED)
73 # ------------------------------------------------------------------------------
75 # ------------------------------------------------------------------------------
78 [AS_HELP_STRING([--with-beagle[[=PATH]]],
79 [enable beagle and optionally set prefix where beagle is installed if not
80 /usr/local @<:@default=yes@:>@])],
84 AC_ARG_ENABLE(threads,
85 [--enable-threads=[no/yes] enable thread-support when using BEAGLE [default="no"]]
86 ,,enable_threads="no")
88 if test "x$with_beagle" != "xno"
90 if test "x$with_beagle" == "xyes"
92 with_beagle=/usr/local
95 AC_CHECK_FILE($with_beagle/include/libhmsbeagle/libhmsbeagle/beagle.h,
96 [BEAGLE_CFLAGS="-I$with_beagle/include/libhmsbeagle"],
97 [AC_CHECK_FILE($with_beagle/include/libhmsbeagle-1/libhmsbeagle/beagle.h,
98 [BEAGLE_CFLAGS="-I$with_beagle/include/libhmsbeagle-1"],
99 [AC_CHECK_FILE($with_beagle/libhmsbeagle/beagle.h,
100 [BEAGLE_CFLAGS="-I$with_beagle"],
101 [AC_MSG_ERROR([beagle's library include file beagle.h is not found neither in
102 ${with_beagle}/include/libhmsbeagle/libhmsbeagle/ nor in
103 ${with_beagle}/include/libhmsbeagle-1/libhmsbeagle/]. You should either install
104 beagle library from http://code.google.com/p/beagle-lib/ or disable use of
105 beagle library by invoking configure script with option --with-beagle=no.
106 Note: without beagle library MrBayes may run slower.)])])
108 AC_CHECK_FILE($with_beagle/include/libhmsbeagle/libhmsbeagle/platform.h,,
109 [AC_CHECK_FILE($with_beagle/include/libhmsbeagle-1/libhmsbeagle/platform.h,,
110 [AC_CHECK_FILE($with_beagle/libhmsbeagle/platform.h,,
111 [AC_MSG_ERROR([beagle's library include file platform.h is not found neither in
112 ${with_beagle}/include/libhmsbeagle/libhmsbeagle/ nor in
113 ${with_beagle}/include/libhmsbeagle-1/libhmsbeagle/]. You should either install
114 beagle library from http://code.google.com/p/beagle-lib/ or disable use of
115 beagle library by invoking configure script with option --with-beagle=no.
116 Note: without beagle library MrBayes may run slower.)])])
118 AC_CHECK_FILE($with_beagle/lib,[BEAGLE_LIBS="-L$with_beagle/lib -lhmsbeagle"],
119 [AC_CHECK_FILE($with_beagle/libhmsbeagle/libs,
120 [BEAGLE_LIBS="-L$with_beagle/libhmsbeagle/libs -lhmsbeagle"],
121 [AC_MSG_ERROR([beagle library is not found in ${with_beagle}]. You should either
122 install beagle library from http://code.google.com/p/beagle-lib/ or disable use
123 of beagle library by invoking configure script with option --with-beagle=no.
124 Note: without beagle library MrBayes may run slower.)])
127 AC_DEFINE(BEAGLE_ENABLED)
128 CFLAGS="${CFLAGS} ${BEAGLE_CFLAGS}"
129 LDFLAGS="${LDFLAGS} ${BEAGLE_LIBS}"
131 # ----- Check for pthreads compatibility -------
133 if test "x$enable_threads" == "xyes"
135 AC_CHECK_LIB(pthread,pthread_create,[THREAD_LIB="-lpthread"],
136 [AC_MSG_ERROR([pthreads library not found])])
137 AC_DEFINE(THREADS_ENABLED)
140 # ------------------------------------------------------------------------------
147 AC_DEFINE(UNIX_VERSION)
149 dnl use c for custom tests
153 AC_CHECK_LIB([readline], [readline])
154 if test $ac_cv_lib_readline_readline = yes; then
155 LDFLAGS=${LDFLAGS}" -lreadline"
156 AC_MSG_CHECKING(for rl_completion_matches function)
160 #include <readline/readline.h>
161 #include <readline/history.h>
162 char *f(const char *a, int f) { return "a"; }
165 extern char *f(const char *, int);
166 char **matches = rl_completion_matches (text, f);
171 AC_DEFINE(COMPLETIONMATCHES), AC_MSG_RESULT(no))
175 AC_MSG_CHECKING(for 32 or 64 bits cpu)
178 int main() { return sizeof(long)==4?1:0; }
181 AC_DEFINE(_64BIT), AC_MSG_RESULT(32))
184 if test "x$enable_mpi" == "xyes"; then
188 AC_CONFIG_FILES([Makefile])