[Openmp-commits] [PATCH] D142036: [OpenMP] Add HWLOC compatibility check

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 18 12:17:00 PST 2023


jlpeyton added inline comments.


================
Comment at: openmp/runtime/cmake/config-ix.cmake:345
   check_include_file(hwloc.h LIBOMP_HAVE_HWLOC_H)
   set(CMAKE_REQUIRED_INCLUDES)
   find_library(LIBOMP_HWLOC_LIBRARY
----------------
Move this below the check_struct_has_member call so the same hwloc.h header is used as the one in the check_include_file() call. 


================
Comment at: openmp/runtime/cmake/config-ix.cmake:354
+    # Check if struct hwloc_group_attr_s has kind as it is a new feature in HWLOC 2 and we need that.
+    check_struct_has_member("struct hwloc_group_attr_s" "kind" hwloc.h LIBOMP_HAVE_LIBHWLOC)
     get_filename_component(LIBOMP_HWLOC_LIBRARY_DIR ${LIBOMP_HWLOC_LIBRARY} PATH)
----------------
I think the name has to be different than LIBOMP_HAVE_LIBHWLOC or CMake will skip the check thinking it has already done it. Something like LIBOMP_HAVE_ATLEAST_LIBHWLOC2. Then just add the LIBOMP_HAVE_ATLEAST_LIBHWLOC2 to line 357 which checks all the necessary HWLOC requirements to determine if HWLOC is really available.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142036/new/

https://reviews.llvm.org/D142036



More information about the Openmp-commits mailing list