SDK Python on Linux – dependencies between .so files

Forums BB Series Discussions SDK Python on Linux – dependencies between .so files

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #242882
    CCanaff
    Participant

    Hi!
    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

    #242886
    RogerRoger
    Moderator

    Hi 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

    #242888
    CCanaff
    Participant

    Looks 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

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.