]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve error message when trying to configure with ArborX 2.0 18411/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 2 May 2025 18:41:16 +0000 (14:41 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 2 May 2025 18:45:30 +0000 (14:45 -0400)
cmake/configure/configure_50_arborx.cmake
cmake/modules/FindDEAL_II_ARBORX.cmake

index ea6eb3fcfefc72aea5724a91416a126adccc6c35..b838da6b781104da74f583874fea911d122c4fd3 100644 (file)
@@ -50,27 +50,29 @@ macro(feature_arborx_find_external var)
       ArborX::ArborX
     )
 
-    check_cxx_compiler_bug(
-      "
-      #include <ArborX.hpp>
-      int main() {
-        Kokkos::View<ArborX::Point*, Kokkos::HostSpace> points(\"points\", 0);
-        [[maybe_unused]] ArborX::BVH<Kokkos::HostSpace> bvh(Kokkos::DefaultHostExecutionSpace{}, points);
-      }
-      "
-      DEAL_II_ARBORX_CXX20_BUG)
-    reset_cmake_required()
+    if(ArborX_VERSION VERSION_LESS 2.0.0)
+      check_cxx_compiler_bug(
+        "
+        #include <ArborX.hpp>
+        int main() {
+          Kokkos::View<ArborX::Point*, Kokkos::HostSpace> points(\"points\", 0);
+          [[maybe_unused]] ArborX::BVH<Kokkos::HostSpace> bvh(Kokkos::DefaultHostExecutionSpace{}, points);
+        }
+        "
+        DEAL_II_ARBORX_CXX20_BUG)
+      reset_cmake_required()
 
-    if(DEAL_II_ARBORX_CXX20_BUG)
-      message(STATUS "Could not find a sufficient ArborX installation: "
-        "The ArborX version doesn't work with C++20 or higher."
-        )
-      set(ARBORX_ADDITIONAL_ERROR_STRING
-        ${ARBORX_ADDITIONAL_ERROR_STRING}
-        "Could not find a sufficient ArborX installation:\n"
-        "The ArborX version doesn't work with C++20 or higher. Try using a later ArborX release or try specifying a lower C++ standard.\n"
-        )
-      set(${var} FALSE)
+      if(DEAL_II_ARBORX_CXX20_BUG)
+        message(STATUS "Could not find a sufficient ArborX installation: "
+          "The ArborX version doesn't work with C++20 or higher."
+          )
+        set(ARBORX_ADDITIONAL_ERROR_STRING
+          ${ARBORX_ADDITIONAL_ERROR_STRING}
+          "Could not find a sufficient ArborX installation:\n"
+          "The ArborX version doesn't work with C++20 or higher. Try using a later ArborX release or try specifying a lower C++ standard.\n"
+          )
+        set(${var} FALSE)
+      endif()
     endif()
   endif()
 
index c87a574afbb81b86a2a226214de26a0820ae2e16..bd8c877a964fba2cfd4a2826fbd672e839106d6c 100644 (file)
@@ -27,13 +27,25 @@ set_if_empty(ARBORX_DIR "$ENV{ARBORX_DIR}")
 
 # silence a warning when including FindKOKKOS.cmake
 set(CMAKE_CXX_EXTENSIONS OFF)
-find_package(ArborX 1.3 QUIET
+find_package(ArborX QUIET
   HINTS ${ARBORX_DIR} ${ArborX_DIR} $ENV{ArborX_DIR}
   )
 
 if(ArborX_FOUND)
   get_property(ARBORX_INSTALL_INCLUDE_DIR TARGET ArborX::ArborX PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
 
+  #
+  # ArborX's compatibility mode is set to SameMajorVersion. Therefore if we want to
+  # support both the 1.X and the 2.X, we cannot set a minimum version in
+  # find_package. Instead we need to check the minimum version ourselves.
+  #
+  if(ArborX_VERSION VERSION_LESS 1.3)
+    message(FATAL_ERROR "Found ArborX version ${ArborX_VERSION} but the minimum version supported is 1.3")
+  elseif(ArborX_VERSION VERSION_GREATER_EQUAL 2.0)
+    message(FATAL_ERROR "Found ArborX version ${ArborX_VERSION}. The 2.X series is not currently supported")
+  endif()
+
+
   #
   # Check whether ArborX was compiled with MPI support
   #

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.