JuliaPackaging / Yggdrasil

Collection of builder repositories for BinaryBuilder.jl
https://binarybuilder.org
Other
332 stars 581 forks source link

Issue parsing Ipopt_jll string option when there is blank space in path #10540

Closed KSepetanc closed 1 month ago

KSepetanc commented 1 month ago

hsllib attribute of Ipopt_jll does not load correctly when there is blank space in path. For example, if folder is named "test 2" if fails with an error, but if folder is named "test2" then it works as expected. Sample of a call is illustrated below.

set_optimizer(pol, () -> AmplNLWriter.Optimizer(Ipopt_jll.amplexe))
set_attribute(pol, "linear_solver", "ma27")
set_attribute(pol, "hsllib", joinpath(@__DIR__,"../HSL/libhsl.so"))
optimize!(pol)

Log:

Ipopt 3.14.17: hsllib=/home/karlo/Desktop/test
Unknown keyword "2/sa/../HSL/libhsl.so"
linear_solver=ma27

Run using Julia 1.11.3 and Linux.

giordano commented 1 month ago

Could you please share an actual error message, including a stacktrace, showing an evidence that whatever error you're observing has anything to do with this repository?

KSepetanc commented 1 month ago

Thank you for your quick reply.

There is no error message at all. The run just stops after writing the above log. I have no such issue with Ipopt.jl or NLPModelsIpopt.jl, just with Ipopt_jll.jl

Ipopt_jll redirects to write issues here so I wrote it here. Seems useful to support any path.

giordano commented 1 month ago

My point is that JLLs do very little. I doubt whatever issue you're seeing will have to be fixed here. The code you have shared isn't even reproducible.

giordano commented 1 month ago

Closing the issue as invalid:

KSepetanc commented 1 month ago

@giordano can you please help me find the issue or direct me who should I contact?

I am providing complete code as requested.

using JuMP, AmplNLWriter, Ipopt_jll

mod = Model(() -> AmplNLWriter.Optimizer(Ipopt_jll.amplexe))
set_attribute(mod, "linear_solver", "ma27")
set_attribute(mod, "hsllib", joinpath(@__DIR__,"libhsl.so"))
optimize!(mod)

Unknown keyword only appears if located in path with blank space. (Update: Attached mwe was removed due to containing binnary)

giordano commented 1 month ago

Any way to reproduce it which doesn't involve loading a binary blob I have no clue where it's coming from?

can you please help me find the issue or direct me who should I contact?

Where's the message you're complaining about coming from? The optimize!(mod) line? Where's the otimize! method you're using coming from? That'd be a half decent guess of the responsible of quoting arguments correctly.

KSepetanc commented 1 month ago

I changed the example so that it does not use binary. Just put it in some location with space.

using JuMP, AmplNLWriter, Ipopt_jll

mod = Model(() -> AmplNLWriter.Optimizer(Ipopt_jll.amplexe))
set_attribute(mod, "output_file", joinpath(@__DIR__,"output.txt"))
optimize!(mod)

Yes. It is coming from optimize!(mod), but it is only occurring when I use Ipopt_jll solver. If you suggest that I will open an issue there (JuMP) too, I will.

giordano commented 1 month ago

but it is only occurring when I use Ipopt_jll solver

I still don't see how that's relevant at all. Your problem seems to be that some code is not quoting paths correctly. In this repository we only compile from source and provide a way to automatically install it for end users. Stop. You should find what piece of code is not quoting paths correctly and fix it, we aren't responsible for that here.

If you suggest that I will open an issue there (JuMP) too, I will.

If optimize!(mod) is a JuMP method that sounds potentially like a JuMP issue then. Alerting @odow, but again, this issue has extremely likely nothing to do with Yggdrasil, unless someone brings clear evidences that we are packaging external libraries incorrectly.

KSepetanc commented 1 month ago

OK. Thank you. I will look for help on Discourse. Maybe they will know where to put this issue.

Discourse topic

odow commented 1 month ago

Just chiming in to say that this is not related to Yggdrasil. (It would have replied earlier but it's only 07:00 on a Sunday... :smile:)

KSepetanc commented 1 month ago

Thank you all. Sorry for putting this on wrong package. I made wrong judgment. Have a few more issues to post in coming days 😅