# Configuration for ArborX support in deal.II:
#
+set(FEATURE_ARBORX_AFTER MPI)
set(FEATURE_ARBORX_DEPENDS KOKKOS)
+macro(FEATURE_ARBORX_FIND_EXTERNAL var)
+ find_package(ARBORX)
+
+ if(ARBORX_FOUND)
+ #
+ # So, we have a library. Let's see whether we can use it:
+ #
+ set(${var} TRUE)
+
+ #
+ # ArborX has to be configured with the same MPI configuration as
+ # deal.II.
+ #
+ if((NOT ARBORX_WITH_MPI AND DEAL_II_WITH_MPI) OR (ARBORX_WITH_MPI AND NOT DEAL_II_WITH_MPI))
+ message(STATUS "Could not find a sufficient ArborX installation: "
+ "ArborX has to be configured with the same MPI configuration as deal.II."
+ )
+ set(ARBORX_ADDITIONAL_ERROR_STRING
+ ${ARBORX_ADDITIONAL_ERROR_STRING}
+ "Could not find a sufficient ArborX installation:\n"
+ "ArborX has to be configured with the same MPI configuration as deal.II, but found:\n"
+ " DEAL_II_WITH_MPI = ${DEAL_II_WITH_MPI}\n"
+ " ARBORX_WITH_MPI = ${ARBORX_WITH_MPI}\n"
+ )
+ set(${var} FALSE)
+ endif()
+ endif()
+
+ set(DEAL_II_ARBORX_WITH_MPI ${ARBORX_WITH_MPI})
+endmacro()
+
configure_feature(ARBORX)
+
#
# ARBORX_INCLUDE_DIRS
# ARBORX_INTERFACE_LINK_FLAGS
+# ARBORX_WITH_MPI
#
set(ARBORX_DIR "" CACHE PATH "An optional hint to an ArborX installation")
file(STRINGS "${ARBORX_CONFIG_HPP}" ARBORX_MPI_STRING
REGEX "#define ARBORX_ENABLE_MPI")
if("${ARBORX_MPI_STRING}" STREQUAL "")
+ set(ARBORX_WITH_MPI FALSE)
message(STATUS "ArborX has no MPI support")
else()
- set(DEAL_II_ARBORX_WITH_MPI TRUE)
+ set(ARBORX_WITH_MPI TRUE)
message(STATUS "ArborX has MPI support")
endif()
endif()