]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Detect if ArborX was compiled with MPI support
authorBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 15 Feb 2022 19:03:48 +0000 (19:03 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 18 Feb 2022 16:33:22 +0000 (16:33 +0000)
cmake/modules/FindARBORX.cmake
include/deal.II/base/config.h.in

index e4b9b002803d4e0e1c7dac454b43a2c81cc0d9ea..e6b295f6e0fbca02e4945018c70664bd02140dc0 100644 (file)
@@ -32,6 +32,36 @@ FIND_PACKAGE(ArborX
 
 IF(ArborX_FOUND)
   GET_PROPERTY(ARBORX_INSTALL_INCLUDE_DIR TARGET ArborX::ArborX PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+
+  #
+  # Check whether ArborX was compiled with MPI support
+  #
+  MESSAGE(STATUS
+    "Checking whether the found ArborX has MPI support:"
+    )
+
+  #
+  # Look for ArborX_Config.hpp - we'll query it to determine MPI support:
+  #
+  DEAL_II_FIND_FILE(ARBORX_CONFIG_HPP ArborX_Config.hpp
+    HINTS ${ARBORX_INSTALL_INCLUDE_DIR}
+    NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH
+    NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH
+    )
+
+  IF(EXISTS ${ARBORX_CONFIG_HPP})
+    #
+    # Determine whether ArborX was configured with MPI:
+    #
+    FILE(STRINGS "${ARBORX_CONFIG_HPP}" ARBORX_MPI_STRING
+      REGEX "#define ARBORX_ENABLE_MPI")
+    IF("${ARBORX_MPI_STRING}" STREQUAL "")
+      MESSAGE(STATUS "ArborX has no MPI support")
+    ELSE()
+      SET(DEAL_II_ARBORX_WITH_MPI TRUE)
+      MESSAGE(STATUS "ArborX has MPI support")
+    ENDIF()
+  ENDIF()
 ENDIF()
 
 DEAL_II_PACKAGE_HANDLE(ARBORX
index 89e2dc3552a908b32800f07e1f0e973e8328e3c8..11ac41cfb569cdadf2461061fdc6632058d75d6c 100644 (file)
 #cmakedefine DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING
 #cmakedefine DEAL_II_ADOLC_WITH_TAPELESS_REFCOUNTING
 
+/* cmake/modules/FindARBORX.cmake */
+#cmakedefine DEAL_II_ARBORX_WITH_MPI
+
 /* cmake/modules/FindARPACK.cmake */
 #cmakedefine DEAL_II_ARPACK_WITH_PARPACK
 

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.