hpipm icon indicating copy to clipboard operation
hpipm copied to clipboard

"library not loaded" for python interface

Open Francis777 opened this issue 5 years ago • 4 comments

Hi, First thank you for publishing this solver!

When I'm trying to install hpipm including the python interface I experienced the following issue when running getting_started.py:

OSError: dlopen(libhpipm.so, 6): Library not loaded: libblasfeo.so
Referenced from: /opt/hpipm/lib/libhpipm.so`
Reason: image not found

I'm pretty sure I strictly followed the steps and there's no other problem. Besides everything works well when using the C interface. I googled for the reported error but nothing seems helpful or similar to this one.

Below are more details regarding this issue: (1) I got Successfully installed hpipm-python-0.1 at the end of step 5 (2) I do add the two libraries to path:

$ echo $LD_LIBRARY_PATH
:/opt/blasfeo/lib:/opt/hpipm/lib

(3) The library does exist in the directory:

$ cd /opt/hpipm/lib
$ ls -l
total 992
-rwxr-xr-x  1 root  wheel  505132 May 25 01:51 libhpipm.so

(4) My operating system is Mac OS X.

Thanks, Francis

Francis777 avatar May 25 '19 09:05 Francis777

Hey @Francis777, thanks for your interest! The Python and MATLAB interfaces are relatively new, so any feedback from users is more than useful ;) We had a similar problem with another user a few days ago, but I could not reproduce it myself yet. Is it possible that you are using a not so recent version of ctypes? It seems that older versions did not look into LD_LIBRARY_PATH.

zanellia avatar May 25 '19 09:05 zanellia

Now that I look more carefully, libhpipm.so is actually found. Did you successfully install BLASFEO too?

zanellia avatar May 25 '19 09:05 zanellia

Hi Andrea, Thanks for your reply!

I did follow the steps to install BLASFEO before hpipm. To double check I went back to BLASFEO directory and successfully run the example.

I think there maybe some other possible reasons, such as the following one?

  • Shared libraries on Mac OS X tend to have the extension .dylib instead of .so

Mac OS X Lion Python Ctype CDLL error lib.so.6 : image not found

I'll go to windows and try this to check if this is the reason!

Francis777 avatar May 25 '19 10:05 Francis777

Hi @Francis777 did you fix your problem?

zanellia avatar May 28 '19 14:05 zanellia