Forums › BB Series Discussions › SDK Python on Linux – dependencies between .so files
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by
CCanaff.
- AuthorPosts
CCanaffParticipantHi!
I try to run the SDK on Linux Ubuntu. It is ok for C++. I managed the libraries but, for Python, I did not succeeded. I changed the CDLL call in the bbdevice/bb_api.h to use
the .so version of bb_api.so (instead of the dll for Windows). It looks like make correct access to the bb_api.so file…but the bb_api.so file looks like getting a dependency to the libftd2xx.so and it gives me the following error :python3 list_devices.py
(I tried it with the other scripts…same result…it is on the first lines on the import call)<….from bbdevice.bb_api import *
ImportError: libftd2xx.so: cannot open shared object file: no such file or directory….>So it looks like putting the path of the libraries (which include the libftd2xx.so)
in the LD_LIBRARY_PATH solved the problem but an other error popped :<<….from bbdevice.bb_api import *
ImportError: dynamic module does not define module export function (PyInit_bb_api)…>I am not used in interfacing C++ shared libraries dependencies with Python…
I tried to change stuff in the bb_api.h but it doesn’t seems to work.It may be simple Python’s adjustments…
Can somebody help me on that ?
Thanks,
Charles
RogerModeratorHi Charles,
Try renaming both .so files to have a “lib” prefix, and updating the CDLL call accordingly. So, the bbdevice directory would contain libbb_api.so and libftd2xx.so. The call would be
bblib = CDLL("bbdevice/libbb_api.so")
You are correct that LD_LIBRARY_PATH needs to be set. We are updating the documentation.
Thanks for reaching out.
-Roger
CCanaffParticipantLooks like it doesn’t work if bb_api.so is also present in the bbdevice directory as a copy of libbb_api.so or as a symbolic link…You have to be sure to make the bblib =CDLL(“bbdevice/libbb_api.so”)
in the bbdevice/bb_api.h file and to get the two libraries bbdevice/libbb_api.so and bbdevice/libftd2xx.so without file or symbolic link referring to bb_api.so in the bbdevice directory.
And the LD_LIBRARY_PATH have to be set.Now it works…
Thanks for your help,
Charles
- AuthorPosts
You must be logged in to reply to this topic.