Custom IPOPT for Matlab Interface

804 views
Skip to first unread message

Jonas Koenemann

unread,
Feb 2, 2016, 8:46:16 AM2/2/16
to CasADi
Hi,

i am trying to use my custom build of IPOPT with the Matlab interface of casadi to support the ma27 linear solver.

I compiled IPOPT with MinGW TDM 64 to a shared library, resulting in libipopt-1.dll and some other dlls.
The dlls are seens in the path and the tests of IPOPT run fine.

How can i tell Casadi to use my iptopt library instead of the default one?

- casadi-matlabR2014a-v2.4.1
- Windows 7


Thanks for any advice!
Jonas





I tried renaming the file ipopt dll to libcasadi_nlpsolver_ipopt.dll getting the error:
CasADi warning: "The assertion "reg!=0" on line 283 of file "/home/travis/build/casadi/binaries/casadi/casadi/core/function/plugin_interface.hpp" failed. 
PluginInterface::loadPlugin: no "casadi_register_nlpsolver_ipopt" found in D:\software\casadi-matlabR2014a-v2.4.1.
" issued  on line 131 of file "/home/travis/build/casadi/binaries/casadi/casadi/core/function/plugin_interface.hpp". 
Warning:  on line 342 of file
"/home/travis/build/casadi/binaries/casadi/casadi/core/function/plugin_interface.hpp"
Plugin 'ipopt' is not found.



Joris Gillis

unread,
Feb 2, 2016, 12:11:16 PM2/2/16
to CasADi
Dear Jonas,

The workflow is as follows:
Casadi core looks for libcasadi_nlpsolver_ipopt and loads it.
If you use the casadi binaries, then libcasadi_nlpsolver_ipopt has ipopt _statically_ linked in. There would be no possibility to switch the version of ipopt.
You could compile casadi from sources and then have libcasadi_nlpsolver_ipopt depend dynamically on your own ipopt.

However, there is not really a need to switch to a different ipopt, just to work with ma27.
The binaries have ipopt with dynamical solver loading enabled.
So it's just a matter of putting libhsl.dll on the path in principle.

The hard part is to obtain a libhsl.dll.
I only very recently managed to get a crosscompiled one running together with our binaries for windows matlab.
(Build script https://github.com/casadi/testbot/blob/trusty-pinned/recipes/mingw64_coinhsl.sh)
I'm in discussion with the people of HSL to see if they can host libraries that we would build..

Best regards,
  Joris Gillis
Message has been deleted

Jonas Koenemann

unread,
Feb 2, 2016, 1:05:22 PM2/2/16
to CasADi
Dear Joris,

thanks for you answer!
I have the libhsl.dll (in fact libcoinhsl-1.dll) as it was compiled with ipopt in the ThirdParty libraries. (A 32-bit version is also on the HSL website)

To which path do i have to add the libhsl.dll on windows?
I tried Windows user path (environment variables), and matlab path.
I renamed to libhsl.dll and made a copy libhsl.so as you did in the script.
With no success so far..

Best,
Jonas

Joris Gillis

unread,
Feb 2, 2016, 1:16:35 PM2/2/16
to CasADi
the PATH environmental variable. You may need to log out for it to propagate to matlab...
You could also check with depends.exe if the dll has nothing suspiciously missing.

Best,
   Joris

Jonas Koenemann

unread,
Feb 11, 2016, 9:47:53 AM2/11/16
to CasADi
great! It finally worked for me using msys2.
Last week I tried with mingw and msys without success, so i gave it a new shot today with msys2.
With msys2 you get the essentials with pacman (base-devel, gcc, automake, openblas, ...)
To the path i added the directory with the library (libhsl.so, libhsl.dll) as well as C:\msys64\mingw64\bin
And the configure command i used is:
../configure --prefix /home/Jonas/install --with-blas="-lopenblas" CXXFLAGS="-O3 -fopenmp" FCFLAGS="-O3 -fopenmp" CFLAGS="-O3 -fopenmp"


Duc Doan

unread,
Jun 22, 2016, 10:46:15 AM6/22/16
to CasADi
Dear Mr. Joris,

I am Duc from Tokyo Univ.

I followed your comments about using precompiled HSL libraries in IPOPT.

I am using IPOPT in Visual Studio 2015 + Intel Studio 2016. I got precompiled HSL libraries from http://www.hsl.rl.ac.uk/ipopt/
(including .dll files). However, when I tried running my program, the same error as above occurred. 

Exception of type: OPTION_INVALID in file "IpAlgBuilder.cpp" at line 508:
 Exception message: Selected linear system scaling method MC19 not available.
Windows error while loading dynamic library libhsl.dll, error = 126.

My program is running with Release x64, but I heard that those HSL libraries also work with 64-bit versions.

I would like to ask you for solution with that problem.

Sincerely,
Duc
Reply all
Reply to author
Forward
0 new messages