-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
abseil doesn't build with clang on windows due to missing AVX types #1759
Comments
We do test this configuration and do not see this issue, so there must be some difference that isn't getting captured here. Please provide concrete reproduction steps using a supported build system. |
I'll look into getting a repro, which will be challenging since I don't have direct access to the Windows builders. Can you help me understand why you believe the current |
I think I understand what is going on here. 18018aa tries to force that function to compile with AVX (see the |
Okay, reproduction steps:
The Either way, this reproduces with a supported build-system, and a fairly reasonable -march CPU variant. |
If I put
So apparently clang++.exe supports gnu::target, but there's still no __m256i defined in that case. Looking at clang 15's immintrin.h, it has
I checked to see if clang++.exe is defining _MSC_VER by adding
and I do get this error. So avxintrin.h (which is what has the __m256i typedefs) never gets included without |
Looking at immintrin.h from gcc 12 as well as LLVM 15, it looks like gcc unconditionally includes avxintrin.h and makes the typedefs available. LLVM makes avxintrin.h available if So I think it's likely sufficient to change from
to
(I don't know if we need an explicit gcc check with |
Thanks. I managed to reproduce. I'll try to submit a fix in the next few days. |
Thanks for the fix, @derekmauro! However, I think
should be simplified to something similar to what I suggested above. Probably
given how you defined |
Describe the issue
On clang on Windows, absl/crc/internal/non_temporal_memcpy.h fails to build with errors
It looks like clang picked up some headers from MSVC (although we are not running clang-cl.exe, but clang++.exe)
https://github.com/abseil/abseil-cpp/blob/master/absl/crc/internal/non_temporal_memcpy.h#L124-L127 does and have __m256i defined.
If I add a
!defined(_MSC_VER_)
to the__SSE3__
clause, everything builds fine.Steps to reproduce the problem
Attempt to build absl with clang 15 on Windows. (I suspect it affects newer clang as well, but I haven't checked.) Per my read of https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md clang-cl 15 should still be supported.
The invocation does not have any special clang-cl command line, i.e., no equivalent of -mavx or -march=native or similar -- just the usual -c, -o, -MD, -MF args.
What version of Abseil are you using?
20240722.0 (4447c75)
What operating system and version are you using?
CentOS Stream release 9 (although buck2 is running some parts of the build on Windows)
What compiler and version are you using?
llvm 15.0.5 (windows-x86_64 clang++.exe)
What build system are you using?
buck2
Additional context
No response
The text was updated successfully, but these errors were encountered: