From: Daniel Arndt Date: Sat, 9 Feb 2019 23:53:53 +0000 (+0100) Subject: Check if Tpetra is usable X-Git-Tag: v9.1.0-rc1~309^2~15 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb42804a16d8ab7667f30757c9459e9cface8a2;p=dealii.git Check if Tpetra is usable --- diff --git a/cmake/configure/configure_2_trilinos.cmake b/cmake/configure/configure_2_trilinos.cmake index eca8862a0a..9b3c861395 100644 --- a/cmake/configure/configure_2_trilinos.cmake +++ b/cmake/configure/configure_2_trilinos.cmake @@ -158,6 +158,41 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) ENDFOREACH() ENDIF() + IF(${DEAL_II_TRILINOS_WITH_TPETRA}) + # + # Check if Tpetra is usable in fact. + # + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) + ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}") + LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${Trilinos_LIBRARIES}") + CHECK_CXX_SOURCE_COMPILES( + " + #include + int + main() + { + using LO = int; + using GO = unsigned int; + using Node = Kokkos::Compat::KokkosDeviceWrapperNode; + using map_type = Tpetra::Map; + Teuchos::RCP dummy_map = Teuchos::rcp(new map_type()); + Tpetra::Vector dummy_vector(dummy_map); + (void)dummy_vector; + return 0; + } + " + TRILINOS_TPETRA_IS_FUNCTIONAL + ) + RESET_CMAKE_REQUIRED() + IF(NOT TRILINOS_TPETRA_IS_FUNCTIONAL) + MESSAGE( + STATUS + "Tpetra was found but is not usable! Disabling Tpetra support." + ) + SET(DEAL_II_TRILINOS_WITH_TPETRA OFF) + ENDIF() + ENDIF() + IF(${DEAL_II_TRILINOS_WITH_SACADO}) # # Look for Sacado_config.h - we'll query it to determine C++11 support: