From: Timo Heister Date: Tue, 7 Jan 2020 02:33:45 +0000 (-0500) Subject: add compile check X-Git-Tag: v9.2.0-rc1~546^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a5a61dfddf87feb8a3a7a3118ff65cb43d8ffe0;p=dealii.git add compile check --- 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: