norlab-ulaval / libpointmatcher

An Iterative Closest Point (ICP) library for 2D and 3D mapping in Robotics
BSD 3-Clause "New" or "Revised" License
1.58k stars 542 forks source link

Python bindings build fail on Ubuntu 24.04 #564

Open boxanm opened 1 month ago

boxanm commented 1 month ago

This is a preliminary issue that needs to be resolved before we add support for Ubuntu 24.

Libpointmatcher relies on pybind 2.5.0, which was released over 4 years ago. In Ubuntu 24, this dependency started to break. There are two issues I have encountered so far:

  1. pybind 2.5.0 depends on distutils, which was marked deprecated in Python3.10 and was removed in Python3.12 that comes with Ubuntu 24.
  2. After installing the dependency manually (it is part of setuptools), building pybind 2.5.0 fails in multiple places; see some examples below
    /libraries/pybind11/include/pybind11/cast.h: In function 'std::string pybind11::detail::error_string()':
    /libraries/pybind11/include/pybind11/cast.h:446:36: error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}
    446 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
      |                                    ^~
    /libraries/pybind11/include/pybind11/cast.h:446:75: error: expected primary-expression before '>' token
    446 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
      |                                                                           ^

    Overall, I think now would be a good time to investigate and migrate to newer releases of pybind.