#######################################################################
AC_PREREQ(2.50)
-AC_INIT(gromacs, 4.0.99_development_20090605, [gmx-users@gromacs.org])
+AC_INIT(gromacs, 4.0.99-dev-20100305, [gmx-users@gromacs.org])
AC_CONFIG_SRCDIR(src/gmxlib/3dview.c)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST
# Simple options and makefile variables
#######################################################################
-
### Single/Double
AC_ARG_ENABLE(float,
[AC_HELP_STRING([--disable-float],
### MPI or not
AC_ARG_ENABLE(mpi,
[AC_HELP_STRING([--enable-mpi],
- [Compile for parallel runs using MPI])],,enable_mpi=no)
+ [Compile for parallel runs using MPI]
+ [(instead of threads)])],,enable_mpi=no)
### MPI environment
### MPI_IN_PLACE
AC_ARG_ENABLE(mpi-in-place,
[AC_HELP_STRING([--disable-mpi-in-place],
- [Disable MPI_IN_PLACE. For MPI implementations that have broken support for it (some versions of MPICH, for example).])],, enable_mpi_in_place=yes)
-
+ [Disable MPI_IN_PLACE. For MPI implementations]
+ [that have broken support for it ]
+ [(some versions of MPICH, for example).])],, enable_mpi_in_place=yes)
-AC_ARG_ENABLE(apple_64bit,
- [AC_HELP_STRING([--enable-apple-64bit],
- [Build 64bit binaries for newer Macs])],,enable_apple_64bit=no)
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],
AC_ARG_ENABLE(ia32_sse,
[AC_HELP_STRING([--disable-ia32-sse],
[Don't build SSE/SSE2 assembly loops on ia32])],,enable_ia32_sse=yes)
+
case "${host_cpu}-${host_vendor}" in
- i?86-apple)
- if test "$enable_apple_64bit" = "yes"; then
- enable_ia32_sse=no;
- fi
- ;;
i?86-*) ;;
*) enable_ia32_sse=no ;;
esac
[Don't build SSE assembly loops on X86_64])],,enable_x86_64_sse=yes)
case "${host_cpu}-${host_vendor}" in
x86_64-* | amd64-*) ;;
- i?86-apple)
- if test "$enable_apple_64bit" != "yes"; then
- enable_x86_64_sse=no;
- fi
- ;;
+ i?86-apple) ;;
*) enable_x86_64_sse=no ;;
esac
AC_ARG_ENABLE(threads,
- [AC_HELP_STRING([--enable-threads],
- [Compile for parallel runs using threads])],,enable_threads=no)
-
-# if test "$enable_threads" = "yes"; then
-# with_threads=pthreads;
-#fi
+ [AC_HELP_STRING([--disable-threads],
+ [Disable parallel runs using threads])],,enable_threads=yes)
### Use external BLAS/LAPACK libraries if the user wants to.
AC_DEFINE(GMX_QMMM_MOPAC,,[Use (modified) Mopac 7 for QM-MM calculations])
fi
+
AC_ARG_WITH(qmmm_orca,
[AC_HELP_STRING([--without-qmmm-mopac],
[Use ORCA for QM-MM])],,with_qmmm_orca=no)
fi
+AC_ARG_WITH(dlopen,
+ [AC_HELP_STRING([--without-dlopen],
+ [do not compile with dlopen, needed to read VMD]
+ [supported file formats])],,with_dlopen=yes)
+
+
+
############################################################
# Add some debug info: Who is building, and on what machine?
############################################################
AC_DEFINE_UNQUOTED([BUILD_MACHINE],["`uname -srm`"],[Hardware and OS version for build host])
+############################################################
+# Checks for requirements for version information generation
+############################################################
+generate_version=no
+if test -d $srcdir/.git ; then
+ AC_CHECK_PROG(have_git, git, yes, no)
+ if test "$have_git" = "yes" ; then
+ AC_MSG_CHECKING(for git >= 1.5.1)
+ if test "`git --version`" \< "git version 1.5.1" ; then
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT(yes)
+ generate_version=yes
+ AC_DEFINE(USE_VERSION_H,,[Use generated version info])
+ fi
+ fi
+ if test "$generate_version" = "no" ; then
+ AC_MSG_WARN([No compatible git version found, won't be able to generate proper development version information.])
+ fi
+fi
+AM_CONDITIONAL([USE_VERSION_H],[test "$generate_version" = "yes"])
+
############################################################
# Checks for programs
# fail on platforms where MPI executables can only be run through a batchqueue.
if test "$enable_mpi" = "yes"; then
+ enable_threads="no"
AC_CHECK_PROGS(MPICC, mpxlc mpicc mpcc hcc, $CC)
# now change the normal cc to the MPI one - see the comment above.
CC=$MPICC
+ CXX=$MPICC
AC_MSG_CHECKING([whether the MPI cc command works]) # be paranoid
AC_TRY_LINK([#include <mpi.h>],[int argc; char **argv; MPI_Init(&argc,&argv);],
AC_MSG_RESULT([yes]),AC_MSG_ERROR([Cannot compile and link MPI code with $CC]))
if test "$enable_mpi" = "yes"; then
AC_MSG_ERROR([Cannot use both threads and MPI - yet.])
fi
+ if test "$with_fft" = "fftw2"; then
+ AC_MSG_ERROR([fftw2 can't be used with threads. Use fftw3 or mkl.])
+ fi
+ AC_CHECK_HEADERS(unistd.h)
+ AC_CHECK_HEADERS(sys/time.h)
+ AC_CHECK_HEADERS(sched.h)
+ AC_CHECK_FUNCS(sysconf)
+
# for now we just assume pthreads
- ACX_PTHREAD(,AC_MSG_ERROR([Cannot find POSIX threads - required for thread support using configure!]))
+ ACX_PTHREAD(,AC_MSG_ERROR([Cannot find POSIX threads - required for thread support using configure!]))
LIBS="$PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS -I$srcdir/include"
+ CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS -I$srcdir/include"
CC="$PTHREAD_CC "
AC_DEFINE(THREAD_PTHREADS,,[Use pthreads for thread_mpi multithreading])
+
+ # profiling
+ AC_ARG_ENABLE(tmpi-profiling,
+ [AC_HELP_STRING([--enable-tmpi-profiling],
+ [Enables profiling of thread_mpi calls and wait times])],,
+ enable_tmpi_profiling=no)
+ if test "x$enable_tmpi_profiling" = "xyes"; then
+ AC_DEFINE(TMPI_PROFILE,,[Enable profiling for call and wait times])
+ fi
+
+ # check the atomics
+ AC_MSG_CHECKING(if atomic operations are supported)
+ CFLAGS_RET="$CFLAGS"
+ CXXFLAGS_RET="$CXXFLAGS"
+ CFLAGS="$CFLAGS -I$srcdir/include -DTMPI_CHECK_ATOMICS"
+ CXXFLAGS="$CXXFLAGS -I$srcdir/include -DTMPI_CHECK_ATOMICS"
+ # this sets a variable 'tmpi_atomics' to 'yes' if there are atomics.
+ AC_COMPILE_IFELSE([#include "thread_mpi/atomic.h" ],
+ [AC_MSG_RESULT(yes); tmpi_atomics=yes],
+ [AC_MSG_WARN(
+[No atomics.
+
+This compiler+CPU combination doesn't have working atomics.
+Thread support will be unbearably slow: disable threads.
+
+Atomics should work on all but the most obscure CPU+compiler combinations;
+if your system is not obscure -- like, for example, x86 with gcc -- please
+contact the developers.
+]); tmpi_atomics=no])
+ CFLAGS="$CFLAGS_RET"
+ CXXFLAGS="$CXXFLAGS_RET"
+
AC_DEFINE(GMX_THREADS,,[Use threads for parallelization])
AC_DEFINE(GMX_MPI,,[Make a parallel version of GROMACS using MPI])
AM_CONDITIONAL(THREAD_PARALLEL,true)
AC_MSG_RESULT(yes)
if test "$enable_float" = "yes"; then
AC_CHECK_LIB([fftw3f],main,,AC_MSG_ERROR([Cannot find fftw3f library]))
+ PKG_FFTW="fftw3f"
else
AC_CHECK_LIB([fftw3],main,,AC_MSG_ERROR([Cannot find fftw3 library]))
+ PKG_FFTW="fftw3"
fi
AC_DEFINE(GMX_FFT_FFTW3,,[Use FFTW3 FFT library])
],[
(Just install FFTW3 unless you really know what you are doing).
])
])
+ AC_SUBST(PKG_FFTW)
;;
mkl*)
))
## Check for library
# AC_CHECK_LIB([guide],main,,AC_MSG_ERROR([Cannot find libguide (Intel MKL)]))
- AC_CHECK_LIB([mkl],DftiComputeForward,,
- AC_MSG_ERROR([Cannot find Intel Math Kernel Library >= 6.0]))
-
+# AC_CHECK_LIB([mkl],DftiComputeForward,,
+# AC_MSG_ERROR([Cannot find Intel Math Kernel Library >= 6.0]))
+ # first check for older MKLs
+ AC_CHECK_LIB([mkl],DftiComputeForward,,[have_mkl="no"])
+ if test "$have_mkl" == "no"; then
+ # we assume it's a new MKL
+ LIBS="$LIBS -liomp5 -lmkl_sequential -lmkl_core"
+ LMKL=" -liomp5 -lmkl_sequential -lmkl_core"
+ AC_CHECK_LIB([mkl_intel_lp64],DftiComputeForward,,[have_mkl10_64="no"])
+ if test "$have_mkl10_64" == "no"; then
+ AC_CHECK_LIB([mkl_intel],DftiComputeForward,,[have_mkl10_32="no"])
+ if test "$have_mkl10_32" == "no"; then
+ AC_MSG_ERROR([Cannot find Intel Math Kernel Library >= 6.0])
+ fi
+ fi
+ fi
AC_DEFINE(GMX_FFT_MKL,,[Use Intel MKL FFT library])
+ AC_SUBST(LMKL)
;;
fftpack | no)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/time.h)
+AC_CHECK_HEADERS(dirent.h)
+AC_CHECK_HEADERS(copyfile.h)
+AC_CHECK_HEADERS(regex.h,,[AC_MSG_WARN(
+[No regex.h found.
+Regular expression matching in selections will be disabled.
+Selections still work, but the default groups can differ from
+those obtained with regular expressions enabled.
+Consider installing the regular expression library from GNU libc.])])
#####
# Checks for additional and/or optional functions or libraries.
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(gettimeofday)
+AC_CHECK_FUNCS(cbrt)
AC_CHECK_FUNCS(isnan)
AC_CHECK_FUNCS(_isnan)
+AC_CHECK_FUNCS(isfinite)
+AC_CHECK_FUNCS(_isfinite)
+AC_CHECK_FUNCS(fsync)
+AC_CHECK_FUNCS(fileno)
+AC_CHECK_FUNCS(copyfile)
# check for bool (must come late, since CFLAGS/includes might affect it)
AC_CHECK_TYPES([bool])
+# Apple OS X is a bit strange/braindead in that it always reports itself as i386, both for
+# 32 and 64 bit builds (even with the 64 bit kernel!).
+#
+# To get the SSE support right we check for the size of void * that we detected above...
+case "${host_vendor}-${host_os}" in
+ apple-darwin*)
+ if test $ac_cv_sizeof_voidp = 8; then
+ enable_ia32_sse=no;
+ else
+ enable_x86_64_sse=no;
+ fi
+ ;;
+ *) ;;
+esac
+
+
+
+
#####
# Look for X
AC_PATH_XTRA
# GNU Scientific Library or not
AC_ARG_WITH(gsl,
- [ --with-gsl Link to the GNU scientific library, enables extra functions in analysis],,with_gsl=no)
+ [AC_HELP_STRING([--with-gsl],[Link to the GNU scientific library, ]
+ [enables extra functions in analysis])],,with_gsl=no)
######
if test "$with_gsl" = "yes"; then
LDFLAGS="$ac_save_LDFLAGS -lgslcblas"
# gslcblas library found, check main lib
AC_CHECK_LIB(gsl,main)])])
+ PKG_GSL="gsl"
+ AC_SUBST(PKG_GSL)
#
fi
+######
+# Use OpenMM libraries
+######
+AC_ARG_WITH(openmm,
+ [ --with-openmm Use the OpenMM libraries to run on GPUs],,with_openmm=no)
+
+if test "$with_openmm" = "yes"; then
+
+ AC_PROG_CXX
+ CPPFLAGS="$CPPFLAGS -I$OPENMM_INSTALL_DIR/include"
+ INCLUDES="$INCLUDES -I$OPENMM_INSTALL_DIR/include"
+ LDFLAGS="$LDFLAGS -L$OPENMM_INSTALL_DIR/lib -lOpenMM"
+ #AC_CHECK_HEADERS([OpenMM.h],AC_CHECK_LIB(OpenMM,main))
+ #AC_CHECK_HEADERS([OpenMM.h],,AC_MSG_ERROR([Cannot find OpenMM.h file. Please set OPENMM_INSTALL_DIR.]))
+ AC_DEFINE([USE_OPENMM],,[Use OpenMM libraries to run on GPUs])
+
+# AS_CASE([${host_cpu}-${host_os}-${host_vendor}],
+# [i?86-linux*], [OPENMM_HOST=linux32],
+# [x86_64-linux*], [OPENMM_HOST=linux64],
+# [amd64-linux*], [OPENMM_HOST=linux64],
+# [i?86-darwin*-apple], [OPENMM_HOST=apple],
+# [OPENMM_HOST=""])
+# AC_SUBST([OPENMM_HOST])
+fi
+
+AM_CONDITIONAL([USE_OPENMM],[test "$with_openmm" = "yes"])
+
AC_ARG_WITH(xml,
- [ --without-xml do not link to the xml2 library, disallows the use of certain file formats],,with_xml=yes)
+ [AC_HELP_STRING([--without-xml],[do not link to the xml2 library,]
+ [disallows the use of certain file formats])],,with_xml=yes)
#########
# Check for libxml2, but it is optional, so dont stop
AC_CHECK_HEADERS([libxml/parser.h],AC_CHECK_LIB(xml2,main))
if test "$ac_cv_lib_xml2_main" = "yes"; then
INCLUDES="$INCLUDES -I/usr/include/libxml2"
+ PKG_XML2="libxml-2.0"
+ AC_SUBST(PKG_XML2)
+ if test "$enable_all_static" = "yes"; then
+ LDFLAGS_RET=$LDFLAGS
+ LDFLAGS="-static $LDFLAGS"
+ LIBS_RET="$LIBS"
+ LIBS="$LIBS -lz"
+ AC_MSG_CHECKING(for broken libxml2)
+ AC_TRY_RUN([
+#include <libxml/parser.h>
+main() {
+ xmlInitParser();
+ return 0;
+}],
+ AC_MSG_RESULT([no]),[AC_MSG_RESULT([yes])
+ AC_MSG_ERROR([Your libxml2 is broken for static linking, recompile it without threads or build gromacs without libxml])],[-lz])
+ LDFLAGS=$LDFLAGS_RET
+ LIBS="$LIBS_RET"
+ fi
fi
# restore CPPFLAGS
CPPFLAGS="$ac_save_CPPFLAGS"
# AC_TYPE_UID_T is broken on Mac OS X, so use generic tests instead
AC_CHECK_TYPES([uid_t],[],[AC_DEFINE(uid_t, int, [Define to `int' if <sys/types.h> doesn't define.])],[[#include <sys/types.h>]])
AC_CHECK_TYPES([gid_t],[],[AC_DEFINE(gid_t, int, [Define to `int' if <sys/types.h> doesn't define.])],[[#include <sys/types.h>]])
+
+AC_CHECK_TYPES([sig_atomic_t],[],[AC_DEFINE(sig_atomic_t, int, [Define to `int' (and hope it's atomic) if <signal.h> doesn't define it.])],[[#include <signal.h>]])
+
+
# Test stuff for ia32 and x86_64 assembly, and add objects/libraries.
if test "$enable_ia32_sse" = "yes" -o "$enable_x86_64_sse" = "yes"; then
AC_MSG_CHECKING([whether your compiler can handle assembly files (*.s)])
# Nothing to test right now.
+
+
#
# Test altivec support.
#
esac
+############
+# Check dlopen
+###########
+if test "$with_dlopen" = "yes"; then
+ AC_MSG_CHECKING(if dlopen supported)
+ CFLAGS_RET=$CFLAGS
+ #LDFLAGS="$lt_cv_dlopen_libs $LDFLAGS" #can't make the macro, which is getting lt_cv_dlopen_libs, to work
+ LDFLAGS_RET=$LDFLAGS
+ if test "$enable_all_static" = "yes"; then #make sure we test also whether it works static
+ LDFLAGS="$LDFLAGS -static"
+ fi
+ CFLAGS="-I$srcdir/include -DGMX_DLOPEN $CFLAGS"
+ AC_TRY_LINK([#include "$srcdir/src/gmxlib/vmddlopen.c"],,[AC_MSG_RESULT([yes])\
+ AC_DEFINE(GMX_DLOPEN,,[Compile with dlopen])],AC_MSG_RESULT([no]))
+ CFLAGS=$CFLAGS_RET
+ LDFLAGS=$LDFLAGS_RET
+fi
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ src/Makefile ])
AC_CONFIG_FILES([ src/gmxlib/Makefile ])
+AC_CONFIG_FILES([ src/gmxlib/libgmx${LIBSUFFIX}.pc:src/gmxlib/libgmx.pc.in ])
AC_CONFIG_FILES([ src/gmxlib/gmx_blas/Makefile ])
AC_CONFIG_FILES([ src/gmxlib/gmx_lapack/Makefile ])
AC_CONFIG_FILES([ src/gmxlib/selection/Makefile ])
AC_CONFIG_FILES([ include/thread_mpi/Makefile ])
AC_CONFIG_FILES([ include/thread_mpi/atomic/Makefile ])
AC_CONFIG_FILES([ src/mdlib/Makefile ])
+AC_CONFIG_FILES([ src/mdlib/libmd${LIBSUFFIX}.pc:src/mdlib/libmd.pc.in ])
AC_CONFIG_FILES([ src/kernel/Makefile ])
+AC_CONFIG_FILES([ src/kernel/libgmxpreprocess${LIBSUFFIX}.pc:src/kernel/libgmxpreprocess.pc.in ])
AC_CONFIG_FILES([ src/tools/Makefile ])
+AC_CONFIG_FILES([ src/tools/libgmxana${LIBSUFFIX}.pc:src/tools/libgmxana.pc.in ])
AC_CONFIG_FILES([ src/ngmx/Makefile ])
AC_CONFIG_FILES([ src/contrib/Makefile ])
AC_CONFIG_FILES([ scripts/Makefile ])
AC_CONFIG_FILES([ share/tutor/speptide/Makefile ])
AC_CONFIG_FILES([ share/template/Makefile ])
AC_CONFIG_FILES([ share/top/Makefile ])
+AC_CONFIG_FILES([ share/top/gmx.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/gmx2.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/encadv.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/encads.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/oplsaa.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/gromos43a1.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/gromos43a2.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/gromos45a3.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/gromos53a5.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/gromos53a6.ff/Makefile ])
+AC_CONFIG_FILES([ share/top/charmm27.ff/Makefile ])
AC_CONFIG_FILES([ share/html/Makefile ])
AC_CONFIG_FILES([ share/html/images/Makefile ])
AC_CONFIG_FILES([ share/html/online/Makefile ])
echo " installed you can issue make mdrun; make install-mdrun."
fi
-if test "$host_vendor" = "apple" -a "$enable_apple_64bit" = "no"; then
- echo ""
- echo "* Did you know that you can compile a 64-bit version of Gromacs to improve"
- echo " performance on recent Intel Macs? You need to install a 64-bit version"
- echo " of FFTW first (add -m64 to CFLAGS, or download it from the Gromacs site)"
- echo " after which you can simply specify --enable-apple-64bit to this script."
-fi
-
if test "$enable_shared" = "no"; then
echo ""
echo "* On most platforms you can save 10X space with dynamic libraries, although"
fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+if test "$tmpi_atomics" = "no"; then
+ echo ""
+ echo "* This compiler+CPU combination doesn't have working atomic operations."
+ echo " Thread support will be unbearably slow: the default number of threads"
+ echo " is set to 1."
+ echo " Atomics should work on all but the most obscure CPU+compiler"
+ echo " combinations; if your system is not obscure (like, for example, x86"
+ echo " with gcc) please contact the developers."
+ echo ""
+fi