stack-of-tasks / eigenpy

Efficient bindings between Numpy and Eigen using Boost.Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build error with Boost 1.78.0

brunopostle opened this issue · comments

I'm seeing an error building the 2.7.10 release on fedora 37, fedora 36 is ok.

Fedora 36 has:

  • boost 1.76.0
  • eigen3 3.4.0
  • gcc 12.1.1
  • python3 3.10.6
  • python3-numpy 1.22.0

Fedora 37 has:

  • boost 1.78.0
  • eigen3 3.4.0
  • gcc 12.1.1
  • python3 3.11.0~b5
  • python3-numpy 1.22.0

This is the build error:

[ 50%] Building CXX object CMakeFiles/eigenpy.dir/src/quaternion.cpp.o
/usr/bin/g++ -Deigenpy_EXPORTS -I/builddir/build/BUILD/eigenpy-2.7.10/redhat-linux-build -I/builddir/build/BUILD/eigenpy-2.7.10/include -isystem /builddir/build/BUILD/eigenpy-2.7.10/redhat-linux-build/include -isystem /usr/include/python3.11 -isystem /usr/include/eigen3 -isystem /usr/lib64/python3.11/site-packages/numpy/core/include -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -Wno-conversion -MD -MT CMakeFiles/eigenpy.dir/src/quaternion.cpp.o -MF CMakeFiles/eigenpy.dir/src/quaternion.cpp.o.d -o CMakeFiles/eigenpy.dir/src/quaternion.cpp.o -c /builddir/build/BUILD/eigenpy-2.7.10/src/quaternion.cpp
In file included from /usr/include/python3.11/Python.h:44,
                 from /usr/include/boost/python/detail/wrap_python.hpp:178,
                 from /usr/include/boost/python/detail/prefix.hpp:13,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/fwd.hpp:14,
                 from /builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/eigen-typedef.hpp:8,
                 from /builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/eigenpy.hpp:10,
                 from /builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/angle-axis.hpp:11,
                 from /builddir/build/BUILD/eigenpy-2.7.10/src/angle-axis.cpp:6:
/builddir/build/BUILD/eigenpy-2.7.10/src/angle-axis.cpp: In instantiation of 'static PyObject* boost::python::objects::make_instance_impl<Eigen::AngleAxis<double>, boost::python::objects::value_holder<Eigen::AngleAxis<double> >, Derived>::execute(Arg&) [with Arg = const boost::reference_wrapper<const Eigen::AngleAxis<double> >; Derived = boost::python::objects::make_instance<Eigen::AngleAxis<double>, boost::python::objects::value_holder<Eigen::AngleAxis<double> > >; PyObject = _object]':
/usr/include/boost/python/object/class_wrapper.hpp:29:37:   required from 'static PyObject* boost::python::objects::class_cref_wrapper<Src, MakeInstance>::convert(const Src&) [with Src = Eigen::AngleAxis<double>; MakeInstance = boost::python::objects::make_instance<Eigen::AngleAxis<double>, boost::python::objects::value_holder<Eigen::AngleAxis<double> > >; PyObject = _object]'
/usr/include/boost/python/converter/as_to_python_function.hpp:27:61:   required from 'static PyObject* boost::python::converter::as_to_python_function<T, ToPython>::convert(const void*) [with T = Eigen::AngleAxis<double>; ToPython = boost::python::objects::class_cref_wrapper<Eigen::AngleAxis<double>, boost::python::objects::make_instance<Eigen::AngleAxis<double>, boost::python::objects::value_holder<Eigen::AngleAxis<double> > > >; PyObject = _object]'
/usr/include/boost/python/to_python_converter.hpp:83:9:   required from 'boost::python::to_python_converter<T, Conversion, has_get_pytype>::to_python_converter() [with T = Eigen::AngleAxis<double>; Conversion = boost::python::objects::class_cref_wrapper<Eigen::AngleAxis<double>, boost::python::objects::make_instance<Eigen::AngleAxis<double>, boost::python::objects::value_holder<Eigen::AngleAxis<double> > > >; bool has_get_pytype = true]'
/usr/include/boost/python/object/class_wrapper.hpp:24:8:   required from 'static void boost::python::objects::class_metadata<T, X1, X2, X3>::maybe_register_class_to_python(T2*, mpl_::false_) [with T2 = Eigen::AngleAxis<double>; T = Eigen::AngleAxis<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified; mpl_::false_ = mpl_::bool_<false>]'
/usr/include/boost/python/object/class_metadata.hpp:227:55:   required from 'static void boost::python::objects::class_metadata<T, X1, X2, X3>::register_aux2(T2*, Callback) [with T2 = Eigen::AngleAxis<double>; Callback = boost::integral_constant<bool, false>; T = Eigen::AngleAxis<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]'
/usr/include/boost/python/object/class_metadata.hpp:218:38:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/boost/python/class.hpp:460:28:   required from 'void boost::python::class_<T, X1, X2, X3>::initialize(boost::python::no_init_t) [with W = Eigen::AngleAxis<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]'
/usr/include/boost/python/class.hpp:598:21:   required from 'boost::python::class_<T, X1, X2, X3>::class_(const char*, const char*, boost::python::no_init_t) [with W = Eigen::AngleAxis<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]'
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/angle-axis.hpp:126:9:   required from 'static void eigenpy::AngleAxisVisitor<AngleAxis>::expose() [with AngleAxis = Eigen::AngleAxis<double>]'
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/angle-axis.hpp:24:68:   required from 'static void eigenpy::call<Eigen::AngleAxis<_Scalar> >::expose() [with Scalar = double]'
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/expose.hpp:24:71:   required from 'void eigenpy::expose() [with T = Eigen::AngleAxis<double>]'
/builddir/build/BUILD/eigenpy-2.7.10/src/angle-axis.cpp:14:51:   required from here
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/memory.hpp:69:9: error: lvalue required as left operand of assignment
   69 |         Py_SIZE(instance) = holder_offset;                                     \
      |         ^~~~~~~
