Specify executable directory for IPOPT in JuMP/Julia

38 Views Asked by At

I want to specify my IPOPT directory. In Python with Pyomo I can do this in one line:

solver = SolverFactory('ipopt', executable='/my/path/to/ipopt')

In Julia with JuMP I have:

ipopt_solver = JuMP.optimizer_with_attributes(Ipopt.Optimizer, "tol"=>1e-6, "print_level"=>0)

Is there a way to do the same thing? I want Julia to use my specified path to IPOPT rather than the default IPOPT from the package manager.

1

There are 1 best solutions below

0
On

Ipopt.jl does not use the executable.

Use AmplNLWriter.jl instead: https://jump.dev/JuMP.jl/stable/packages/AmplNLWriter/

using JuMP, AmplNLWriter
model = Model(() -> AmplNLWriter.Optimizer("/my/path/to/ipopt"))