If I am wrapping a shared library (e.g. libParent.so), and generate python bindings (e.g. libBindings.so), setup.py will install both libBindings.so (correctly) and libParent.so (incorrectly) to python's .../dist-packages/. .../dist-packages/ directory is not usually in $LD_LIBRARY_PATH, so the loader does not see libParent.so and I get an error like this:
ImportError: libParent.so.0.0.1: cannot open shared object file: No such file or directory
Contents of Bindings/CMakeLists.txtlook like this:
pybind11_add_module(Bindingsbindings.cpp)
target_link_libraries(BindingsPRIVATEParent)
Is there an elegant way to solve this?
If I am wrapping a shared library (e.g.
libParent.so), and generate python bindings (e.g.libBindings.so),setup.pywill install bothlibBindings.so(correctly) andlibParent.so(incorrectly) to python's.../dist-packages/..../dist-packages/directory is not usually in$LD_LIBRARY_PATH, so the loader does not seelibParent.soand I get an error like this:Contents of
Bindings/CMakeLists.txtlook like this:Is there an elegant way to solve this?