/builddir/build/BUILD/eigenpy-2.7.10/src/angle-axis.cpp:11:1: note: in expansion of macro 'EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION'
   11 | EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(Eigen::AngleAxisd)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/eigenpy.dir/build.make:317: CMakeFiles/eigenpy.dir/src/angle-axis.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/python3.11/Python.h:44,
                 from /usr/include/boost/python/detail/wrap_python.hpp:178,
                 from /usr/include/boost/python/detail/prefix.hpp:13,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/fwd.hpp:14,
                 from /builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/memory.hpp:9,
                 from /builddir/build/BUILD/eigenpy-2.7.10/src/quaternion.cpp:9:
/builddir/build/BUILD/eigenpy-2.7.10/src/quaternion.cpp: In instantiation of 'static PyObject* boost::python::objects::make_instance_impl<Eigen::Quaternion<double>, boost::python::objects::value_holder<Eigen::Quaternion<double> >, Derived>::execute(Arg&) [with Arg = const boost::reference_wrapper<const Eigen::Quaternion<double> >; Derived = boost::python::objects::make_instance<Eigen::Quaternion<double>, boost::python::objects::value_holder<Eigen::Quaternion<double> > >; PyObject = _object]':
/usr/include/boost/python/object/class_wrapper.hpp:29:37:   required from 'static PyObject* boost::python::objects::class_cref_wrapper<Src, MakeInstance>::convert(const Src&) [with Src = Eigen::Quaternion<double>; MakeInstance = boost::python::objects::make_instance<Eigen::Quaternion<double>, boost::python::objects::value_holder<Eigen::Quaternion<double> > >; PyObject = _object]'
/usr/include/boost/python/converter/as_to_python_function.hpp:27:61:   required from 'static PyObject* boost::python::converter::as_to_python_function<T, ToPython>::convert(const void*) [with T = Eigen::Quaternion<double>; ToPython = boost::python::objects::class_cref_wrapper<Eigen::Quaternion<double>, boost::python::objects::make_instance<Eigen::Quaternion<double>, boost::python::objects::value_holder<Eigen::Quaternion<double> > > >; PyObject = _object]'
/usr/include/boost/python/to_python_converter.hpp:83:9:   required from 'boost::python::to_python_converter<T, Conversion, has_get_pytype>::to_python_converter() [with T = Eigen::Quaternion<double>; Conversion = boost::python::objects::class_cref_wrapper<Eigen::Quaternion<double>, boost::python::objects::make_instance<Eigen::Quaternion<double>, boost::python::objects::value_holder<Eigen::Quaternion<double> > > >; bool has_get_pytype = true]'
/usr/include/boost/python/object/class_wrapper.hpp:24:8:   required from 'static void boost::python::objects::class_metadata<T, X1, X2, X3>::maybe_register_class_to_python(T2*, mpl_::false_) [with T2 = Eigen::Quaternion<double>; T = Eigen::Quaternion<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified; mpl_::false_ = mpl_::bool_<false>]'
/usr/include/boost/python/object/class_metadata.hpp:227:55:   required from 'static void boost::python::objects::class_metadata<T, X1, X2, X3>::register_aux2(T2*, Callback) [with T2 = Eigen::Quaternion<double>; Callback = boost::integral_constant<bool, false>; T = Eigen::Quaternion<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]'
/usr/include/boost/python/object/class_metadata.hpp:218:38:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/boost/python/class.hpp:460:28:   required from 'void boost::python::class_<T, X1, X2, X3>::initialize(boost::python::no_init_t) [with W = Eigen::Quaternion<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]'
/usr/include/boost/python/class.hpp:598:21:   required from 'boost::python::class_<T, X1, X2, X3>::class_(const char*, const char*, boost::python::no_init_t) [with W = Eigen::Quaternion<double>; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]'
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/quaternion.hpp:356:9:   required from 'static void eigenpy::QuaternionVisitor<QuaternionDerived>::expose() [with Quaternion = Eigen::Quaternion<double>]'
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/quaternion.hpp:78:70:   required from 'static void eigenpy::call<Eigen::Quaternion<_Scalar, _Options> >::expose() [with Scalar = double; int Options = 0]'
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/expose.hpp:24:71:   required from 'void eigenpy::expose() [with T = Eigen::Quaternion<double>]'
/builddir/build/BUILD/eigenpy-2.7.10/src/quaternion.cpp:16:53:   required from here
/builddir/build/BUILD/eigenpy-2.7.10/include/eigenpy/memory.hpp:69:9: error: lvalue required as left operand of assignment
   69 |         Py_SIZE(instance) = holder_offset;                                     \
      |         ^~~~~~~
/builddir/build/BUILD/eigenpy-2.7.10/src/quaternion.cpp:11:1: note: in expansion of macro 'EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION'
   11 | EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(Eigen::Quaterniond)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/eigenpy.dir/build.make:331: CMakeFiles/eigenpy.dir/src/quaternion.cpp.o] Error 1

Thanks @brunopostle for raison this issue.
Please see #304 for the fix.

Thanks, the 2.7.10 release + patch now builds with python3 3.11.0~b5 (and boost 1.78.0)