Skip to content

Conversation

@odow
Copy link
Member

@odow odow commented Oct 26, 2020

Closes #112

@mlubin
Copy link
Member

mlubin commented Oct 26, 2020

Does this actually still work? I thought we dropped support for this in one of the recent changes to how the binaries are built.

@odow
Copy link
Member Author

odow commented Oct 26, 2020

I guess you're right:

julia> using JuMP, AmplNLWriter, Ipopt

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

julia> @variable(model, x)
x

julia> @NLobjective(model, Min, x^2)

julia> optimize!(model)
ERROR: Unable to open the solution file. The most likely cause of this
is the solver executable failing unexpectedly. Unfortunately we don't
have any other information about the solution or what went wrong.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] read_results at /Users/oscar/.julia/packages/AmplNLWriter/cqDNr/src/AmplNLWriter.jl:617 [inlined]
 [3] optimize!(::AmplNLWriter.AmplNLMathProgModel) at /Users/oscar/.julia/packages/AmplNLWriter/cqDNr/src/AmplNLWriter.jl:429
 [4] optimize!(::AmplNLWriter.AmplNLNonlinearModel) at /Users/oscar/.julia/packages/AmplNLWriter/cqDNr/src/AmplNLWriter.jl:824
 [5] optimize!(::AmplNLWriter.Model{Float64}) at /Users/oscar/.julia/packages/AmplNLWriter/cqDNr/src/MOI_wrapper.jl:400
 [6] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{AmplNLWriter.Model{Float64}}) at /Users/oscar/.julia/packages/MathOptInterface/k7UUH/src/Bridges/bridge_optimizer.jl:264
 [7] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at /Users/oscar/.julia/packages/MathOptInterface/k7UUH/src/Utilities/cachingoptimizer.jl:215
 [8] optimize!(::Model, ::Nothing; bridge_constraints::Bool, ignore_optimize_hook::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/oscar/.julia/packages/JuMP/qhoVb/src/optimizer_interface.jl:130
 [9] optimize! at /Users/oscar/.julia/packages/JuMP/qhoVb/src/optimizer_interface.jl:106 [inlined] (repeats 2 times)
 [10] top-level scope at REPL[7]:1

Looks like it can't find binaries:

shell> /Users/oscar/.julia/artifacts/3fd2ae81f25cb51c29182a72a167f5cf0400ced8/bin/ipopt
dyld: Library not loaded: @rpath/libasl.dylib
  Referenced from: /Users/oscar/.julia/artifacts/3fd2ae81f25cb51c29182a72a167f5cf0400ced8/bin/ipopt
  Reason: image not found

@odow
Copy link
Member Author

odow commented Oct 26, 2020

Ah. I remember what the syntax was:

Ipopt.amplexe() do path
    model = Model(() -> AmplNLWriter.Optimizer(path))
    @variable(model, x)
    @NLobjective(model, Min, x^2)
    optimize!(model)
end

But I think we decided this was too complicated.

@odow odow merged commit 631189d into master Oct 26, 2020
@odow odow deleted the odow-patch-1 branch October 26, 2020 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

No method error with AmplNLWriter.Optimizer(Ipopt.amplexe)

3 participants