How to resolve 'Host compiler must support std::atomic` when trying to bootstrap zig?

For context, I have recently changed my laptop, and just finished installing everything I need, since this laptop now allows me to build zig from source, I would really like to give it a shot. The problem is that when I run the following command ❯ ./build native-linux-gnu -mcpu=native the configuration starts, but then stop because of the following error

CMake Error at cmake/modules/CheckAtomic.cmake:56 (message):
  Host compiler must support std::atomic!
Call Stack (most recent call first):
  cmake/config-ix.cmake:413 (include)
  CMakeLists.txt:949 (include)
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Not sure what is the problem here, if anyone encountered that issue I’d love to hear how to fix that problem.

I’ve found the solution, my system llvm/clang version weren’t the ones needed for the compilation.

1 Like