jump-dev / Ipopt.jl

A Julia interface to the Ipopt nonlinear solver
https://github.com/coin-or/ipopt
Other
152 stars 58 forks source link

Wondering if I can use pardiso Windows dll as linear solver for Ipopt without getting recompiled Ipopt #83

Closed donboyd5 closed 4 years ago

donboyd5 commented 7 years ago

Hi. I am learning Julia in hopes of solving a large-scale maximum entropy NLP (min sum of x*log(x)) with 3.5e6 variables, 70e3 linear equality constraints, 30e6 nonzero fixed constraint coefficients, quite sparse. I have failed at it via R using Ipopt and Mumps. (This arrangement has solved problems with up to about 12e6 nonzero coefficients but stalls with larger problems.)

I am thinking Ipopt with Pardiso might be most appropriate. (Have not succeeded at that yet via R.)

I am wondering if I can use Ipopt in Julia with the Windows pardiso dll, without having to custom-compile a version of Ipopt. I have great difficulty compiling Ipopt on Windows.

Could you please tell me if there is a way to use the pardiso dll and Ipopt.jl without recompiling Ipopt? (Details of what I have tried so far are below.) I don't know much about Julia so perhaps it could work, and I simply have the pardiso dll in the wrong location.

(Also, I welcome any other comments on better approaches to my problem within Julia. I have obtained academic license to HSL solvers and think HSL_MA97 might be good, but would have to compile HSL with Ipopt. Also, as possible alternative, I have academic license to Mosek, but have not used Mosek.)

Many thanks in advance.

Don


Details:

I tried the following:

  1. Using Ipopt.jl without JuMP.jl, trying to add the pardiso solver: I modified the hs071 example by adding:

    addOption(prob, "linear_solver", "pardiso")

When I ran solveProblem(prob)

I got: Exception message: Selected linear solver Pardiso not available. Tried to obtain Pardiso from shared library "libpardiso.so", but the following error occured: Windows error while loading dynamic library libpardiso.so, error = 126.

Error #126 means the specified module could not be found so I hold out hope that Ipopt (via Ipopt.jl) ws looking for pardiso.dll, and perhaps I have it in the wrong place.

  1. Using Ipopt.jl and JuMP.jl with the pardiso solver: Defined a model: m = Model(solver = IpoptSolver(linear_solver="pardiso")) ...set up a simple model... solve(m) gives the same error as in approach #1.

I tried both approaches, with and without:

using Pardiso (didn't think it should be necessary)

tkelman commented 7 years ago

Try putting the dll in either JULIA_HOME, or Pkg.dir("WinRPM", "deps", "usr", "x86_64-w64-mingw32", "sys-root", "mingw", "bin"), see if that helps

donboyd5 commented 7 years ago

I first put libpardiso500-WIN-X86-64.dll, and then libpardiso.dll (same file, renamed) into JULIA_HOME, and then into Pkg.dir(...). (The latter looks like a good place based on the solver dlls that are there.) I also rebooted on one occasion, although I don't imagine that was necessary.

In each case, I still get: Selected linear solver Pardiso not available. Tried to obtain Pardiso from shared library "libpardiso.so", but the following error occured: Windows error while loading dynamic library libpardiso.so, error = 126 [#126 means module could not be found]

As I understand it, .so libraries (it says it is looking in libpardiso.so) are Unix libraries but I'm on windows. Don't know whether that's meaningful, or whether it is simply a unix-oriented message and it's actually looking for the dll.

Any further thoughts?

Thank you very much.

tkelman commented 7 years ago

The dlls from winrpm are cross-compiled from the opensuse build service, so there might be a bug in ipopt's build system where the code for the linear solver loader doesn't do the right thing when it's being cross compiled. Maybe try renaming the dll to libpardiso.so? Otherwise I'd have to look at the linear solver loader code in ipopt.

tkelman commented 7 years ago

Or check the library using dependency walker to see if it's missing some dependencies.

donboyd5 commented 7 years ago

I renamed to libpardiso.so and put it in Pkg.dir(...)

Thank you so much! (see below)

I will also have to see whether that fixes my inability to use pardiso with ipoptr (in R). Will let you know, but may not be able to get to that until tomorrow.

Don


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 http://projects.coin-or.org/Ipopt


This is Ipopt version 3.12.2, running with linear solver pardiso.

Number of nonzeros in equality constraint Jacobian...: 4 Number of nonzeros in inequality constraint Jacobian.: 4 Number of nonzeros in Lagrangian Hessian.............: 10

donboyd5 commented 7 years ago

I checked, and renaming to libpardiso.so also allows ipoptr (the R interface to Ipopt) to work with Pardiso.

Thanks!

pedrohvbsilva commented 5 years ago

Hi, i'm having the same problem but now i'm using Julia v1.1.0 with JuMP v0.19, trying to use another linear solver, but not finding the path to put the libpardiso.dll

Any advice?

ollamc commented 4 years ago

Is there an equivalent solution for Julia 1.3.1? I am running through the same problem, but Pkg.dir() is deprecated, and I cant figure out where is Pkg.dir("WinRPM", "deps", "usr", "x86_64-w64-mingw32") supposed to point.

Thanks

blegat commented 4 years ago

WinRPM is not used anymore for the Ipopt binaries on Windows. See https://github.com/JuliaOpt/Ipopt.jl#custom-installation for using a custom Ipopt library.

ollamc commented 4 years ago

So what would the solution be? Should I perform a custom installation of Ipopt in order to be able to include the Pardiso solver? If so, is there any documentation on the subject?

Thanks

blegat commented 4 years ago

Moving the discussion to https://github.com/JuliaOpt/Ipopt.jl/issues/195