From 7b76831f8eefef5065a39560f1dcd5c7f101fc86 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 18 Sep 2012 09:54:45 +0000 Subject: [PATCH] Bugfix: Search for Epetra_MpiComm.h as a check whether trilinos was build with mpi support git-svn-id: https://svn.dealii.org/branches/branch_cmake@26465 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 2 +- .../cmake/check/check_for_cxx_features.cmake | 16 +++++++-------- .../cmake/configure/configure_trilinos.cmake | 20 ++++++++++++------- .../contrib/cmake/setup_external_macros.cmake | 3 ++- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index a3e0458d78..238ef5bc96 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -97,7 +97,7 @@ OPTION(DEAL_II_ALLOW_CONTRIB OPTION(DEAL_II_WITH_ARPACK "Build deal.II with support for ARPACK." - ON) + OFF) OPTION(DEAL_II_WITH_BLAS "Build deal.II with support for BLAS." diff --git a/deal.II/contrib/cmake/check/check_for_cxx_features.cmake b/deal.II/contrib/cmake/check/check_for_cxx_features.cmake index 2fd7f860ca..7056da90ef 100644 --- a/deal.II/contrib/cmake/check/check_for_cxx_features.cmake +++ b/deal.II/contrib/cmake/check/check_for_cxx_features.cmake @@ -219,11 +219,11 @@ CHECK_CXX_SOURCE_COMPILES( # Checks for various header files: # TODO: Obsolete? # -CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H) -CHECK_INCLUDE_FILES("stdlib.h" HAVE_STDLIB_H) -CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H) -CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H) -CHECK_INCLUDE_FILES("sys/stat.h" HAVE_SYS_STAT_H) -CHECK_INCLUDE_FILES("sys/syscall.h" HAVE_SYS_SYSCALL_H) -CHECK_INCLUDE_FILES("sys/times.h" HAVE_SYS_TIMES_H) -CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) +CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) +CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) +CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) +CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE("sys/syscall.h" HAVE_SYS_SYSCALL_H) +CHECK_INCLUDE_FILE("sys/times.h" HAVE_SYS_TIMES_H) +CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) diff --git a/deal.II/contrib/cmake/configure/configure_trilinos.cmake b/deal.II/contrib/cmake/configure/configure_trilinos.cmake index 74e7c58c82..e8a9384887 100644 --- a/deal.II/contrib/cmake/configure/configure_trilinos.cmake +++ b/deal.II/contrib/cmake/configure/configure_trilinos.cmake @@ -85,15 +85,21 @@ it incompatible with deal.II. Please use versions before 10.6 or after # # Trilinos has to be configured with the same MPI configuration as - # deal.II. So check this: + # deal.II. TODO: Refine this check... # - # TODO: Refine this check... + # - IF(NOT "${Trilinos_MPI_EXEC}" EQUAL "") - SET(TRILINOS_USE_MPI TRUE) - ENDIF() - IF( (TRILINOS_USE_MPI AND NOT DEAL_II_COMPILER_SUPPORTS_MPI) OR - (NOT TRILINOS_USE_MPI AND DEAL_II_COMPILER_SUPPORTS_MPI)) + # Epetra installs Epetra_MpiComm.h if configured trilinos was + # configured with mpi. We use this as a check for the mpi configuration + # of Epetra. + # + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIR}) + CHECK_INCLUDE_FILE_CXX("Epetra_MpiComm.h" TRILINOS_HAVE_EPETRA_MPICOMM_H) + LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIR}) + + IF( (TRILINOS_HAVE_EPETRA_MPICOMM_H AND NOT DEAL_II_COMPILER_SUPPORTS_MPI) + OR + (NOT TRILINOS_HAVE_EPETRA_MPICOMM_H AND DEAL_II_COMPILER_SUPPORTS_MPI)) MESSAGE(WARNING " Trilinos has to be configured with the same MPI configuration as deal.II. diff --git a/deal.II/contrib/cmake/setup_external_macros.cmake b/deal.II/contrib/cmake/setup_external_macros.cmake index 415c8489fe..a5e11f4b32 100644 --- a/deal.II/contrib/cmake/setup_external_macros.cmake +++ b/deal.II/contrib/cmake/setup_external_macros.cmake @@ -6,4 +6,5 @@ INCLUDE(CheckCXXCompilerFlag) INCLUDE(CheckCXXSourceCompiles) INCLUDE(CheckCXXSourceRuns) INCLUDE(CheckFunctionExists) -INCLUDE(CheckIncludeFiles) +INCLUDE(CheckIncludeFile) +INCLUDE(CheckIncludeFileCXX) -- 2.39.5