CasADi can't find MA27 and MA57 packages

2,872 views
Skip to first unread message

Alex Tătulea

unread,
Jul 8, 2014, 5:52:09 AM7/8/14
to casadi...@googlegroups.com
Hello guys,

I hope someone would have had some experience with this and can maybe help me track it down and solve it.

I'm trying to solve an optimization problem with CasADi+IPOPT, using the MA27 solver. When running my Python code I get an error of the following sort: Selected linear solver MA27 not available. Tried to obtain MA27 from shared library "libhsl.so", but the following error occured: /lib/libhsl.so: undefined symbol: mc47id_

What is weird is that I am able to run the test problems of IPOPT with this solver and everything works fine. It seems to be only a problem of CasADi not finding the solvers. I then tried to reinstall CasADi and only then noticed that the configuration file doesn't find the MA57 and MA27 packages. What am I missing here? I am running CasADi 1.7.1 and IPOPT 3.10.2.

Thanks in advance for your help!
Cheers,
Alex

Joel Andersson

unread,
Jul 8, 2014, 7:36:26 AM7/8/14
to casadi...@googlegroups.com
Hello Alex!

CasADi does not look for MA57 and MA27, it's all done by the linear solver loader in IPOPT. Reinstalling CasADi won't help, you need to make sure that IPOPT works correctly and that all the libraries are in the right paths. Any reference to MA57 when installing CasADi is unrelated to IPOPT.

My advice would be to reinstall the HSL libraries.

Joel

Alex Tătulea

unread,
Jul 10, 2014, 4:56:09 AM7/10/14
to casadi...@googlegroups.com
Thanks Joel for the reply. I just thought that if CasADi prompted that it couldn't find the packages it would have some problem afterwards. It might well have been a problem of IPOPT, I'm not sure, but the solvers were running alright there. It was only with the CasADi Python interface that the problem occured.

Anyway, all that aside, after 2 days of basically playing around and trying "random" stuff this is my solution:

1. Clean up all existing IPOPT and CasADi libraries from /lib, /usr/lib and /usr/local/lib  (I had played with two versions of each one)
2. Reinstall IPOPT, with no change to the HSL routines. Just the basics.
3. Reinstall CasADi.  This time I did a "sudo make install" also. Not sure if this is what ultimately fixed it, but it's not specified in the installation instructions.

Now my code runs with both MA27 and MA57 solvers. Maybe this problem doesn't come up that often, I mean I also installed CasADi with IPOPT two times before and everything went pretty smooth. But when it does happen, it's damn frustrating :)

All the best,
Alex

Joel Andersson

unread,
Jul 10, 2014, 5:09:44 AM7/10/14
to casadi...@googlegroups.com
Hi Alex!

Great to hear that things worked out in the end! Yeah, installation problems are always very frustrating and we do our best to mitigate them. We are now refactoring the build system in order to make installation much easier.

Best regards,
Joel

Afaq Ahmad

unread,
Oct 12, 2015, 6:20:48 PM10/12/15
to CasADi
hi Alex,

i am facing same problem as you had, i would like to ask if you can help me. I install ipopt normal(without hsl routines), afterwards i install casadi and then i install hsl routine but i think i have linking problem that's why casadi can't find ma27.
what can i do for lnking?
regards
AFAQ AHMAD

Marwa Alfouly

unread,
Sep 20, 2022, 9:23:53 AM9/20/22
to CasADi
Hi Afaq, 

I have done the same procedure you did and Casadi is not picking the solver. If you have any tips to make it work I would highly appreciate it.
Thanks 

Anthony Quarshie

unread,
Sep 30, 2022, 10:42:15 AM9/30/22
to CasADi
Hi Marwa and Afaq,

To link HSL libraries to IPOPT in CasADi, following the instructions on this page might help: https://github.com/casadi/casadi/wiki/Obtaining-HSL
The output of those instructions is 'libhsl.so'/'libhsl.dll' depending on your OS. Copy and paste this file in your main CasADi folder which also has casadi.py file. 
Reply all
Reply to author
Forward
0 new messages