[JuMP] Is it possible to switch solver version back and forth? (e.g. Gurobi 7.5 <-> 8.0)


#1

Is it possible to switch solver version back and forth? (e.g. Gurobi 7.5 <-> 8.0)
Also, is there any command to display Solver version that I am using on Julia?

using JuMP, Gurobi
m = Model(solver = GurobiSolver())
@variable(m, x[1:3] >= 0)
@objective(m, Min, -3x[1]-x[2]-3x[3])
@constraint(m, 2x[1]+x[2]+x[3] <= 2)
@constraint(m, x[1]+2x[2]+3x[3] <= 5)
@constraint(m, 2x[1]+2x[2]+x[3] <= 6)
print(m)
status = solve(m)
getobjectivevalue(m)
getvalue(x)

image


#2

As far as I know you would need to swap out your license files. Obviously you can write a few functions to automate this, but as far as I know that is the best you can do.

Looks like you can check your Gurobi version by doing Gurobi.getlibversion().


#4

Thanks for the comment. That helps me a lot!


#5

My not great way to do this is to modify the GUROBI_HOME environment variable to point to the other installation and then run Pkg.build("Gurobi") each time.