kylc / ompl-wheels

Python wheel generation for OMPL
2 stars 2 forks source link

Failure to import some submodules #1

Open wbthomason opened 1 year ago

wbthomason commented 1 year ago

First off, thanks very much for this work! It's going to be excellent to have pip-installable OMPL.

I'm currently hitting an error while testing out the bindings. Specifically:

❯ python                   
Python 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ompl.tools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wil/.cache/pypoetry/virtualenvs/riposte-N67AXUAO-py3.11/lib/python3.11/site-packages/ompl/tools/__init__.py", line 2, in <module>
    from ompl.tools._tools import *
RuntimeError: extension class wrapper for base class std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > has not been created yet

(you can ignore the pypoetry bit; I've also validated this in a virtualenv created with venv)

This feels like a Boost library mismatch to me - my system has Boost 1.83 installed, and I believe you're compiling against 1.81(?), but - from the file list in the wheel - it looks like the correct Boost should be vendored? I also do not have a problem importing, e.g., ompl.base. I've also verified that I don't have a problem importing ompl.tools with OMPL Python bindings built natively on my machine.

wbthomason commented 1 year ago

I also just noticed that there's a different, but probably related error with ompl.util:

>> import ompl.util
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wil/.cache/pypoetry/virtualenvs/riposte-N67AXUAO-py3.11/lib/python3.11/site-packages/ompl/util/__init__.py", line 3, in <module>
    dll_loader('ompl', dirname(abspath(__file__)))
  File "/home/wil/.cache/pypoetry/virtualenvs/riposte-N67AXUAO-py3.11/lib/python3.11/site-packages/ompl/__init__.py", line 17, in dll_loader
    ctypes.CDLL(fname, ctypes.RTLD_GLOBAL)
  File "/usr/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libboost_serialization.so.1.78.0: cannot open shared object file: No such file or directory
wbthomason commented 1 year ago

See discussion on https://github.com/ompl/ompl/pull/1103 - the libboost error was due to a system installation of OMPL linked against an old Boost that the dll_loader finds first.