-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: Detect whether or not atomic is needed #1008
Conversation
2a2a381
to
4fe828d
Compare
@jan-wassenberg I cannot get my hand on a clang-5 compiler. Any way you could add something like:
somewhere in your CI setup (in case of error) |
026815e
to
47f632b
Compare
@jan-wassenberg Two things:
I agree that on libjxl I used |
47f632b
to
29c2674
Compare
lol, someone is adding -std=c++98 in my back:
@eustas any comment ? |
Good old CMake, it often makes a mess, sigh. Very difficult to debug without access to the logs, that's a great trick with reading+printing it, nice! It seems to me that CMAKE_CXX_STANDARD would be the correct way to avoid the problem, but it's only supported in 3.1. There's also target_compile_features but that seems to only be for targets (not sure it would work with try_compile), and it's also 3.1 only. I wonder if the CMake running is older than 3.1? The logs don't seem to mention CMake version. |
2b95d74
to
ac53970
Compare
hm, so a CMake misbehavior indeed. Nice that you've raised it with them, let's see if there's a workaround. |
e749189
to
aebc3a2
Compare
@jan-wassenberg Seems like this one is not my fault:
|
Oh, indeed :) Fixing, thanks for pointing that out. (Our internal CI is still somehow suppressing unused arg warnings.) I appreciate your heroic efforts to get this working, looks like we're almost there? |
PiperOrigin-RevId: 480279310
PiperOrigin-RevId: 480279310
lol :) Please do not merge, I find my current patch sort of hackish. I'd like to get to the bottom issue of this |
PiperOrigin-RevId: 480279310
PiperOrigin-RevId: 480317755
:) The fix is in. |
aebc3a2
to
134a07e
Compare
134a07e
to
dc71f72
Compare
Congrats, seems you have found a decent workaround for the CMake issue. Are you happy with the current code, should we merge it? |
I believe this is a good improvement. As mentionned in the comment, I still need to dig in cmake to understand the difference in behavior between 3.16 vs 3.24, but I suspect this should not hold this PR. So please merge, thanks ! |
34df558
to
dda39e8
Compare
It turns out that GCC requires explicitly linking to a library `atomic` in order to support c11/atomics. gcc spec file will not handle it directly at least not on the following Debian archs: armel, m68k, mipsel, powerpc, sh4, sparc64 and riscv64. Introduce a new cmake module to detect usage of gcc/atomic and add missing library to the link step. For reference: * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104248 Fixes google#1003
dda39e8
to
6f23aa8
Compare
@jan-wassenberg I have no clue why clang5/6 are marked as |
huh, strange, I thought I had seen them pass. Rerunning now.. |
"GitHub Actions has encountered an internal error when running your job." |
It turns out that GCC requires explicitly linking to a library
atomic
in order to support c11/atomics. gcc spec file will not handle it directly at least not on the following Debian archs: armel, m68k, mipsel, powerpc, sh4, sparc64 and riscv64.Introduce a new cmake module to detect usage of gcc/atomic and add missing library to the link step.
For reference:
Fixes #1003