From: Martin Kronbichler Date: Wed, 1 Sep 2010 13:25:39 +0000 (+0000) Subject: Refine test that checks for deal.II and Trilinos MPI consistency. X-Git-Tag: v8.0.0~5604 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ffff30ae3a54c4d65d07dac02e626b6ffb42fd1;p=dealii.git Refine test that checks for deal.II and Trilinos MPI consistency. git-svn-id: https://svn.dealii.org/trunk@21820 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index ef7f4cafa7..a12cdec0f1 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -5215,67 +5215,6 @@ dnl ]) -dnl ------------------------------------------------------------- -dnl Make sure that if Trilinos was built with/without MPI, then -dnl deal.II was built with the same flags. -dnl -dnl Usage: DEAL_II_CHECK_TRILINOS_MPI_CONSISTENCY -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++) - - CXXFLAGS="$CXXFLAGSG $INCLUDE -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. The following test fails if Trilinos wasn't - dnl built for MPI because in that case Trilinos installs - dnl a dummy MPI header file that we end up including, but - dnl this dummy header doesn't have prototypes for MPI_Init - AC_TRY_COMPILE( - [ - #include - ], - [ - MPI_Init (0,0); - ], - [ - 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. We can turn the above test around: if trilinos - dnl was built for MPI, then the Epetra_MpiComm header includes mpi.h - dnl which provides us with a declaration of MPI_Init. So if it - dnl compiles then this is an error - AC_TRY_COMPILE( - [ - #include - ], - [ - MPI_Init (0,0); - ], - [ - AC_MSG_ERROR([Trilinos was built for MPI, but deal.II is not!]) - exit 1; - ], - [ - AC_MSG_RESULT(yes) - ]) - fi - fi -]) - - - dnl ------------------------------------------------------------- dnl Check for Doxygen. @@ -6062,6 +6001,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_TRILINOS, dnl DEAL_II_DEFINE_DEAL_II_USE_TRILINOS=DEAL_II_USE_TRILINOS DEAL_II_CONFIGURE_TRILINOS_VERSION + DEAL_II_CHECK_TRILINOS_MPI_CONSISTENCY DEAL_II_CHECK_TRILINOS_SHARED_STATIC DEAL_II_CHECK_TRILINOS_WARNINGS DEAL_II_CHECK_TRILINOS_HEADER_FILES @@ -6119,6 +6059,67 @@ AC_DEFUN(DEAL_II_CONFIGURE_TRILINOS_VERSION, dnl +dnl ------------------------------------------------------------- +dnl Make sure that if Trilinos was built with/without MPI, then +dnl deal.II was built with the same flags. +dnl +dnl Usage: DEAL_II_CHECK_TRILINOS_MPI_CONSISTENCY +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++) + + CXXFLAGS="$CXXFLAGSG $INCLUDE -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 + fi +]) + + + dnl ------------------------------------------------------------ dnl Check whether the installed version of Trilinos uses shared dnl or static libs, or both. Produce an error if this doesn't diff --git a/deal.II/configure.in b/deal.II/configure.in index 19f581d3d0..e68fcaca8e 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -613,7 +613,6 @@ DEAL_II_CHECK_CPU_OPTIMIZATIONS dnl Last check: test whether CXXFLAGS and F77FLAGS are ok DEAL_II_CHECK_CXXFLAGS_CONSISTENCY DEAL_II_CHECK_F77FLAGS_CONSISTENCY -DEAL_II_CHECK_TRILINOS_MPI_CONSISTENCY