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

Rewrite C wrapper using Clang #346

Merged
merged 19 commits into from
Sep 28, 2020
Merged

Rewrite C wrapper using Clang #346

merged 19 commits into from
Sep 28, 2020

Conversation

odow
Copy link
Member

@odow odow commented Sep 22, 2020

Getting this shipshape before I step back from maintaining it.

I don't know what the deprecation path is.

The biggest issue is the callback file, which had some constants CB_MIPSOL, and some functions like cbget_xxx. Is it worth deprecating those and nothing else?

image

Closes #8
Closes #14
Closes #18
Closes #24
Closes #25
Closes #54
Closes #80
Closes #100
Closes #102
Closes #107
Closes #113
Closes #121
Closes #155
Closes #160
Closes #218
Closes #266
Closes #342
Closes #344
Closes #345
Closes #347

README.md Outdated Show resolved Hide resolved
@odow odow mentioned this pull request Sep 22, 2020
@odow
Copy link
Member Author

odow commented Sep 24, 2020

Same deprecation strategy as CPLEX.

The C API of Gurobi.jl has been rewritten to expose the complete C API, and
all old functions have been removed.

For example:

    model = Gurobi.Optimizer()
    stat = Gurobi.get_status_code(model.inner)

is now:

    model = Gurobi.Optimizer()
    valueP = Ref{Cint}()
    ret = GRBgetintattr(model, "Status", valueP)
    if ret != 0
        # Do something because the call failed
    end
    stat = valueP[]

The new API is more verbose, but the names and function arguments are now
identical to the C API, documentation for which is available at:
https://www.gurobi.com/documentation/9.0/refman/c_api_details.html

To revert to the old API, use:

    import Pkg
    Pkg.add(Pkg.PackageSpec(name = \"Gurobi\", version = v\"0.8.1\"))

Then restart Julia for the change to take effect.

image

@odow
Copy link
Member Author

odow commented Sep 25, 2020

This PR is a little hard to review, so I propose merging into master to make it easier for people to try out, with the view to waiting a while before tagging and releasing. Then any extra changes will be much easier to review.

@odow
Copy link
Member Author

odow commented Sep 28, 2020

Merging with the same plan as CPLEX: jump-dev/CPLEX.jl#316 (comment)

@odow odow merged commit 6939897 into master Sep 28, 2020
@odow odow deleted the od/rewrite branch September 28, 2020 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment