Can't load working HSL solvers on IPOPT with CasADi

884 views
Skip to first unread message

Daniel González

unread,
Oct 3, 2017, 12:49:43 PM10/3/17
to CasADi
Hi, 

I've started to use CasADi for some optimal control stuff, and so far I'm finding a lot of success with it (in particular, the bspline ND interpolant is very useful for us); I'd like to thank the CasADi devs for their excellent work. There's one thing I haven't managed to get working with IPOPT, though: the HSL linear solvers (ma27...), which I found out to perform significantly better than MUMPS for some of the problems that I work on. I have a binary distribution of the HSL solvers, and the ASL-based IPOPT executable that I have compiled (this is Ubuntu 14.04 and Ubuntu 16.04) has no trouble finding these solvers (I have checked with both AMPL and Pyomo and they work just fine). However, when I launch them from CasADi I get the following error: 

Exception of type: OPTION_INVALID in file "../../../../Ipopt/src/Algorithm/IpAlgBuilder.cpp" at line 271:
 Exception message: Selected linear solver MA27 not available.
Tried to obtain MA27 from shared library "libhsl.so", but the following error occured:
/usr/lib/libhsl.so: undefined symbol: dtrsm_

libhsl.so is a symlink to the provided libcoinhsl.so, and IPOPT has been built with a pretty standard configuration (with ASL, METIS and MUMPS). 

Does someone here have any hint or experience regarding what could be going wrong with my setup? Any help is very much appreciated.

Thank you for your attention.

Best regards,

Daniel González

Joris Gillis

unread,
Oct 3, 2017, 1:11:31 PM10/3/17
to CasADi
Dear Daniel,

One could reasonably argue that the libhsl you have available is defective: it has unresolved LAPACK symbols, and does not list lapack as its dependencies (see output of `ldd libhsl.so`).
Fixes: rebuild the hsl library, patch-in the dependency into the existing libhsl using elftools, use CasADi in an environment with LD_PRELOAD=yourlapack.

Best regards,
   Joris

Daniel González

unread,
Oct 4, 2017, 10:03:25 AM10/4/17
to CasADi
Dear Joris,

the LD_PRELOAD trick seems to work, thank you!

Best regards,

Daniel
Reply all
Reply to author
Forward
0 new messages