]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Revert "CMake: Bugfix: Disable MPI check. This was a bad idea." and resolve symlinks...
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 27 May 2014 11:40:22 +0000 (11:40 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 27 May 2014 11:40:22 +0000 (11:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@32981 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_2_metis.cmake
deal.II/cmake/configure/configure_2_trilinos.cmake
deal.II/cmake/configure/configure_3_petsc.cmake
deal.II/cmake/configure/configure_hdf5.cmake
deal.II/cmake/configure/configure_mumps.cmake
deal.II/cmake/configure/configure_p4est.cmake
deal.II/cmake/macros/macro_check_mpi_interface.cmake [new file with mode: 0644]

index d5142a5432de4df69e2e02a07ed96fc32519aedf..4d499c0d6088064e99511a187073137fe3165e46 100644 (file)
@@ -36,6 +36,8 @@ MACRO(FEATURE_METIS_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
+
+    CHECK_MPI_INTERFACE(METIS ${var})
   ENDIF()
 ENDMACRO()
 
index aa7920e6b7c1e6a4781b974c7d882f95ae01f1e6..a79505384bc7ae189fac33c7cf157d202b6b9629 100644 (file)
@@ -178,6 +178,8 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
         SET(${var} FALSE)
       ENDIF()
     ENDIF()
+
+    CHECK_MPI_INTERFACE(TRILINOS ${var})
   ENDIF()
 ENDMACRO()
 
index 19675f272cc8902a64842aae85a4adfa2eb95228..662c30f8a348b6ebbcd1dff457fb09a25a0fac53 100644 (file)
@@ -93,6 +93,8 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
+
+    CHECK_MPI_INTERFACE(PETSC ${var})
   ENDIF()
 ENDMACRO()
 
index 84ff9b6963ec01ba93301299a0ebbc766f740259..6a335a232c20aaa0304d02fbf4f87c00f817955f 100644 (file)
@@ -40,6 +40,8 @@ MACRO(FEATURE_HDF5_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
+
+    CHECK_MPI_INTERFACE(HDF5 ${var})
   ENDIF()
 ENDMACRO()
 
index 213d1d320a255ad2cbf33d6f7dbaf9e3e22147af..ce1d2652b10b4a50073bda70e578a6c716b66136 100644 (file)
 
 SET(FEATURE_MUMPS_DEPENDS MPI LAPACK)
 
+
+MACRO(FEATURE_MUMPS_FIND_EXTERNAL var)
+  FIND_PACKAGE(MUMPS)
+
+  IF(MUMPS_FOUND)
+    SET(${var} TRUE)
+    CHECK_MPI_INTERFACE(MUMPS ${var})
+  ENDIF()
+ENDMACRO()
+
 CONFIGURE_FEATURE(MUMPS)
index eda005d2c5be88c7cf8c5045193304107c3bc757..25acd30d862478b6cf1b3f01d4eb761aee7bf7e9 100644 (file)
@@ -55,6 +55,8 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
+
+    CHECK_MPI_INTERFACE(P4EST ${var})
   ENDIF()
 ENDMACRO()
 
diff --git a/deal.II/cmake/macros/macro_check_mpi_interface.cmake b/deal.II/cmake/macros/macro_check_mpi_interface.cmake
new file mode 100644 (file)
index 0000000..e6d4295
--- /dev/null
@@ -0,0 +1,71 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2014 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# Check whether a feature is compiled against the same MPI library as the
+# one deal.II picked up
+#
+# Usage:
+#     CHECK_MPI_INTERFACE(_feature _var),
+#
+
+MACRO(CHECK_MPI_INTERFACE _feature _var)
+  IF(DEAL_II_WITH_MPI)
+
+    SET(_nope FALSE)
+
+    FOREACH(_library ${${_feature}_LIBRARIES})
+      IF( _library MATCHES "/libmpi[^/]*\\.so"
+          AND NOT _library MATCHES "f(77|90|ort)" )
+
+        GET_FILENAME_COMPONENT(_file1 ${_library} REALPATH)
+
+        SET(_not_found TRUE)
+        FOREACH(_mpi_library ${MPI_LIBRARIES})
+          GET_FILENAME_COMPONENT(_file2 ${_mpi_library} REALPATH)
+          IF("${_file1}" STREQUAL "${_file2}")
+            SET(_not_found FALSE)
+            BREAK()
+          ENDIF()
+        ENDFOREACH()
+
+        IF(_not_found)
+          SET(_nope TRUE)
+          BREAK()
+        ENDIF()
+      ENDIF()
+    ENDFOREACH()
+
+    IF(_nope)
+      MESSAGE(STATUS "Could not find a sufficient ${_feature} installation: "
+        "${_feature} is compiled against a different MPI library than the one "
+        "deal.II picked up."
+        )
+      TO_STRING(_str ${MPI_LIBRARIES})
+      SET(PETSC_ADDITIONAL_ERROR_STRING
+        ${PETSC_ADDITIONAL_ERROR_STRING}
+        "Could not find a sufficient ${_feature} installation:\n"
+        "${_feature} has to be compiled against the same MPI library as deal.II "
+        "but the link line of ${_feature} contains:\n"
+        "  ${_mpi_library}\n"
+        "which is not listed in MPI_LIBRARIES:\n"
+        "  MPI_LIBRARIES = \"${_str}\"\n"
+        )
+      SET(${_var} FALSE)
+    ENDIF()
+  ENDIF()
+ENDMACRO()
+

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.