From: Martin Kronbichler Date: Fri, 3 Sep 2010 16:49:28 +0000 (+0000) Subject: Fix test for Trilinos MPI. X-Git-Tag: v8.0.0~5591 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=671f34cd97930234c85191bf87228e67391f2eca;p=dealii.git Fix test for Trilinos MPI. git-svn-id: https://svn.dealii.org/trunk@21856 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 6920838b56..3acbd2ee35 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -6086,54 +6086,64 @@ dnl dnl ------------------------------------------------------------- AC_DEFUN(DEAL_II_CHECK_TRILINOS_MPI_CONSISTENCY, dnl [ - if test "x$USE_CONTRIB_TRILINOS" = "xyes" ; then - AC_MSG_CHECKING(for consistency of Trilinos and deal.II MPI settings) - AC_LANG(C++) + dnl Check for presence of Epetra_config.h that we need to detect MPI + dnl settings + AC_MSG_CHECKING(Epetra_config.h presence) + if test -f $DEAL_II_TRILINOS_INCDIR/Epetra_config.h ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + exit 1; + fi - CXXFLAGS="$CXXFLAGSG $INCLUDE -I$DEAL_II_TRILINOS_INCDIR" + AC_MSG_CHECKING(for consistency of Trilinos and deal.II MPI settings) + AC_LANG(C++) - if test "x$DEAL_II_USE_MPI" = "xyes" ; then - dnl So we support MPI. Check that our Trilinos installation - dnl does too. Epetra sets the variable HAVE_MPI to 1 in case - dnl supports MPI, and does not set it otherwise, so just read - dnl out that information. - AC_TRY_COMPILE( - [ - #include - ], - [ - #ifndef HAVE_MPI - compile error; - #endif - ], - [ - AC_MSG_RESULT(yes) - ], - [ - AC_MSG_ERROR([Trilinos was not built for MPI, but deal.II is!]) - exit 1; - ]) - else - dnl So we don't support MPI. Check that our Trilinos installation - dnl doesn't either. - AC_TRY_COMPILE( - [ - #include - ], - [ - #ifdef HAVE_MPI - compile error; - #endif - ], - [ - AC_MSG_RESULT(yes) - ], - [ - AC_MSG_ERROR([Trilinos was built for MPI, but deal.II is not!]) - exit 1; - ]) - fi + OLD_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -I$DEAL_II_TRILINOS_INCDIR" + + if test "x$DEAL_II_USE_MPI" = "xyes" ; then + dnl So we support MPI. Check that our Trilinos installation + dnl does too. Epetra sets the variable HAVE_MPI to 1 in case + dnl supports MPI, and does not set it otherwise, so just read + dnl out that information. + AC_TRY_COMPILE( + [ + #include + ], + [ + #ifndef HAVE_MPI + compile error; + #endif + ], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_ERROR([Trilinos was not built for MPI, but deal.II is!]) + exit 1; + ]) + else + dnl So we don't support MPI. Check that our Trilinos installation + dnl doesn't either. + AC_TRY_COMPILE( + [ + #include + ], + [ + #ifdef HAVE_MPI + compile error; + #endif + ], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_ERROR([Trilinos was built for MPI, but deal.II is not!]) + exit 1; + ]) fi + CXXFLAGS="${OLD_CXXFLAGS}" ])