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

C++17 std::byte #1159

Merged
merged 4 commits into from May 9, 2024
Merged

C++17 std::byte #1159

merged 4 commits into from May 9, 2024

Conversation

dguittet
Copy link
Collaborator

After upgrading the code to C++17 for OR-Tools compatibility, an issue shows up in several of the CSP cpp files.

image

According to https://developercommunity.visualstudio.com/t/error-c2872-byte-ambiguous-symbol/93889, this happens even in cases where std::byte isn't used. And it wouldn't be used in SAM code because it was introduced in C++17.

The fix that we can apply for the SAM code for now, until it's fixed in the C++ / VS Code side of things is:

#define _HAS_STD_BYTE 0
By doing so, you are effectively disabling the ‘byte’ type that was implemented in VS 2017. Again, this method will only work if you do not use any instances of ‘byte’ throughout your code

Copy link
Collaborator

@sjanzou sjanzou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like OR-tools was built as an x86_64 library only and the GitHub Actions is failing because the arm64 universal library is missing... Can you rebuild or-tools as a universal (X86_64 and arm64) library?

@dguittet
Copy link
Collaborator Author

dguittet commented May 2, 2024

@sjanzou Thanks, fixed the build of OR-Tools that is downloaded

@dguittet dguittet requested a review from sjanzou May 3, 2024 16:16
Copy link
Collaborator

@sjanzou sjanzou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for Apple Silicon...

Would it be possible to setup an Intel Mac runner (in addition to the existing arm64 runner) for future pull requests?

@dguittet dguittet merged commit 1f807e7 into ortools May 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants