coin-or / Ipopt

COIN-OR Interior Point Optimizer IPOPT
https://coin-or.github.io/Ipopt
Other
1.36k stars 272 forks source link

HSL Is Disabled But Is Still Compiled into IPOPT Mex File — Do Not Understand What is Happening #777

Closed anilvrao closed 2 weeks ago

anilvrao commented 2 weeks ago

This is a bit of a strange question.

I now have everything working to compile an IPOPT Mex file for Apple Silicon with Mumps and the HSL solvers. I am, however, getting some really strange behavior with regard to which linear solvers are enabled in the Mex file.

First, I have HSL disabled in the IPOPT configure command using the flag --without-hsl. Second, I do not compile the HSL code into my Mex file at all. Nevertheless, when I am done with the Ipopt compilation and building the Mex file, the HSL linear solvers are still part of the Mex file. I do not even have an HSL library in /usr/local/lib, so I have no idea why any linking with an HSL library is taking place. The only linear solver library I have in /usr/local/lib is libcoinmumps.a and libcoinmumps.la. Finally, when I use the mexIpopt interface built by Enrico Bertolazzi, I have not included linking to an HSL library. The Mex file builds perfectly fine but, as I said, includes the HSL solvers despite my not including them in the build.

I am wondering if anyone can help me understand why the HSL solvers are being compiled into my Mex file. Thanks for the help.

— Anil

svigerske commented 2 weeks ago

As usual, we would need to see detailed logs of your build to see what is going on. Further, how did you verify "the HSL linear solvers are still part of the Mex file"?

Maybe you confuse Ipopt being built with HSL with Ipopt trying to load an HSL library dynamically at runtime.

anilvrao commented 2 weeks ago

After some more manipulation, I managed to get a Mex file now that does not include the HSL solvers. It does, however, still try to load an HSL dynamic library when I choose one of the HSL linear solvers in the IPOPT settings.  Is there any way to get a cleaner error that says an HSL solver (whichever one I choose) is not a valid option for the linear solver?  It’s kind of annoying to get the error that IPOPT is unable to find the HSL dynamic library.

—— Anil V. Rao, PhD E-mail: @. Tel: 352-672-1529 Web:  http://anilvrao.com On Jul 2, 2024 at 3:41 AM -0400, Stefan Vigerske @.>, wrote:

As usual, we would need to see detailed logs of your build to see what is going on. Further, how did you verify "the HSL linear solvers are still part of the Mex file"? Maybe you confuse Ipopt being built with HSL with Ipopt trying to load an HSL library dynamically at runtime. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

anilvrao commented 2 weeks ago

After some more manipulation, I managed to get a Mex file now that does not include the HSL solvers. It does, however, still try to load an HSL dynamic library when I choose one of the HSL linear solvers in the IPOPT settings.  Is there any way to get a cleaner error that says an HSL solver (whichever one I choose) is not a valid option for the linear solver?  It’s kind of annoying to get the error that IPOPT is  load the HSL dynamic library.

—— Anil V. Rao, PhD E-mail: @. Tel: 352-672-1529 Web:  http://anilvrao.com On Jul 2, 2024 at 3:41 AM -0400, Stefan Vigerske @.>, wrote:

As usual, we would need to see detailed logs of your build to see what is going on. Further, how did you verify "the HSL linear solvers are still part of the Mex file"? Maybe you confuse Ipopt being built with HSL with Ipopt trying to load an HSL library dynamically at runtime. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

svigerske commented 2 weeks ago

You can configure Ipopt with --disable-linear-solver-loader to turn off the feature of dynamic loading of linear solvers. This will then also remove the possibility to choose an HSL solver or Pardiso as linear_solver.

anilvrao commented 2 weeks ago

I tried using the flag --disable-linear-solver-loader, but I receive the same error as before (see below).  Also, I get this same error regardless of whether I choose “—without-hsl” or “—with-hsl” in the IPOPT configure command.  In some sense it’s not a big deal because the HSL linear solvers are disable.  In another sense, it would be better to have the Mex file throw an error saying that any of the HSL linear solvers or Pardiso is not a valid choice for a linear solver.

Exception of type: DYNAMIC_LIBRARY_FAILURE in file "/Users/anilvrao/Desktop/ipoptMex/mumpsOnly/Ipopt/src/Common/IpLibraryLoader.cpp" at line 86:  Exception message: dlopen(libhsl.dylib, 0x0002): tried: 'libhsl.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibhsl.dylib' (no such file), './libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/./libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../sys/os/maca64/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../runtime/maca64/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../sys/java/jre/maca64/jre/lib/server/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../sys/java/jre/maca64/jre/lib/libhsl.dylib' (no such file), '/usr/lib/libhsl.dylib' (no such file, not in dyld cache), 'libhsl.dylib' (no such file)

—— Anil V. Rao, PhD E-mail: @. Tel: 352-672-1529 Web:  http://anilvrao.com On Jul 2, 2024 at 8:06 AM -0400, Stefan Vigerske @.>, wrote:

You can configure Ipopt with --disable-linear-solver-loader to turn off the feature of dynamic loading of linear solvers. This will then also remove the possibility to choose an HSL solver or Pardiso as linear_solver. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

svigerske commented 2 weeks ago

I could say again that we would need to see detailed logs of your build to see what is going on, but I doubt this has any effect. So I'm just going to close this, as there seem to be no real problem here anyway.