]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Refine test that checks for deal.II and Trilinos MPI consistency.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 1 Sep 2010 13:25:39 +0000 (13:25 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 1 Sep 2010 13:25:39 +0000 (13:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@21820 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure.in

index ef7f4cafa7f364007c1944983a43dea1806881ef..a12cdec0f136bd96ea6cc99ef5daa69dee4a668f 100644 (file)
@@ -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 <Epetra_MpiComm.h>
-        ],
-       [
-            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 <Epetra_MpiComm.h>
-        ],
-       [
-            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 <Epetra_config.h>
+        ],
+       [
+         #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 <Epetra_config.h>
+       ],
+       [
+         #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
index 19f581d3d04c561b374aee02dfea18452b54c41f..e68fcaca8e5033227886e1648aeca7893370f59d 100644 (file)
@@ -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
 
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.