jump-dev / Gurobi.jl

A Julia interface to the Gurobi Optimizer
http://www.gurobi.com/
MIT License
223 stars 81 forks source link

Gurobi 9.0 - new release #272

Closed elhamramin closed 4 years ago

elhamramin commented 4 years ago

Hi,

any chance we get an update for the new release soon? Thank you in advance.

Kind regards, Elham

mstriebs commented 4 years ago

Don't know if thats the correct way to do it, or if anything else would need to be changed but if you go to build.jl of the Gurobi package and adjust the constant ALIASES to the following, Gurobi works again (I removed my Gurobi installation of version 8).

const ALIASES = [
    "gurobi90",
    "gurobi81", "gurobi80",
    "gurobi75", "gurobi70"
]

Afterwards you need to rebuild the Gurobi package

joseortiz3 commented 4 years ago

@mstriebs Yep, worked for me. Just forked this repo and edited Build.jl like you said and installed from my fork via

julia> Pkg.add(PackageSpec(url="https://github.com/joseortiz3/Gurobi.jl"))

Seems to work. Will post if there are any issues.

odow commented 4 years ago

Please make a pull request with your changes

odow commented 4 years ago

Closed by #273

Christl96 commented 4 years ago

How can I change the build.jl file?

odow commented 4 years ago

You shouldn't have to. You just need to get the latest Gurobi.jl release with ] add Gurobi. You want 0.7.4.

Christl96 commented 4 years ago

Sorry again: How can I get this release or check which release I'm having?

odow commented 4 years ago
julia> import Pkg

julia> Pkg.status()
    Status `~/.julia/environments/v1.3/Project.toml`
  [4076af6c] JuMP v0.20.1

julia> Pkg.add("Gurobi")
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed ForwardDiff ──── v0.10.9
 Installed DataStructures ─ v0.17.9
  Updating `~/.julia/environments/v1.3/Project.toml`
  [2e9cd046] + Gurobi v0.7.4
  Updating `~/.julia/environments/v1.3/Manifest.toml`
  [34da2185] + Compat v2.2.0
  [864edb3b] ↑ DataStructures v0.17.7 ⇒ v0.17.9
  [f6369f11] ↑ ForwardDiff v0.10.8 ⇒ v0.10.9
  [2e9cd046] + Gurobi v0.7.4
  [fdba3010] + MathProgBase v0.7.7
  [d8a4904e] ↑ MutableArithmetics v0.2.0 ⇒ v0.2.1
  [8bb1440f] + DelimitedFiles 
  [1a1011a3] + SharedArrays 

julia> Pkg.status()
    Status `~/.julia/environments/v1.3/Project.toml`
  [2e9cd046] Gurobi v0.7.4
  [4076af6c] JuMP v0.20.1
Christl96 commented 4 years ago

Thank you for your help. But when I'm adding Gurobi, the version still stays v0.7.3. I've already uninstalled and reinstalled Gurobi several times to make sure that only the new version Gurobi 9.0.0 is installed. Can I get the Gurobi.jl somehow seperately and change the files?

odow commented 4 years ago

You likely have a different package that is preventing Gurobi from updating. What's the output of ] st (or Pkg.status())?

You can also try ] add Gurobi@0.7.4

Christl96 commented 4 years ago

I get the following ERROR-message trying to use your recommended Code: ERROR: Unsatisfiable requirements detected for package MathOptInterface [b8f27783]: MathOptInterface [b8f27783] log: ├─possible versions are: [0.5.0-0.5.1, 0.6.0-0.6.4, 0.7.0, 0.8.0-0.8.4, 0.9.0-0.9.9] or uninstalled ├─restricted to versions 0.9.5 by an explicit requirement, leaving only versions 0.9.5 └─restricted by compatibility requirements with Gurobi [2e9cd046] to versions: 0.9.7-0.9.9 — no versions left └─Gurobi [2e9cd046] log: ├─possible versions are: [0.5.0-0.5.9, 0.6.0, 0.7.0-0.7.4] or uninstalled └─restricted to versions 0.7.4 by an explicit requirement, leaving only versions 0.7.4

odow commented 4 years ago

Try Pkg.free("MathOptInterface").

And please post Pkg.status().

Christl96 commented 4 years ago

That's my status output after running the Pkg.free("MathOptInterface"): [2e2ca445] BARON v0.4.4 [60bf3e95] GLPK v0.12.0 [3c7084bd] GLPKMathProgInterface v0.4.4 [2e9cd046] Gurobi v0.7.3 [7073ff75] IJulia v1.20.0 [4076af6c] JuMP v0.20.1 [b8f27783] MathOptInterface v0.9.5 [82193955] SCIP v0.9.2 The error message when trying to update to Gurobi v0.7.4 stays the same

odow commented 4 years ago

It's likely BARON or SCIP giving you a problem. Try removing them and then run ] up.

Also, there is no need for GLPKMathProgInterface. The package is obsolete and all functionality is now moved to GLPK.jl. You can remove it.

Christl96 commented 4 years ago

Thank you for that recommendation. I could run Gurobi again. Unfortunately, Gurobi still complains about (10020, "Q matrix is not positive semi-definite (PSD)"), although I thought this problem wouldn't exist with the new v9.0.0 as it solves non-convex quadratic optimization problems. But that's probably a problem with my model.

odow commented 4 years ago

You need to set the "NonConvex" parameter to 2. (https://www.gurobi.com/documentation/9.0/refman/nonconvex.html)

with_optimizer(Gurobi.Optimizer, NonConvex = 2)

However the parameter isn't currently supported by Gurobi.jl. I've opened a PR: https://github.com/JuliaOpt/Gurobi.jl/pull/284

Wait for that to be merged, then I'll tag a release, and once that's merged, you will be able to update Gurobi.jl to 0.7.5, and then everything should work.