How to use non-linear solvers with JuMP using AmplNLWriter

When I try to solve any models using AmplNLWriter to call the non-linear solvers, and then call optimize! solve the problem nothing seems to happen. I use the following code:
model = Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))
When I call optimize!it returns
“Bonmin 1.8.8 using Cbc 2.10.5 and Ipopt 3.14.4
bonmin:”

Am I missing anything?

Do you have a reproducible example of the problem?

julia> using JuMP, AmplNLWriter, Bonmin_jll

julia> model = Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: AmplNLWriter

julia> @variable(model, x >= 0)
x

julia> @objective(model, Min, (x - 1)^2)
x² - 2 x + 1

julia> optimize!(model)
Bonmin 1.8.8 using Cbc 2.10.5 and Ipopt 3.14.4
bonmin: 
Cbc3007W No integer variables - nothing to do

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit https://github.com/coin-or/Ipopt
******************************************************************************

NLP0012I 
              Num      Status      Obj             It       time                 Location
NLP0014I             1         OPT 0        4 0.002398
Cbc3007W No integer variables - nothing to do

 	"Finished"

julia> value(x)
1.0000000000008957

After updating the packages, it is working now.

1 Like