symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.44k stars 147 forks source link

Bump default pybind to 2.9.2 #168

Closed zhiqwang closed 2 years ago

zhiqwang commented 2 years ago

Hi symforce team,

Seems that pybind 2.8.1 cannot be used for symforce project, we'll meet compatibility issues such as belows if we use pybind 2.8.1, so I bump pybind to 2.9.2 in this PR

    /home/zhiqiang/coding/symforce/build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/include/pybind11/eigen.h: In member function ‘bool pybind11::detail::type_caster<Type, typename std::enable_if<decltype (pybind11::detail::is_template_base_of_impl<Eigen::SparseMatrixBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, void>::type>::load(pybind11::handle, bool)’:
    /home/zhiqiang/coding/symforce/build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/include/pybind11/eigen.h:576:24: error: ‘MappedSparseMatrix’ is not a member of ‘Eigen’; did you mean ‘SparseMatrix’?
      576 |         value = Eigen::MappedSparseMatrix<Scalar,
          |                        ^~~~~~~~~~~~~~~~~~
          |                        SparseMatrix
    /home/zhiqiang/coding/symforce/build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/include/pybind11/eigen.h:576:49: error: expected primary-expression before ‘,’ token
      576 |         value = Eigen::MappedSparseMatrix<Scalar,
          |                                                 ^
    /home/zhiqiang/coding/symforce/build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/include/pybind11/eigen.h:578:55: error: expected primary-expression before ‘>’ token
      578 |                                           StorageIndex>(
          |                                                       ^
aaron-skydio commented 2 years ago

Specifically, this is an incompatibility between pybind 2.8.1 and Eigen trunk - Eigen removed MappedSparseMatrix here 6 months ago, and this is not present yet in any released version of Eigen (tags here). Pybind fixed this here. Assuming nothing else breaks though I don't see why we can't update to pybind 2.9.2