We are seeing new build failures on MacOS while trying to package LLVM 21.1.0 for Spack compared to 20.1.8.
kmp_alloc.cpp:1549:46: error: unknown type name 'hwloc_membind_policy_t'
1549 | static bool __kmp_is_hwloc_membind_supported(hwloc_membind_policy_t policy) {
My initial diagnosis is that recent code changes in openmp/runtime introduced this bug due to the following:
- The
hwloc.h is only included on systems with KMP_AFFINITY_SUPPORTED, which is not the case for Darwin.
kmp_alloc.cpp has now has code parts that use the hwloc API but only guards them with KMP_USE_HWLOC instead of KMP_USE_HWLOC && KMP_AFFINITY_SUPPORTED.