Linking solver binaries with models (JuMP)

jump
juliapro

#1

I have binaries of solvers in a particular directory of my linux systems. Now I want to solve my JuMP model using those binaries. How do I do that?


#2

To use a solver with JuMP the binary needs to be wrapped. Most of the common solvers have so you can just go

Pkg.add("Gurobi")
using Gurobi
m = Model(solver=GurobiSolver())

You can see a list of wrapped solvers in the table at the bottom of http://www.juliaopt.org/


#3

Can this be done without the Pkg.add() command?


#4

What is the solver you have in mind ?


#5

I am hoping to get a way to link all the optimisation solvers like Ipopt, Bonmin, Cbc, Clp, GLPK etc.


#6

The available solvers are listed here: http://www.juliaopt.org/ As @odow says, you to use a solver in Julia, you need to install the corresponding package. By doing Pkg.add("Gurobi") for Gurobi, , Pkg.add("Ipopt") for Ipopt, …
Then to use it with JuMP, you need to do

using Ipopt
using JuMP
m = Model(solver=IpoptSolver())

Why do you want to find a way that doesn’t use Pkg.add() ?


#7

Well, there are certain restrictions on me to use the Pkg.add() command. I cannot run the command.
Also, does the Pkg.build("Ipopt") check for installed Ipopt solver? If thats the case then I can install the solver and then run the build after downloading the source code of Ipopt package.


#8

If you download Ipopt.jl manually, e.g. by clicking on “Clone or download zip” here. Then if it is on /path/to/Ipopt, you can do

julia> push!(LOAD_PATH, "/path/to")
julia> Pkg.build("Ipopt")
julia> using Ipopt