diff --git a/config.h.in b/config.h.in index 79941dd18..9036b52ad 100644 --- a/config.h.in +++ b/config.h.in @@ -22,25 +22,11 @@ /* What MPI libraries are there? */ #define HAVE_LIBMPI 0 -#define HAVE_LIBMPICH 0 - -/* Should we use MPI ? */ -#if HAVE_LIBMPI || HAVE_LIBMPICH -#define HAVE_MPI 1 -#else -#define HAVE_MPI 0 -#endif +#define HAVE_LIBMPICH /* Is there an MPE library? */ #define HAVE_LIBMPE 0 -/* Should we use MPE ? */ -#if HAVE_LIBMPE && HAVE_MPI -#define HAVE_MPE 1 -#else -#define HAVE_MPE 0 -#endif - /* does the compiler support inline ? */ #undef inline @@ -325,7 +311,7 @@ #endif /* Should we use MPI ? */ -#if defined(HAVE_MPI_H) && (HAVE_LIBMPI || HAVE_LIBMPICH) +#if defined(HAVE_MPI_H) && (defined(HAVE_LIBMPI) || defined(HAVE_LIBMPICH)) #define HAVE_MPI 1 #else #define HAVE_MPI 0 diff --git a/configure b/configure index 09e68a44c..cf3f460d8 100755 --- a/configure +++ b/configure @@ -4793,6 +4793,10 @@ fi # Check whether --with-mpi was given. if test "${with_mpi+set}" = set; then : withval=$with_mpi; if test "$withval" = yes; then + if test -e /usr/lib/openmpi; then + CPPFLAGS="$CPPFLAGS -I/usr/openmpi/include" + LDFLAGS="$LDFLAGS -L/usr/openmpi/lib" + fi yap_cv_mpi=yes elif test "$withval" = no; then yap_cv_mpi=no @@ -6937,6 +6941,46 @@ fi CC=${OLD_CC} fi +OLD_CC=${CC} +CC=${LAM_MPI_CC} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -llam" >&5 +$as_echo_n "checking for main in -llam... " >&6; } +if ${ac_cv_lib_lam_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llam $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lam_main=yes +else + ac_cv_lib_lam_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lam_main" >&5 +$as_echo "$ac_cv_lib_lam_main" >&6; } +if test "x$ac_cv_lib_lam_main" = xyes; then : + LAMOBJS=yap_mpi."$SO" +else + LAMOBJS=no +fi + +CC=${OLD_CC} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7881,46 +7925,6 @@ fi fi -OLD_CC=${CC} -CC=${LAM_MPI_CC} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -llam" >&5 -$as_echo_n "checking for main in -llam... " >&6; } -if ${ac_cv_lib_lam_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llam $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lam_main=yes -else - ac_cv_lib_lam_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lam_main" >&5 -$as_echo "$ac_cv_lib_lam_main" >&6; } -if test "x$ac_cv_lib_lam_main" = xyes; then : - LAMOBJS=yap_mpi."$SO" -else - LAMOBJS=no -fi - -CC=${OLD_CC} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : diff --git a/configure.in b/configure.in index 68e567a8c..97cc58fd5 100755 --- a/configure.in +++ b/configure.in @@ -356,6 +356,11 @@ AC_ARG_WITH(matlab, AC_ARG_WITH(mpi, [ --with-mpi[=DIR] use MPI library in DIR], if test "$withval" = yes; then + dnl handle UBUNTU systems + if test -e /usr/lib/openmpi; then + CPPFLAGS="$CPPFLAGS -I/usr/openmpi/include" + LDFLAGS="$LDFLAGS -L/usr/openmpi/lib" + fi yap_cv_mpi=yes elif test "$withval" = no; then yap_cv_mpi=no @@ -1067,6 +1072,14 @@ then CC=${OLD_CC} fi +dnl LAM +OLD_CC=${CC} +CC=${LAM_MPI_CC} +AC_CHECK_LIB([lam], [main], + LAMOBJS=yap_mpi."$SO", + LAMOBJS=no) +CC=${OLD_CC} + AC_PROG_CPP if test "$cross_compiling" = "yes" @@ -1565,14 +1578,6 @@ AC_SUBST(ZLIB_INSTALL) fi -dnl LAM -OLD_CC=${CC} -CC=${LAM_MPI_CC} -AC_CHECK_LIB([lam], [main], - LAMOBJS=yap_mpi."$SO", - LAMOBJS=no) -CC=${OLD_CC} - dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT