--- trunk/OOPSE/ac-tools/configure.in 2004/01/05 21:00:05 894 +++ trunk/OOPSE/ac-tools/configure.in 2004/06/03 20:02:18 1228 @@ -6,7 +6,6 @@ builtin(include, ac-tools/aclocal.m4) builtin(include, ac-tools/fortran90.m4) builtin(include, ac-tools/aclocal.m4) - AC_CONFIG_SRCDIR([src/oopse.cpp]) AC_PREFIX_DEFAULT("/usr/local") @@ -33,7 +32,8 @@ AC_PROG_CXX([icpc icc xlC CC g++ c++]) AC_PROG_CC([icc xlc gcc cc]) dnl Checks for C++ compiler -AC_PROG_CXX([icpc icc xlC CC g++ c++]) +AC_PROG_CXX([icpc icc xlc++ xlC CC g++ c++]) + dnl If we are not running g++ then we might need some other flags dnl to get the templates compiled correctly OOPSE_TEMPLATE_FLAGS="" @@ -69,6 +69,8 @@ if test $ac_cv_prog_gxx = no; then echo 'void f(){}' > conftest.cc if test -z "`${CXX} -LANG:std -c conftest.cc 2>&1`"; then AC_MSG_RESULT(yes) + + EXTRA_CC_FLAG=${EXTRA_CC_FLAG}" -LANG:std" else AC_MSG_RESULT(no) @@ -79,7 +81,7 @@ AC_PROG_F90([ifc f90 xlf90 pgf90 epcf90 f95 xlf95 lf95 dnl Fortran 90 compilation checks are next -AC_PROG_F90([ifc f90 xlf90 pgf90 epcf90 f95 xlf95 lf95 fort g95]) +AC_PROG_F90([ifort ifc f90 xlf90 pgf90 epcf90 f95 xlf95 lf95 fort g95]) dnl Check the flag for Fortran90 preprocessing ACX_PROG_F90_PREPFLAG dnl Check to see if a flag is required for preprocessing defines @@ -121,82 +123,100 @@ AC_MSG_CHECKING([for mpi-directory]) exit 1 fi -AC_MSG_CHECKING([for mpi-directory]) -AC_ARG_WITH(mpi_dir, - [ --with-mpi_dir=MPIDIR give the path for MPI [/usr/local]], - MPI_DIR="$withval", MPI_DIR="/usr/local") -AC_MSG_RESULT([$MPI_DIR]) -AC_SUBST([mpi_dir]) - -AC_MSG_CHECKING([for mpi-lib-directory]) -AC_ARG_WITH(mpi_libdir, - [ --with-mpi-libdir=dir give the path for MPI-libraries [MPI_DIR/lib]], - MPI_LIBDIR="$withval", MPI_LIBDIR="$MPI_DIR/lib") -AC_MSG_RESULT([$MPI_LIBDIR]) -AC_SUBST([MPI_LIBDIR]) - -AC_MSG_CHECKING([for mpi-inc-directory]) -AC_ARG_WITH(mpi_inc, - [ --with-mpi_inc=dir give the path for MPI-include-files [MPI_DIR/include]], - MPI_INC="$withval", MPI_INC="$MPI_DIR/include") -AC_MSG_RESULT([$MPI_INC]) -AC_SUBST([MPI_INC]) - - -AC_MSG_CHECKING([for MPI library]) -MPI_LIB="" -case "$host" in - *-ibm-aix*) dnl IBM/SP2 machines - dnl checking whether to use signal-based MPI - - AC_MSG_CHECKING([whether to use signal-based MPI library]) - AC_MSG_RESULT([$PACX_SIGNAL]) - if test "x$PACX_SIGNAL" = "xyes" ; then - if test -f "$MPI_LIBDIR/libmpi.a" ; then - MPI_LIB="-lmpi" - elif test -f "$MPI_LIBDIR/libmpi.so" ; then - MPI_LIB="-lmpi" - elif test -f "$MPI_LIBDIR/libmpich.a" ; then - MPI_LIB="-lmpich" - else - AC_MSG_ERROR([neither libmpi nor libmpich found; check path for MPI package first...]) - fi - else - if test -f "$MPI_LIBDIR/libmpi_r.a" ; then - MPI_LIB="-lmpi_r" - else - AC_MSG_ERROR([libmpi_r not found; check path for MPI package...]) - fi - fi - AC_MSG_RESULT(found $MPI_LIB) - ;; - *) dnl All other machines - if test -f "$MPI_LIBDIR/libmpi.a" ; then - MPI_LIB="-lmpi" - elif test -f "$MPI_LIBDIR/libmpi.so" ; then - MPI_LIB="-lmpi" - elif test -f "$MPI_LIBDIR/libmpich.a" ; then - MPI_LIB="-lmpich" - else - AC_MSG_ERROR([neither libmpi nor libmpich found; check path for MPI package first...]) - fi - AC_MSG_RESULT(found $MPI_LIB) - ;; -esac -AC_SUBST(MPI_LIB) - ACX_MPI +dnl AC_MSG_CHECKING([for mpi-directory]) +dnl AC_ARG_WITH(mpi, +dnl [ --with-mpi=MPIDIR give the path for MPI [/usr/local]], +dnl MPI_DIR="$withval", MPI_DIR="/usr/local") +dnl AC_MSG_RESULT([$MPI_DIR]) +dnl AC_SUBST([mpi]) -AC_CHECK_MPI_F90MOD - -if test "$HAVE_MPI_MOD" = 1; then - AC_DEFINE(MPI_MOD, 1, [have mpi module]) -else - AC_LANG([Fortran 90]) - AC_CHECK_HEADERS(mpif.h) - AC_LANG_RESTORE() - AC_DEFINE(MPI_H, 1, [have mpi Fortran header file]) -fi +dnl AC_MSG_CHECKING([for mpi-lib-directory]) +dnl AC_ARG_WITH(mpi_libdir, +dnl [ --with-mpi-libdir=dir give the path for MPI-libraries [MPI_DIR/lib]], +dnl MPI_LIBDIR="$withval", MPI_LIBDIR="$MPI_DIR/lib") +dnl AC_MSG_RESULT([$MPI_LIBDIR]) +dnl AC_SUBST([MPI_LIBDIR]) +dnl +dnl AC_MSG_CHECKING([for mpi-inc-directory]) +dnl AC_ARG_WITH(mpi-inc, +dnl [ --with-mpi-inc=dir give the path for MPI-include-files [MPI_DIR/include]], +dnl MPI_INC="$withval", MPI_INC="$MPI_DIR/include") +dnl AC_MSG_RESULT([$MPI_INC]) +dnl AC_SUBST([MPI_INC]) +dnl +dnl AC_MSG_CHECKING([for mpi.h]) +dnl HAVE_MPIDOTH_C="no" +dnl echo '#include ' > conftest.cc +dnl if test -z "`${CXX} -I${MPI_INC} -c conftest.cc 2>&1`"; then +dnl AC_MSG_RESULT(yes) +dnl HAVE_MPIDOTH_C="yes" +dnl else +dnl AC_MSG_RESULT(no! Check MPI include paths) +dnl fi +dnl rm -f conftest* +dnl +dnl AC_MSG_CHECKING([whether mpif.h is usable]) +dnl HAVE_MPIFDOTH_F90="no" +dnl rm -f conftest* +dnl cat >conftest.f90 < conftest.out 2>&1 ; then + dnl AC_MSG_RESULT(yes) + dnl MPI_F90INC="$MPI_INC" + dnl HAVE_MPIFDOTH_F90="yes" +dnl else + dnl if test -s conftest.out ; then cat conftest.out >> config.log ; fi + dnl AC_MSG_RESULT([no! Check MPI include paths]) +dnl fi +dnl rm -f conftest* +dnl AC_SUBST([MPI_F90INC]) +dnl +dnl AC_LANG_PUSH(C) +dnl ac_save_LDFLAGS=$LDFLAGS +dnl LDFLAGS="${LDFLAGS} -L${MPI_LIBDIR} " +dnl +dnl if test x = x"$MPI_LIB"; then + dnl AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi"]) +dnl fi +dnl if test x = x"$MPI_LIB"; then + dnl AC_CHECK_LIB(mpich, MPI_Init, [MPI_LIB="-lmpich"]) +dnl fi +dnl $as_unset ac_cv_lib_mpi_MPI_Init +dnl if test x = x"$MPI_LIB"; then + dnl AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam"], [], + dnl "-llam") +dnl fi +dnl +dnl $as_unset ac_cv_lib_mpi_MPI_Init +dnl if test x = x"$MPI_LIB"; then + dnl AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam -lpthread"], + dnl [AC_MSG_ERROR([Didn't find liblam, libmpi, or libmpich; check path for MPI package first...])], + dnl [-llam -lpthread]) +dnl fi +dnl +dnl AC_MSG_RESULT(found $MPI_LIB) +dnl AC_SUBST(MPI_LIB) +dnl +dnl AC_MSG_CHECKING([for MPI Fortran library]) +dnl MPI_F90LIB="" +dnl if test -f "$MPI_LIBDIR/libfmpich.a" ; then + dnl MPI_F90LIB="-lfmpich" +dnl elif test -f "$MPI_LIBDIR/liblamf77mpi.a" ; then + dnl MPI_F90LIB="-llamf77mpi" +dnl else + dnl # nothing special found, we'll assume that the C library is all we need + dnl MPI_F90LIB=" " +dnl fi +dnl AC_MSG_RESULT([found $MPI_F90LIB]) +dnl AC_SUBST(MPI_F90LIB) +dnl +dnl dnl CHECK_MPI +dnl +dnl ACX_MPI AM_PATH_SPRNG CHECK_MKL @@ -227,7 +247,7 @@ SUBDIRS="libBASS libmdtools src forceFields samples ut MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f" dnl **** Final list of subdirs -SUBDIRS="libBASS libmdtools src forceFields samples utils utils/sysbuilder staticProps third-party" +SUBDIRS="libBASS libmdtools src forceFields samples utils utils/sysbuilder staticProps third-party shapes" dnl **** Define CFLAGS etc empty to prevent configure from setting them CFLAGS=${CFLAGS-""} @@ -272,6 +292,7 @@ AC_CONFIG_FILES([Makefile samples/alkane/Makefile samples/argon/Makefile samples/beadLipid/Makefile samples/lipid/Makefile samples/metals/Makefile samples/water/Makefile + shapes/Makefile ]) AC_OUTPUT