Issue 156679
Summary [OpenMP] [runtime] Broken MacOS build in 21.1.0+ if hwloc is turned on
Labels new issue
Assignees
Reporter rbberger
    We are seeing new build failures on MacOS while trying to [package LLVM 21.1.0 for Spack](https://github.com/spack/spack-packages/pull/1212#issuecomment-3248022549) compare 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`](https://github.com/llvm/llvm-project/blob/3623fe661ae35c6c80ac221f14d85be76aa870f1/openmp/runtime/src/kmp.h#L107-L108), which is not the case for [Darwin](https://github.com/llvm/llvm-project/blob/3623fe661ae35c6c80ac221f14d85be76aa870f1/openmp/runtime/src/kmp_os.h#L78-L90).
- `kmp_alloc.cpp` has now has code parts that use the hwloc API but only guards them with [`KMP_USE_HWLOC`](https://github.com/llvm/llvm-project/blob/llvmorg-21.1.0/openmp/runtime/src/kmp_alloc.cpp#L1548-L1549) instead of `KMP_USE_HWLOC && KMP_AFFINITY_SUPPORTED`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to