From: Matthias Maier Date: Tue, 23 Jul 2024 15:14:59 +0000 (-0500) Subject: CMake: clean up TPetra warnings: X-Git-Tag: v9.6.0-rc1~14^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1edfa9c722680eafa394534f29bff2bab079387b;p=dealii.git CMake: clean up TPetra warnings: - use our CMake indent style - avoid declaring unused DEAL_II* variables - make Tpetra status message shorter --- diff --git a/cmake/configure/configure_20_trilinos.cmake b/cmake/configure/configure_20_trilinos.cmake index 0c26dfa146..5efd540bf2 100644 --- a/cmake/configure/configure_20_trilinos.cmake +++ b/cmake/configure/configure_20_trilinos.cmake @@ -264,59 +264,41 @@ macro(feature_trilinos_find_external var) ) if(TRILINOS_TPETRA_IS_FUNCTIONAL) - check_cxx_symbol_exists(HAVE_TPETRA_INST_FLOAT "TpetraCore_config.h" DEAL_II_HAVE_TPETRA_INST_FLOAT) - check_cxx_symbol_exists(HAVE_TPETRA_INST_DOUBLE "TpetraCore_config.h" DEAL_II_HAVE_TPETRA_INST_DOUBLE) - check_cxx_symbol_exists(HAVE_TPETRA_INST_COMPLEX_FLOAT "TpetraCore_config.h" DEAL_II_HAVE_TPETRA_INST_COMPLEX_FLOAT) - check_cxx_symbol_exists(HAVE_TPETRA_INST_COMPLEX_DOUBLE "TpetraCore_config.h" DEAL_II_HAVE_TPETRA_INST_COMPLEX_DOUBLE) + # + # We need to figure out what instantiations are used in Tpetra so + # that we can populate our DEAL_II_EXPAND_TPETRA correctly. We need + # to dof this here prior to the call to reset_cmake_required(). + # + check_cxx_symbol_exists(HAVE_TPETRA_INST_DOUBLE "TpetraCore_config.h" _tpetra_inst_double) + check_cxx_symbol_exists(HAVE_TPETRA_INST_FLOAT "TpetraCore_config.h" _tpetra_inst_float) + check_cxx_symbol_exists(HAVE_TPETRA_INST_COMPLEX_DOUBLE "TpetraCore_config.h" _tpetra_inst_complex_double) + check_cxx_symbol_exists(HAVE_TPETRA_INST_COMPLEX_FLOAT "TpetraCore_config.h" _tpetra_inst_complex_float) else() - message( - STATUS - "Tpetra was found but is not usable! Disabling Tpetra support and searching for common errors." - ) + message(STATUS "Tpetra was found but is not usable due to a mismatch in ordinal number types.") set(TRILINOS_WITH_TPETRA OFF) - check_cxx_symbol_exists(HAVE_TPETRA_INT_INT "TpetraCore_config.h" DEAL_II_HAVE_TPETRA_INT_INT) - check_cxx_symbol_exists(HAVE_TPETRA_INT_LONG "TpetraCore_config.h" DEAL_II_HAVE_TPETRA_INT_LONG) - check_cxx_symbol_exists(HAVE_TPETRA_INT_LONG_LONG "TpetraCore_config.h" DEAL_II_HAVE_TPETRA_INT_LONG_LONG) - - if(NOT DEAL_II_HAVE_TPETRA_INT_LONG_LONG AND DEAL_II_WITH_64BIT_INDICES) - message( - STATUS - " Tpetra wasn't configured with support for 64-bit global indices\n" - " but deal.II is configured to use 64-bit global indices.\n" - " Either reconfigure deal.II with -DDEAL_II_WITH_64BIT_INDICES=OFF\n" - " or rebuild Trilinos with -DTpetra_INST_INT_LONG_LONG=ON" - ) - if(DEAL_II_HAVE_TPETRA_INT_LONG) - message( - STATUS - " and -DTpetra_INST_INT_LONG=OFF." + check_cxx_symbol_exists(HAVE_TPETRA_INT_INT "TpetraCore_config.h"_tpetra_int_int) + check_cxx_symbol_exists(HAVE_TPETRA_INT_LONG_LONG "TpetraCore_config.h" _tpetra_int_long_long) + + if(NOT _tpetra_int_long_long AND DEAL_II_WITH_64BIT_INDICES) + message( STATUS + " Tpetra was configured *without* support for 64-bit global indices" + "but deal.II is configured to use 64-bit global indices." ) - elseif(DEAL_II_HAVE_TPETRA_INT_INT) - message( - STATUS - " and -DTpetra_INST_INT_INT=OFF." + message(STATUS + " Either reconfigure deal.II with -DDEAL_II_WITH_64BIT_INDICES=OFF" + " or rebuild Trilinos with -DTpetra_INST_INT_LONG_LONG=ON" ) - endif() - elseif(NOT DEAL_II_HAVE_TPETRA_INT_INT AND NOT DEAL_II_WITH_64BIT_INDICES) - message( - STATUS - " Tpetra wasn't configured with support for 32-bit global indices\n" - " but deal.II is configured to use 32-bit global indices.\n" - " Either reconfigure deal.II with -DDEAL_II_WITH_64BIT_INDICES=ON\n" - " or rebuild Trilinos with -DTpetra_INST_INT_INT=ON" - ) - if(DEAL_II_HAVE_TPETRA_INT_LONG) - message( - STATUS - " and -DTpetra_INST_INT_LONG=OFF." + + elseif(NOT _tpetra_int_int AND NOT DEAL_II_WITH_64BIT_INDICES) + message( STATUS + " Tpetra was configured *without* support for 32-bit global indices" + "but deal.II is configured to use 32-bit global indices." ) - elseif(DEAL_II_HAVE_TPETRA_INT_LONG_LONG) - message( - STATUS - " and -DTpetra_INST_INT_LONG_LONG=OFF." + message(STATUS + " Either reconfigure deal.II with -DDEAL_II_WITH_64BIT_INDICES=ON" + " or rebuild Trilinos with -DTpetra_INST_INT_INT=ON" ) - endif() endif() reset_cmake_required() @@ -462,18 +444,21 @@ macro(feature_trilinos_configure_external) set(DEAL_II_EXPAND_EPETRA_VECTOR "LinearAlgebra::EpetraWrappers::Vector") if(${DEAL_II_TRILINOS_WITH_TPETRA}) - if(DEAL_II_HAVE_TPETRA_INST_DOUBLE) + if(_tpetra_inst_double) set(DEAL_II_EXPAND_TPETRA_TYPES "double") set(DEAL_II_EXPAND_TPETRA_VECTOR_DOUBLE "LinearAlgebra::TpetraWrappers::Vector") endif() - if(DEAL_II_HAVE_TPETRA_INST_FLOAT) + + if(_tpetra_inst_float) set(DEAL_II_EXPAND_TPETRA_VECTOR_FLOAT "LinearAlgebra::TpetraWrappers::Vector") endif() + if(${DEAL_II_WITH_COMPLEX_NUMBERS}) - if(DEAL_II_HAVE_TPETRA_INST_COMPLEX_DOUBLE) + if(_tpetra_inst_complex_double) set(DEAL_II_EXPAND_TPETRA_VECTOR_COMPLEX_DOUBLE "LinearAlgebra::TpetraWrappers::Vector>") endif() - if(DEAL_II_HAVE_TPETRA_INST_COMPLEX_FLOAT) + + if(_tpetra_inst_complex_float) set(DEAL_II_EXPAND_TPETRA_VECTOR_COMPLEX_FLOAT "LinearAlgebra::TpetraWrappers::Vector>") endif() endif() @@ -485,13 +470,13 @@ macro(feature_trilinos_configure_external) "Sacado::Fad::DFad" "Sacado::Fad::DFad>" "Sacado::Fad::DFad>" - ) + ) set(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD "Sacado::Rad::ADvar" "Sacado::Rad::ADvar" "Sacado::Rad::ADvar>" "Sacado::Rad::ADvar>" - ) + ) if(TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD) set(DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD ${TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD}) endif()