std::atomic_ref is missing from the libc++ of the macOS wheel toolchain
PitfallVerified 7 Oct 2026Holds project: dftracer-utils
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
The macOS wheel build fails to compile code that uses std::atomic_ref.
Cause#
The libc++ used by the macOS wheel toolchain does not provide std::atomic_ref.
Fix#
Use the compiler builtins (__atomic_*) for atomic bit operations on plain memory.
Evidence#
From an observed note of 2026-10-07: "std::atomic_ref is missing from the libc++ used by the macOS wheel toolchain, so the wheel build fails to compile. Use the compiler builtins (__atomic_*) for atomic bit operations on plain memory."
Also found by searching
- std::atomic_ref not found in the macOS wheel build
- libc++ has no atomic_ref
- how do I do atomic bit operations on plain memory without atomic_ref