From 6a5a61dfddf87feb8a3a7a3118ff65cb43d8ffe0 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 6 Jan 2020 21:33:45 -0500 Subject: [PATCH] add compile check --- cmake/configure/configure_2_trilinos.cmake | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/cmake/configure/configure_2_trilinos.cmake b/cmake/configure/configure_2_trilinos.cmake index 6e01e9dbca..89359216e0 100644 --- a/cmake/configure/configure_2_trilinos.cmake +++ b/cmake/configure/configure_2_trilinos.cmake @@ -246,6 +246,43 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) ENDIF() ENDIF() + IF(DEAL_II_TRILINOS_WITH_MUELU) + # + # Check if MueLu is actually usable. + # + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}") + + LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${Trilinos_LIBRARIES} ${MPI_LIBRARIES}) + + CHECK_CXX_SOURCE_COMPILES( + " + #include + int + main() + { + Epetra_CrsMatrix *matrix; + const auto teuchos_wrapped_matrix = Teuchos::rcp(matrix, false); + Teuchos::ParameterList parameters; + MueLu::CreateEpetraPreconditioner(teuchos_wrapped_matrix, parameters); + return 0; + } + " + TRILINOS_MUELU_IS_FUNCTIONAL + ) + + RESET_CMAKE_REQUIRED() + + IF(NOT TRILINOS_MUELU_IS_FUNCTIONAL) + MESSAGE( + STATUS + "MueLu was found but is not usable through Epetra! Disabling MueLu support." + ) + SET(DEAL_II_TRILINOS_WITH_MUELU OFF) + ENDIF() + ENDIF() + IF(${DEAL_II_TRILINOS_WITH_SACADO}) # # Look for Sacado_config.h - we'll query it to determine C++11 support: -- 2.39.5