The erros of using RAPOSa(https://raposa.usc.es) based on AmplNLWriter

using JuMP, AmplNLWriter
m = Model(() → AmplNLWriter.Optimizer(“raposa”))
@variable(m, 1 <= x <= 10 )
@variable(m, 0 <= y <= 8 )
@NLobjective(m, Min, x^2 + y^2 + x )
@NLconstraint(m, x*y >= 1.0 )
optimize!(m)

@show value(x)
@show value(y)

solution_summary(m)

The above code shows that
" Errors calling the solver. Failed with: Base.IOError(“could not spawn raposa /tmp/jl_NWfK3R/model.nl -AMPL: no such f:ile or directory (ENOENT)”, -2)"

I try to do " raposa /tmp/jl_NWfK3R/model.nl " in command of Linux, and it is OK. So what’s wrong with it and how to fix it?

thanks.

1 Like

Firstly ,you should do.

Insert RAPSOa path

export PATH=/path_name/RAPOSa_4.2.0_Ubuntu20:$PATH

in .bashrc and then
$> source .bashrc

1 Like

Instead of modifying the PATH, just provide the full path to AmplNLWriter.Optimizer:

using JuMP, AmplNLWriter
model = Model(() -> AmplNLWriter.Optimizer("/path_name/RAPOSa_4.2.0_Ubuntu20/raposa"))

Actually, it is the same and but the messages of error are different.

using JuMP, AmplNLWriter
# m = Model(() -> AmplNLWriter.Optimizer("raposa"))
# m = Model(() -> AmplNLWriter.Optimizer("raposa",["-outlev=1","-maxtime=60"]))
m = Model(() -> AmplNLWriter.Optimizer("/home/USER_NAME/RAPOSa_4.2.0_Ubuntu20/raposa"))

@variable(m, 1 <= x <= 10 )
@variable(m, 0 <= y <= 8 )
@NLobjective(m, Min, x^2 + y^2 + x )
@NLconstraint(m, x*y >= 1.0 )
write_to_file(m, "exampleRAPOSa00.nl")
optimize!(m)

The error:
-integrated_ipopt_dir is not a valid option.

and i can do it with raposa /tmp/jl_NCKJlw/model.nl.

Global solution found after 1 iterations and 0.16508 seconds.
Objective: 3

So i don’t know why and there are some errors out of my mind. it 's sad for it.

Just quickly, it’s much easier to read if you can start and end copied code and terminal output using three back ticks: ```

Ok, thanks

What happens if you call raposa /tmp/jl_NCKJlw/model.nl -AMPL