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

Mac OS broken build (std::min unable to implic cast) #3953

Closed
sgatto opened this issue Oct 13, 2023 · 2 comments
Closed

Mac OS broken build (std::min unable to implic cast) #3953

sgatto opened this issue Oct 13, 2023 · 2 comments
Assignees
Labels
Milestone

Comments

@sgatto
Copy link
Contributor

sgatto commented Oct 13, 2023

I'm preparing a PR to integrate new developments on the Xpress interface (by RTE).
I am working by using your main branch, the MacOS CI actions are broken.
It looks size_t (returned by size()) is different from uint64_t (returned by model.VehicleVar(node)->Size()) and the std::min function is not found

std::min(model.VehicleVar(node)->Size(), vehicles.size()));

A explicit cast (redundant for Windows and Linux) seems necessary.

@Mizux Mizux self-assigned this Oct 13, 2023
@Mizux Mizux added this to the v9.8 milestone Oct 13, 2023
@Mizux
Copy link
Collaborator

Mizux commented Oct 13, 2023

yup, saw it too yesterday, need to fix it ASAP (and backport it in our internal code base...)
trace: https://github.com/google/or-tools/actions/runs/6505447424/job/17669079004#step:5:46418

I fear it is related to MacOS clang uint64_t definition vs the Linux one....
Linux clang:

clang -dM -E -x c++ /dev/null | grep INT64_TYPE
#define __INT64_TYPE__ long int
#define __UINT64_TYPE__ long unsigned int

MacOS clang:
clang -dM -E -x c++ /dev/null | grep INT64_TYPE
#define __INT64_TYPE__ long long int
#define __UINT64_TYPE__ long long unsigned int

@sgatto
Copy link
Contributor Author

sgatto commented Oct 13, 2023

Yep, exactly.
I wonder, how do plan to fix it? Simply explicitly casting static_cast<uint64_t>(vehicles.size())?
I don't think you need a PR for this,

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

No branches or pull requests

2 participants