From 81b346eccc845d8a7b4d7d23ed5cf271ba828570 Mon Sep 17 00:00:00 2001
From: Olivier Coulaud <olivier.coulaud@inria.fr>
Date: Tue, 11 Feb 2025 16:05:02 +0100
Subject: [PATCH] scalfmm's omp options were enabled even though openmp is not
 available [fixed]

---
 include/scalfmm/algorithms/fmm.hpp  | 19 +++++++++++++------
 include/scalfmm/lists/lists.hpp     |  3 ++-
 include/scalfmm/options/options.hpp |  6 ++++--
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/include/scalfmm/algorithms/fmm.hpp b/include/scalfmm/algorithms/fmm.hpp
index 9f6395aa..16ac2d2b 100644
--- a/include/scalfmm/algorithms/fmm.hpp
+++ b/include/scalfmm/algorithms/fmm.hpp
@@ -74,9 +74,13 @@ namespace scalfmm::algorithms
         inline auto fmm(options::settings<S...> s, TreeType& tree, FmmOperatorsType const& fmmoperators,
                         unsigned int op = operators_to_proceed::all) -> void
         {
-            static_assert(
-              options::support(s, options::_s(options::omp, options::omp_timit, options::seq, options::seq_timit)),
-              "unsupported fmm algo options!");
+            static_assert(options::support(s, options::_s(
+#ifdef _OPENMP
+
+                                                options::omp, options::omp_timit,
+#endif
+                                                options::seq, options::seq_timit)),
+                          "unsupported fmm algo options!");
             if constexpr(options::has(s, options::seq, options::seq_timit))
             {
                 using inner_settings = typename decltype(s)::inner_settings;
@@ -117,9 +121,12 @@ namespace scalfmm::algorithms
                         operators::fmm_operators<NearFieldType, FarFieldType> const& fmmoperators,
                         unsigned int op = operators_to_proceed::all) -> void
         {
-            static_assert(
-              options::support(s, options::_s(options::omp, options::omp_timit, options::seq, options::seq_timit)),
-              "unsupported fmm algo options!");
+            static_assert(options::support(s, options::_s(
+#ifdef _OPENMP
+                                                options::omp, options::omp_timit,
+#endif
+                                                options::seq, options::seq_timit)),
+                          "unsupported fmm algo options!");
             if constexpr(options::has(s, options::seq, options::seq_timit))
             {
                 using inner_settings = typename decltype(s)::inner_settings;
diff --git a/include/scalfmm/lists/lists.hpp b/include/scalfmm/lists/lists.hpp
index efa04999..34a4c858 100644
--- a/include/scalfmm/lists/lists.hpp
+++ b/include/scalfmm/lists/lists.hpp
@@ -3,7 +3,8 @@
 // File : scalfmm/lists/lists.hpp
 // --------------------------------
 #pragma once
-
+#ifdef _OPENMP
 #include "scalfmm/lists/omp.hpp"
+#endif
 #include "scalfmm/lists/policies.hpp"
 #include "scalfmm/lists/sequential.hpp"
diff --git a/include/scalfmm/options/options.hpp b/include/scalfmm/options/options.hpp
index 96747683..60000da3 100644
--- a/include/scalfmm/options/options.hpp
+++ b/include/scalfmm/options/options.hpp
@@ -114,6 +114,7 @@ namespace scalfmm::options
         using inner_settings = settings<S...>;
         static constexpr auto value() noexcept -> std::string_view { return "seq"; };
     };
+#ifdef _OPENMP
 
     /**
      * @brief A specific compound option for the 'OpenMP-based' case that combines multiple settings.
@@ -131,7 +132,7 @@ namespace scalfmm::options
         using inner_settings = settings<S...>;
         static constexpr auto value() noexcept -> std::string_view { return "omp"; };
     };
-
+#endif
     /**
      * @brief A specific option to time each pass of the FMM algorithm.
      */
@@ -244,6 +245,7 @@ namespace scalfmm::options
     * @brief Predefined static option to compress the M2L interaction matrices.
     */
     static constexpr auto low_rank = low_rank_{};
+#ifdef _OPENMP
 
     /**
     * @brief Predefined static option to use the OpenMP-based algorithm.
@@ -254,7 +256,7 @@ namespace scalfmm::options
     * @brief Predefined static option to use the OpenMP-based algorithm with each pass is timed.
     */
     static constexpr auto omp_timit = omp_<timit_>{};
-
+#endif
     /**
     * @brief Predefined static option to use the sequential algorithm.
     */
-- 
GitLab