diff --git a/openmp/runtime/cmake/config-ix.cmake b/openmp/runtime/cmake/config-ix.cmake --- a/openmp/runtime/cmake/config-ix.cmake +++ b/openmp/runtime/cmake/config-ix.cmake @@ -349,6 +349,9 @@ if(LIBOMP_HWLOC_LIBRARY) check_library_exists(${LIBOMP_HWLOC_LIBRARY} hwloc_topology_init ${LIBOMP_HWLOC_INSTALL_DIR}/lib LIBOMP_HAVE_LIBHWLOC) + include(CheckStructHasMember) + # 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) endif() if(LIBOMP_HAVE_HWLOC_H AND LIBOMP_HAVE_LIBHWLOC AND LIBOMP_HWLOC_LIBRARY)