From 62a28b54477fd6729e9f579798bec6675a1e08b3 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Tue, 15 Nov 2022 19:38:28 +0000 Subject: [PATCH] Guard Belos code with macros --- cmake/configure/configure_20_trilinos.cmake | 2 +- include/deal.II/base/config.h.in | 1 + include/deal.II/lac/trilinos_solver.h | 6 ++++++ tests/belos/CMakeLists.txt | 7 +++++++ tests/{trilinos => belos}/solver_belos_01.cc | 0 .../solver_belos_01.output} | 0 6 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/belos/CMakeLists.txt rename tests/{trilinos => belos}/solver_belos_01.cc (100%) rename tests/{trilinos/solver_belos_01.with_trilinos=true.output => belos/solver_belos_01.output} (100%) diff --git a/cmake/configure/configure_20_trilinos.cmake b/cmake/configure/configure_20_trilinos.cmake index 7363847146..6adaf536cb 100644 --- a/cmake/configure/configure_20_trilinos.cmake +++ b/cmake/configure/configure_20_trilinos.cmake @@ -150,7 +150,7 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) # # Check for modules. # - FOREACH(_optional_module EpetraExt Kokkos MueLu ROL Sacado SEACAS Tpetra Zoltan) + FOREACH(_optional_module Belos EpetraExt Kokkos MueLu ROL Sacado SEACAS Tpetra Zoltan) ITEM_MATCHES(_module_found ${_optional_module} ${Trilinos_PACKAGE_LIST}) IF(_module_found) MESSAGE(STATUS " Found ${_optional_module}") diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index a201f301de..888dffcd7d 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -239,6 +239,7 @@ /* cmake/configure/configure_2_trilinos.cmake */ #cmakedefine DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD +#cmakedefine DEAL_II_TRILINOS_WITH_BELOS #cmakedefine DEAL_II_TRILINOS_WITH_EPETRAEXT #cmakedefine DEAL_II_TRILINOS_WITH_MUELU #cmakedefine DEAL_II_TRILINOS_WITH_ROL diff --git a/include/deal.II/lac/trilinos_solver.h b/include/deal.II/lac/trilinos_solver.h index 9531551644..ea309e8a04 100644 --- a/include/deal.II/lac/trilinos_solver.h +++ b/include/deal.II/lac/trilinos_solver.h @@ -33,6 +33,7 @@ # include // for Belos solvers +#ifdef DEAL_II_TRILINOS_WITH_BELOS # include # include # include @@ -40,6 +41,7 @@ # include # include # include +#endif # include @@ -730,6 +732,7 @@ namespace TrilinosWrappers +#ifdef DEAL_II_TRILINOS_WITH_BELOS /** * Wrapper around the iterate solver package from the Belos * packge @@ -805,6 +808,7 @@ namespace TrilinosWrappers const AdditionalData additional_data; const Teuchos::RCP &belos_parameters; }; +#endif } // namespace TrilinosWrappers @@ -812,6 +816,7 @@ namespace TrilinosWrappers # ifndef DOXYGEN +#ifdef DEAL_II_TRILINOS_WITH_BELOS namespace TrilinosWrappers { namespace internal @@ -1429,6 +1434,7 @@ namespace TrilinosWrappers } } // namespace TrilinosWrappers +#endif # endif diff --git a/tests/belos/CMakeLists.txt b/tests/belos/CMakeLists.txt new file mode 100644 index 0000000000..9f5a104c42 --- /dev/null +++ b/tests/belos/CMakeLists.txt @@ -0,0 +1,7 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +INCLUDE(../setup_testsubproject.cmake) +PROJECT(testsuite CXX) + +IF(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_BELOS) + DEAL_II_PICKUP_TESTS() +ENDIF() diff --git a/tests/trilinos/solver_belos_01.cc b/tests/belos/solver_belos_01.cc similarity index 100% rename from tests/trilinos/solver_belos_01.cc rename to tests/belos/solver_belos_01.cc diff --git a/tests/trilinos/solver_belos_01.with_trilinos=true.output b/tests/belos/solver_belos_01.output similarity index 100% rename from tests/trilinos/solver_belos_01.with_trilinos=true.output rename to tests/belos/solver_belos_01.output -- 2.39.5