Build of ROOT from source dies while configuring built-in LLVM.
The error message is:
CMake Error at interpreter/llvm/src/cmake/modules/CheckAtomic.cmake:49 (message):
Host compiler must support std::atomic!
I’ve seen another post on this forum
with the same error, but I’ve checked that the compiler can use std::atomic. I extracted the test program used in CMake, compiled and ran it without error.
I added some debug messages to the CMake file to print the INCLUDE_DIRECTORIES cmake variable. It is empty. I believe it ought to have system include directories.
A similar build on Debian 11 Bullseye using GCC 11.2.0 also fails with the same error.
Please find attached the cmake output, and the log files mentioned at the end of the output.
I have just looked at the log files for the first time. CMakeError.log shows what looks like badly formed options passed to the compiler when compiling the atomics test code as part of the CMake setup for LLVM.
At the moment I’m not sure what I did to cause it or what I could do to fix it. There’s no obvious line in the source to change.
Hi,
I’m afraid there is something broken in your environment (not sure what, maybe @oshadura or @Axel have an idea).
I just tried the following in a fresh Debian 10.7 Docker container and the cmake configuration did not complain about std::atomic support (I tried to use the same cmake configuration options that you use):
I should have mentioned before that I was using pbuilder via cowbuilder to build a package.
pbuilder automatically adds some C++ flags that are the source of the problem.
this line added to the top of debian/rules solves the problem:
export DEB_BUILD_MAINT_OPTIONS=hardening=-format
These options perform some security checks on format strings. It seems that the options themselves weren’t the problem, but the option string is mangled when trying to build the atomics test.