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

Update scripts for Clang v0.17 #532

Merged
merged 9 commits into from
Nov 1, 2023
Merged

Update scripts for Clang v0.17 #532

merged 9 commits into from
Nov 1, 2023

Conversation

odow
Copy link
Member

@odow odow commented Oct 30, 2023

Closes #530

@simonbowly you could try building with this. It has a few tweaks, like using Cchar instead of UInt8

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (db2d8e6) 90.87% compared to head (36bc252) 90.87%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #532   +/-   ##
=======================================
  Coverage   90.87%   90.87%           
=======================================
  Files           5        5           
  Lines        2422     2422           
=======================================
  Hits         2201     2201           
  Misses        221      221           
Files Coverage Δ
src/Gurobi.jl 80.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@odow
Copy link
Member Author

odow commented Oct 31, 2023

Seems reasonable?

@simonbowly
Copy link
Collaborator

Yeah, a few adjustments got it building for v10. The changes look minor, but there are some failing MOI tests on my mac that I haven't dug into yet.

@simonbowly
Copy link
Collaborator

It looks like some constraints silently fail to be added? Perhaps the CChar change could cause this, this update changes const GRB_LESS_EQUAL = '<' and friends to const GRB_LESS_EQUAL = Cchar('<').

@simonbowly
Copy link
Collaborator

Manually adjusting the character constants (6bdd625) resolved this for me. I don't see an option to fix this in Clang.jl. I guess worst case these symbols can go in the preamble?

@odow
Copy link
Member Author

odow commented Oct 31, 2023

Hmm. It'd be nice to know why. You could just do a find-and-replace on the file once it has been built?

@odow
Copy link
Member Author

odow commented Oct 31, 2023

Otherwise just a note in the gen.jl script is okay. It's a very small job that happens infrequently.

@simonbowly
Copy link
Collaborator

I might just add them to the ignore list and preamble. This is a set of symbols that isn't likely to change.

As for why it fails, you may be on the right track with the Char<->[U]Int8 mapping. Evidently this differs by processor type, not by OS? If you happen to have an ARM chip handy that might shed some light on it.

It's a bit worrying that that MOI test seems to only find an issue when it checks the number of constraints in a model though? Makes it seem like an error code check is not being done?

@odow
Copy link
Member Author

odow commented Nov 1, 2023

I didn't look into why it failed yet, but it's probably something to do with lines like this:

_info(model, c).type == GRB_BINARY

The C API calls will convert properly, but

julia> 'B' == Cchar('B')
false

@odow odow merged commit 0fee7d4 into master Nov 1, 2023
4 checks passed
@odow odow deleted the od/update-clang branch November 1, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Update to new Clang.jl version for generating future C API wrappers
2 participants