JuliaOpt / CoinOptServices.jl

Julia interface to COIN-OR Optimization Services https://projects.coin-or.org/OS
Other
16 stars 4 forks source link

null function pointer error calling solver #7

Closed JesseJenkins closed 9 years ago

JesseJenkins commented 9 years ago

I've been using CoinOptServices to run the bonmin nonlinear solver and it has been working well, until a recent Pkg.update() today. Now I'm getting the following error when attempting to execute the model solve.

symbol could not be found xmlReadFile (-1): invalid handle passed to dlsym() ERROR: ccall: null function pointer in parse_file at /Users/jessedj/.julia/v0.3/CoinOptServices/src/translations.jl:261 in read_osrl_file! at /Users/jessedj/.julia/v0.3/CoinOptServices/src/CoinOptServices.jl:385 in optimize! at /Users/jessedj/.julia/v0.3/CoinOptServices/src/CoinOptServices.jl:541 in solvenlp at /Users/jessedj/.julia/v0.3/JuMP/src/nlp.jl:498 in solve at /Users/jessedj/.julia/v0.3/JuMP/src/solvers.jl:14

The same error is generated when I tried to switch to using the couenne nonlinear solver instead, so I think the issue is with CoinOptServices rather than the specific solver.

My setup is as follows:

using JuMP using CoinOptServices CPrice = Model(solver=OsilSolver(solver = "bonmin")) ... #model formulation here solve(CPrice)

At that stage I get the above error. I can supply the full model code, but would prefer not to as it is research-in-progress...

Here's the current Pkg.status() results showing the versions of each package I have installed. I'm using Julia v.0.3.11

julia> Pkg.status() 7 required packages:

  • CoinOptServices 0.0.5
  • DataFrames 0.6.9
  • Gurobi 0.1.29
  • IJulia 0.2.5
  • Ipopt 0.1.16
  • Jewel 1.0.5
  • JuMP 0.9.3 37 additional packages:
  • ArrayViews 0.6.3
  • BinDeps 0.3.15
  • Calculus 0.1.10
  • Cbc 0.1.7
  • Clp 0.0.10
  • Color 0.4.7
  • Compat 0.5.1
  • Compose 0.3.13
  • DataArrays 0.2.17
  • DataStructures 0.3.12
  • Docile 0.5.16
  • DualNumbers 0.1.3
  • FactCheck 0.3.1
  • FixedPointNumbers 0.0.10
  • GZip 0.2.17
  • Graphics 0.1.0
  • Homebrew 0.1.16
  • Iterators 0.1.8
  • JSON 0.4.5
  • JuliaParser 0.6.2
  • LNR 0.0.1
  • Lazy 0.9.1
  • LightXML 0.2.0
  • MacroTools 0.2.0
  • MathProgBase 0.3.16
  • NaNMath 0.0.2
  • Nettle 0.1.10
  • REPLCompletions 0.0.3
  • Reexport 0.0.2
  • Requires 0.1.3
  • ReverseDiffSparse 0.2.10
  • SHA 0.1.1
  • SortingAlgorithms 0.0.5
  • StatsBase 0.7.1
  • StatsFuns 0.1.2
  • URIParser 0.0.5
  • ZMQ 0.2.0

Thanks for the assistance. Jesse Jenkins PhD student MIT Institute for Data Systems and Society

joehuchette commented 9 years ago

Could you provide the versions for julia and the packages? (with VERSION and Pkg.status())

cc @tkelman, any ideas?

JesseJenkins commented 9 years ago

Hi Joe, I updated the initial post with the Julia version number (0.3.11) and the Pkg.status output just a moment ago. Cheers, Jesse

mlubin commented 9 years ago

Try using BonminNLSolver from the AmplNLWriter package (which depends on CoinOptServices for the Bonmin binaries)

JesseJenkins commented 9 years ago

Hi Miles. I tried running bonmin using AmplINLWriter and got the following error:

using JuMP
using AmplNLWriter
CPrice = Model(solver=AmplNLSolver("bonmin"))
#[model formulation here...]
solve(CPrice)

Produces:

ERROR: could not spawn bonmin -s /Users/jessedj/.julia/v0.3/AmplNLWriter/.solverdata/model.nl '': > no such file or directory (ENOENT) in _jl_spawn at process.jl:217 in spawn at /Applications/Julia-0.3.11.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times) in optimize! at /Users/jessedj/.julia/v0.3/AmplNLWriter/src/AmplNLWriter.jl:272 in solvenlp at /Users/jessedj/.julia/v0.3/JuMP/src/nlp.jl:498 in solve at /Users/jessedj/.julia/v0.3/JuMP/src/solvers.jl:14

Did the path to the bonmin and couenne solvers get screwed up somehow when I updated CoinOptServices? It seems like somehow my install of CoinOptServices is not working properly, and the solver binaries can't be found.

JesseJenkins commented 9 years ago

Update:

Using the following syntax works to call the NL solvers:

# These both work:
CPrice = Model(solver=CouenneNLSolver())
CPrice = Model(solver=BonminNLSolver())
#This however doesnt work: 
CPrice = Model(solver=AmplNLSolver("bonmin"))

Both NL solvers are executing for me now using the above syntax. So I guess this is resolved, although I'm still not sure why the CoinOptServices based calls stopped working for me when they worked with the exact same syntax earlier this week.

Thanks for your help Miles.

tkelman commented 9 years ago

Thanks for the report. This looks like it's an issue with a change I recently made in LightXML. Can you do Pkg.test("LightXML")? If that fails, we should close this here and reopen over there.

JesseJenkins commented 9 years ago

Hi Tony,

I ran the Pkg.test and it passed:

Pkg.test("LightXML") INFO: Testing LightXML running parse.jl ... running create.jl ... running cdata.jl ... INFO: LightXML tests passed INFO: No packages to install, update or remove

tkelman commented 9 years ago

Oh, I think I know what this is. I probably just need to tag CoinOptServices to make it work properly with a precompiled LightXML. If you do Pkg.checkout("CoinOptServices") does everything work again? If so, I'll let you know when I've tagged then you can do Pkg.free("CoinOptServices") to avoid always pulling from tip-of-master.

mlubin commented 9 years ago

Another report: http://stackoverflow.com/questions/32178686/julia-jump-error-solving-nlmip-error-error-compiling-read-osrl-file-could-no

tkelman commented 9 years ago

okay, will tag then

JesseJenkins commented 9 years ago

The null pointer error is avoided if I run Pkg.checkout("CoinOptServices) (and still persists if I don't run it).

tkelman commented 9 years ago

Thanks for verifying. I tagged a new version last night.