From 611f482a037d0b3ea91e2fdeb54da32f8be68f9a Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 13 Jun 2022 17:50:47 -0500 Subject: [PATCH] CMake: Use deal.II's global index type in Tpetra compatibility test We use Tpetra templates with types::global_dof_index throughout our codebase - so we should also check for compatibility with said index type. Alternatively, this information is also available in TpetraCore_config.h: /* #undef HAVE_TPETRA_INST_INT_INT */ /* #undef HAVE_TPETRA_INST_INT_LONG */ #define HAVE_TPETRA_INST_INT_LONG_LONG /* #undef HAVE_TPETRA_INST_INT_UNSIGNED */ /* #undef HAVE_TPETRA_INST_INT_UNSIGNED_LONG */ --- cmake/configure/configure_20_trilinos.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/configure/configure_20_trilinos.cmake b/cmake/configure/configure_20_trilinos.cmake index d87a785423..7363847146 100644 --- a/cmake/configure/configure_20_trilinos.cmake +++ b/cmake/configure/configure_20_trilinos.cmake @@ -227,14 +227,22 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) # supply the correct compiler and linker flags: ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_LINKER_FLAGS}") + IF(DEAL_II_WITH_64BIT_INDICES) + SET(_global_index_type "std::uint64_t") + ELSE() + SET(_global_index_type "unsigned int") + ENDIF() + CHECK_CXX_SOURCE_COMPILES( " + #include #include int main() { using LO = int; using GO = unsigned int; + using GO = ${_global_index_type}; using map_type = Tpetra::Map; Teuchos::RCP dummy_map = Teuchos::rcp(new map_type()); Tpetra::Vector dummy_vector(dummy_map); -- 2.39.5