# Trilinos has to be configured with the same MPI configuration as
# deal.II.
#
- # Epetra installs Epetra_MpiComm.h if configured trilinos was
- # configured with mpi. We use this as a check for the mpi configuration
- # of Epetra.
- #
- IF(EXISTS "${TRILINOS_INCLUDE_DIRS}/Epetra_MpiComm.h")
- SET(TRILINOS_WITH_MPI TRUE)
- ENDIF()
-
IF( (TRILINOS_WITH_MPI AND NOT DEAL_II_COMPILER_SUPPORTS_MPI)
OR
(NOT TRILINOS_WITH_MPI AND DEAL_II_COMPILER_SUPPORTS_MPI))
# TRILINOS_VERSION_MAJOR
# TRILINOS_VERSION_MINOR
# TRILINOS_VERSION_SUBMINOR
+# TRILINOS_WITH_MPI
#
INCLUDE(FindPackageHandleStandardArgs)
NO_SYSTEM_ENVIRONMENT_PATH
)
-#
-# Extract the major and minor version numbers:
-#
-STRING(REGEX REPLACE
- "^([0-9]+).*$" "\\1"
- TRILINOS_VERSION_MAJOR "${Trilinos_VERSION}")
-
-STRING(REGEX REPLACE
- "^[0-9]+\\.([0-9]+).*$" "\\1"
- TRILINOS_VERSION_MINOR "${Trilinos_VERSION}")
-
-STRING(REGEX REPLACE
- "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
- TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
-
-
SET(TRILINOS_INCLUDE_DIRS ${Trilinos_INCLUDE_DIRS})
#
UNSET(TRILINOS_LIBRARY_${_library} CACHE)
ENDFOREACH()
-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TRILINOS DEFAULT_MSG
TRILINOS_DIR
TRILINOS_INCLUDE_DIRS
TRILINOS_LIBRARIES
)
+
IF(TRILINOS_FOUND)
+
+ #
+ # Extract the major and minor version numbers:
+ #
+ STRING(REGEX REPLACE
+ "^([0-9]+).*$" "\\1"
+ TRILINOS_VERSION_MAJOR "${Trilinos_VERSION}")
+
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.([0-9]+).*$" "\\1"
+ TRILINOS_VERSION_MINOR "${Trilinos_VERSION}")
+
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+ TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
+
+ #
+ # Determine whether Trilinos was configured with MPI:
+ #
+ FIND_FILE(EPETRA_CONFIG_H Epetra_config.h
+ HINTS ${TRILINOS_INCLUDE_DIRS}
+ NO_DEFAULT_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ NO_CMAKE_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+ FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_MPI_STRING
+ REGEX "#define HAVE_MPI")
+ IF("${EPETRA_MPI_STRING}" STREQUAL "")
+ SET(TRILINOS_WITH_MPI FALSE)
+ ELSE()
+ SET(TRILINOS_WITH_MPI TRUE)
+ ENDIF()
+
+ UNSET(EPETRA_CONFIG_H CACHE)
+
MARK_AS_ADVANCED(
TRILINOS_DIR
TRILINOS_INCLUDE_DIRS
TRILINOS_LIBRARIES
)
+
ELSE()
+
IF(TRILINOS_DIR MATCHES "-NOTFOUND")
SET(TRILINOS_DIR "" CACHE STRING
"A hint to a Trilinos installation"