Skip to content
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

MSVC compilation failure w/ 64-bit intrinsics in x86 configurations #1744

Open
kennyweiss opened this issue Sep 27, 2024 · 1 comment · May be fixed by #1746
Open

MSVC compilation failure w/ 64-bit intrinsics in x86 configurations #1744

kennyweiss opened this issue Sep 27, 2024 · 1 comment · May be fixed by #1746
Assignees

Comments

@kennyweiss
Copy link
Member

After axom updated its raja dependency on Windows from raja@2024.02.0 to raja@2024.07.0, our 32-bit x86 CI started to fail
with error messages of the form:

...\x86-windows\include\RAJA\policy\atomic_builtin.hpp(160,10): error C3861: '_InterlockedExchange64': identifier not found
...\x86-windows\include\RAJA\policy\atomic_builtin.hpp(267,10): error C3861: '_InterlockedAnd64': identifier not found [D:
...\x86-windows\include\RAJA\policy\atomic_builtin.hpp(243,10): error C3861: '_InterlockedExchangeAdd64': identifier not found 
more of the error logs here ``` 2024-09-26T21:27:11.0448600Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(125,10): error C3861: '_InterlockedOr64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:11.0451521Z (compiling source file '../../../src/axom/slam/BitSet.cpp')2024-09-26T21:27:11.0452314Z 2024-09-26T21:27:11.0454720Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(160,10): error C3861: '_InterlockedExchange64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:11.0457243Z (compiling source file '../../../src/axom/slam/BitSet.cpp')2024-09-26T21:27:11.0457944Z 2024-09-26T21:27:11.0459997Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(219,10): error C3861: '_InterlockedExchangeAdd64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:11.0462257Z (compiling source file '../../../src/axom/slam/BitSet.cpp')2024-09-26T21:27:11.0462939Z 2024-09-26T21:27:11.0464894Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(243,10): error C3861: '_InterlockedExchangeAdd64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:11.0467117Z (compiling source file '../../../src/axom/slam/BitSet.cpp')2024-09-26T21:27:11.0467787Z 2024-09-26T21:27:11.0469977Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(267,10): error C3861: '_InterlockedAnd64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:11.0472208Z (compiling source file '../../../src/axom/slam/BitSet.cpp')2024-09-26T21:27:11.0472889Z 2024-09-26T21:27:11.0474798Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(291,10): error C3861: '_InterlockedXor64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:11.0476963Z (compiling source file '../../../src/axom/slam/BitSet.cpp')2024-09-26T21:27:11.0477638Z 2024-09-26T21:27:11.1754715Z OrderedSet.cpp2024-09-26T21:27:12.2705093Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(125,10): error C3861: '_InterlockedOr64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:12.2707813Z (compiling source file '../../../src/axom/slam/OrderedSet.cpp')2024-09-26T21:27:12.2708546Z 2024-09-26T21:27:12.2710565Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(160,10): error C3861: '_InterlockedExchange64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:12.2712817Z (compiling source file '../../../src/axom/slam/OrderedSet.cpp')2024-09-26T21:27:12.2713535Z 2024-09-26T21:27:12.2715520Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(219,10): error C3861: '_InterlockedExchangeAdd64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:12.2717770Z (compiling source file '../../../src/axom/slam/OrderedSet.cpp')2024-09-26T21:27:12.2718459Z 2024-09-26T21:27:12.2720438Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(243,10): error C3861: '_InterlockedExchangeAdd64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:12.2722730Z (compiling source file '../../../src/axom/slam/OrderedSet.cpp')2024-09-26T21:27:12.2723752Z 2024-09-26T21:27:12.2725687Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(267,10): error C3861: '_InterlockedAnd64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:12.2727917Z (compiling source file '../../../src/axom/slam/OrderedSet.cpp')2024-09-26T21:27:12.2728633Z 2024-09-26T21:27:12.2730560Z D:\a\axom\axom\uberenv_libs\vcpkg\installed\x86-windows\include\RAJA\policy\atomic_builtin.hpp(291,10): error C3861: '_InterlockedXor64': identifier not found [D:\a\axom\axom\build_axom\axom\slam\slam.vcxproj]2024-09-26T21:27:12.2732805Z (compiling source file '../../../src/axom/slam/OrderedSet.cpp') ```

See: https://github.com/LLNL/axom/actions/runs/11060318336

We're using vcpkg through uberenv, and the failure is with Debug and Release configurations of the x86 triplet.
The CI is still building and passing tests w/ the x64 triplet.

The error appears to be related to the (un)availability of 64-bit intrinsics in intrin.h in x86 configurations.
E.g. https://github.com/MicrosoftDocs/cpp-docs/blob/main/docs/intrinsics/interlockedand-intrinsic-functions.md#requirements

This suggests that perhaps additional guards are required based on, e.g. whether _WIN64 is defined.

We use some intrinsics in Axom, and have guards of the the following form:
https://github.com/LLNL/axom/blob/70b360815ebed6a25e6ae369bc5efeaa58cacdbc/src/axom/core/utilities/BitUtilities.hpp#L32-L40
I think we were also planning to improve our handling of 32-bit and 64-bit intrinsics on Windows, but the current approach does not produce compilation failures on Windows.

**Compilers & Libraries: **

  • MSVC compiler with x86 triplet (Axom's github actions is using MSVC@14.41.34120 from Microsoft Visual Studio 2022 Enterprise)
@adayton1
Copy link
Member

@kennyweiss, I will be on parental leave for the next two weeks. But I put up a branch for you to try: #1746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants