]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: clean up TPetra warnings: 17362/head
authorMatthias Maier <tamiko@43-1.org>
Tue, 23 Jul 2024 15:14:59 +0000 (10:14 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 23 Jul 2024 15:43:19 +0000 (10:43 -0500)
 - use our CMake indent style
 - avoid declaring unused DEAL_II* variables
 - make Tpetra status message shorter

cmake/configure/configure_20_trilinos.cmake

index 0c26dfa1469867985c09ce9c1947a5c7e8a5018c..5efd540bf2a68ed81d4ef968654c5df69d7c3186 100644 (file)
@@ -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<double>")
     endif()
-    if(DEAL_II_HAVE_TPETRA_INST_FLOAT)
+
+    if(_tpetra_inst_float)
       set(DEAL_II_EXPAND_TPETRA_VECTOR_FLOAT "LinearAlgebra::TpetraWrappers::Vector<float>")
     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<std::complex<double>>")
       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<std::complex<float>>")
       endif()
     endif()
@@ -485,13 +470,13 @@ macro(feature_trilinos_configure_external)
       "Sacado::Fad::DFad<float>"
       "Sacado::Fad::DFad<Sacado::Fad::DFad<double>>"
       "Sacado::Fad::DFad<Sacado::Fad::DFad<float>>"
-    )
+      )
     set(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD
       "Sacado::Rad::ADvar<double>"
       "Sacado::Rad::ADvar<float>"
       "Sacado::Rad::ADvar<Sacado::Fad::DFad<double>>"
       "Sacado::Rad::ADvar<Sacado::Fad::DFad<float>>"
-    )
+      )
     if(TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD)
       set(DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD ${TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD})
     endif()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.