Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyBind11 Error: Use of deleted function std:hash #29

Open
LikeSmith opened this issue Aug 31, 2024 · 7 comments
Open

PyBind11 Error: Use of deleted function std:hash #29

LikeSmith opened this issue Aug 31, 2024 · 7 comments

Comments

@LikeSmith
Copy link

When I build try to build this package as part of ros2 jazzy, I get the following errors:

--- stderr: python_orocos_kdl_vendor
In file included from /home/user/ros/jazzy/build/python_orocos_kdl_vendor/deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/PyKDL.h:28,
from /home/user/ros/jazzy/build/python_orocos_kdl_vendor/deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:28:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘struct pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Vector, KDL::Vector, pybind11::detail::undefined_t>’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:24: required from ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::class
KDL::Vector; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ~~~~~~~~^~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op_<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type_ = KDL::Vector; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:80:15: required from here
80 | vector.def(py::hash(py::self));
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: error: use of deleted function ‘std::hashKDL::Vector::hash()’
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14.2.1/string_view:50,
from /usr/include/c++/14.2.1/bits/basic_string.h:47,
from /usr/include/c++/14.2.1/string:54,
from /usr/include/c++/14.2.1/bits/locale_classes.h:40,
from /usr/include/c++/14.2.1/bits/ios_base.h:41,
from /usr/include/c++/14.2.1/ios:44,
from /usr/include/c++/14.2.1/ostream:40,
from /usr/include/c++/14.2.1/iostream:41,
from /usr/include/kdl/utilities/utility_io.h:27,
from /usr/include/kdl/frames_io.hpp:79,
from /home/user/ros/jazzy/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:27:
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: note: ‘std::hashKDL::Vector::hash()’ is implicitly deleted because the default definition would be ill-formed:
102 | struct hash : __hash_enum<_Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: no matching function for call to ‘std::__hash_enum<KDL::Vector, false>::__hash_enum()’
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate: ‘std::__hash_enum<_Tp, >::__hash_enum(std::__hash_enum<_Tp, >&&) [with _Tp = KDL::Vector; bool = false]’
83 | hash_enum(hash_enum&&);
| ^~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: ‘std::hash_enum<Tp, >::~hash_enum() [with Tp = KDL::Vector; bool = false]’ is private within this context
102 | struct hash : hash_enum<Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:84:7: note: declared private here
84 | ~hash_enum();
| ^
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::class
KDL::Vector; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class
<type
, options>& pybind11::class
<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Vector; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:80:15: required from here
80 | vector.def(py::hash(py::self));
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:28: error: ‘execute’ is not a member of ‘op’ {aka ‘pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Vector, KDL::Vector, pybind11::detail::undefined_t>’}
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ^~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘struct pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Wrench, KDL::Wrench, pybind11::detail::undefined_t>’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:24: required from ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::classKDL::Wrench; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ~~~~~~~~^~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class<type, options>& pybind11::class<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Wrench; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:167:15: required from here
167 | wrench.def(py::hash(py::self));
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: error: use of deleted function ‘std::hashKDL::Wrench::hash()’
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: note: ‘std::hashKDL::Wrench::hash()’ is implicitly deleted because the default definition would be ill-formed:
102 | struct hash : __hash_enum<_Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: no matching function for call to ‘std::__hash_enum<KDL::Wrench, false>::__hash_enum()’
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate: ‘std::__hash_enum<_Tp, >::__hash_enum(std::__hash_enum<_Tp, >&&) [with _Tp = KDL::Wrench; bool = false]’
83 | hash_enum(hash_enum&&);
| ^~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: ‘std::hash_enum<Tp, >::~hash_enum() [with Tp = KDL::Wrench; bool = false]’ is private within this context
102 | struct hash : hash_enum<Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:84:7: note: declared private here
84 | ~hash_enum();
| ^
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::class
KDL::Wrench; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class
<type
, options>& pybind11::class
<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Wrench; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:167:15: required from here
167 | wrench.def(py::hash(py::self));
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:28: error: ‘execute’ is not a member of ‘op’ {aka ‘pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Wrench, KDL::Wrench, pybind11::detail::undefined_t>’}
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ^~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘struct pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Twist, KDL::Twist, pybind11::detail::undefined_t>’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:24: required from ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::classKDL::Twist; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ~~~~~~~~^~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class<type, options>& pybind11::class<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Twist; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:242:14: required from here
242 | twist.def(py::hash(py::self));
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: error: use of deleted function ‘std::hashKDL::Twist::hash()’
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: note: ‘std::hashKDL::Twist::hash()’ is implicitly deleted because the default definition would be ill-formed:
102 | struct hash : __hash_enum<_Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: no matching function for call to ‘std::__hash_enum<KDL::Twist, false>::__hash_enum()’
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate: ‘std::__hash_enum<_Tp, >::__hash_enum(std::__hash_enum<_Tp, >&&) [with _Tp = KDL::Twist; bool = false]’
83 | hash_enum(hash_enum&&);
| ^~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: ‘std::hash_enum<Tp, >::~hash_enum() [with Tp = KDL::Twist; bool = false]’ is private within this context
102 | struct hash : hash_enum<Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:84:7: note: declared private here
84 | ~hash_enum();
| ^
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::class
KDL::Twist; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class
<type
, options>& pybind11::class
<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Twist; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:242:14: required from here
242 | twist.def(py::hash(py::self));
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:28: error: ‘execute’ is not a member of ‘op’ {aka ‘pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Twist, KDL::Twist, pybind11::detail::undefined_t>’}
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ^~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘struct pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Rotation, KDL::Rotation, pybind11::detail::undefined_t>’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:24: required from ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::classKDL::Rotation; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ~~~~~~~~^~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class<type, options>& pybind11::class<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Rotation; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:375:17: required from here
375 | rotation.def(py::hash(py::self));
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: error: use of deleted function ‘std::hashKDL::Rotation::hash()’
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: note: ‘std::hashKDL::Rotation::hash()’ is implicitly deleted because the default definition would be ill-formed:
102 | struct hash : __hash_enum<_Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: no matching function for call to ‘std::__hash_enum<KDL::Rotation, false>::__hash_enum()’
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate: ‘std::__hash_enum<_Tp, >::__hash_enum(std::__hash_enum<_Tp, >&&) [with _Tp = KDL::Rotation; bool = false]’
83 | hash_enum(hash_enum&&);
| ^~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: ‘std::hash_enum<Tp, >::~hash_enum() [with Tp = KDL::Rotation; bool = false]’ is private within this context
102 | struct hash : hash_enum<Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:84:7: note: declared private here
84 | ~hash_enum();
| ^
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::class
KDL::Rotation; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class
<type
, options>& pybind11::class
<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Rotation; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:375:17: required from here
375 | rotation.def(py::hash(py::self));
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:28: error: ‘execute’ is not a member of ‘op’ {aka ‘pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Rotation, KDL::Rotation, pybind11::detail::undefined_t>’}
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ^~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘struct pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Frame, KDL::Frame, pybind11::detail::undefined_t>’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:24: required from ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::classKDL::Frame; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ~~~~~~~~^~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class<type, options>& pybind11::class<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Frame; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:457:14: required from here
457 | frame.def(py::hash(py::self));
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: error: use of deleted function ‘std::hashKDL::Frame::hash()’
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: note: ‘std::hashKDL::Frame::hash()’ is implicitly deleted because the default definition would be ill-formed:
102 | struct hash : __hash_enum<_Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: no matching function for call to ‘std::__hash_enum<KDL::Frame, false>::__hash_enum()’
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate: ‘std::__hash_enum<_Tp, >::__hash_enum(std::__hash_enum<_Tp, >&&) [with _Tp = KDL::Frame; bool = false]’
83 | __hash_enum(__hash_enum&&);
| ^~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:83:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14.2.1/bits/functional_hash.h:102:12: error: ‘std::__hash_enum<_Tp, >::~hash_enum() [with Tp = KDL::Frame; bool = false]’ is private within this context
102 | struct hash : hash_enum<Tp>
| ^~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:84:7: note: declared private here
84 | ~hash_enum();
| ^
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:187:1: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
187 | PYBIND11_UNARY_OPERATOR(hash, hash, std::hash()(l))
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h: In instantiation of ‘void pybind11::detail::op
<id, ot, L, R>::execute(Class&, const Extra& ...) const [with Class = pybind11::class
KDL::Frame; Extra = {}; pybind11::detail::op_id id = pybind11::detail::op_hash; pybind11::detail::op_type ot = pybind11::detail::op_u; L = pybind11::detail::self_t; R = pybind11::detail::undefined_t]’:
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/pybind11.h:1600:19: required from ‘pybind11::class
<type
, options>& pybind11::class
<type, options>::def(const T&, const Extra& ...) [with T = pybind11::detail::op<pybind11::detail::op_hash, pybind11::detail::op_u, pybind11::detail::self_t, pybind11::detail::undefined_t>; Extra = {}; typename std::enable_if<T::op_enable_if_hook, int>::type = 0; type = KDL::Frame; options = {}]’
1600 | op.execute(*this, extra...);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/frames.cpp:457:14: required from here
457 | frame.def(py::hash(py::self));
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/user/ros/jazzy/install/pybind11_vendor/opt/pybind11_vendor/include/pybind11/operators.h:94:28: error: ‘execute’ is not a member of ‘op’ {aka ‘pybind11::detail::op_impl<pybind11::detail::op_hash, pybind11::detail::op_u, KDL::Frame, KDL::Frame, pybind11::detail::undefined_t>’}
94 | cl.def(op::name(), &op::execute, is_operator(), extra...);
| ^~~~~~~~~~~~
make[2]: *** [_deps/python_orocos_kdl-build/CMakeFiles/PyKDL.dir/build.make:90: _deps/python_orocos_kdl-build/CMakeFiles/PyKDL.dir/PyKDL/frames.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:152: _deps/python_orocos_kdl-build/CMakeFiles/PyKDL.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I have made sure to use the pybind11_vendor ros package, not the system install of pybind11 as mentioned in a previous issue, but still get this issue.

@clalancette
Copy link
Contributor

I have made sure to use the pybind11_vendor ros package, not the system install of pybind11 as mentioned in a previous issue, but still get this issue.

This is almost always the cause of this particular problem. Can you give more information on what platform you are compiling on, and the exact commands you used to pull down Jazzy and compile it?

@LikeSmith
Copy link
Author

Currently, I am building on archlinux. I install the ros2-arch-deps package, then call rosdep init, rosdep update, then vcs import --input https://raw.githubusercontent.com/ros2/ros2/jazzy/ros2.repos src finally, I call colcon build. The build goes normally until it gets to this package. I checked that it did build the pybind11_vendor package first, and I made sure the the system version of pybind11 is not installed. The files that the error reference are the pybind11_vendor packages that colcon previously built. I also tried in a clean docker container and get the same errors.

@changyp6
Copy link

I have met the same issue in Fedora 39 Linux with GCC 14

@changyp6
Copy link

Revert orocos_kinematics_dynamics back to version 1.5.1 can fix such issue.
Because std::hash was not added to PyKDL in version 1.5.1

@clalancette
Copy link
Contributor

Ah yeah, that actually triggers my memory of what the actual problem is.

And that is that the version of orocos_kinematics_dynamics and python_orocos_kinematics_dynamics have to match (either they both have to be from the system, or they both have to be built from the vendor package). My advice is to remove any packages related to orocos_kinematics_dynamics from the system, then try again. It should vendor build orocos_kinematics_dynamics first, then python_orocos_kinematics_dynamics should successfully build.

@LikeSmith
Copy link
Author

Turns out I had orocos-kdl from the AUR installed. I uninstalled it and it seems to be working now! Thanks!

@changyp6
Copy link

Ah yeah, that actually triggers my memory of what the actual problem is.

And that is that the version of orocos_kinematics_dynamics and python_orocos_kinematics_dynamics have to match (either they both have to be from the system, or they both have to be built from the vendor package). My advice is to remove any packages related to orocos_kinematics_dynamics from the system, then try again. It should vendor build orocos_kinematics_dynamics first, then python_orocos_kinematics_dynamics should successfully build.

Thanks for the info!!
My fedora has installed orocos-kdl-1.5.1, which triggered this issue.
After "dnf remove orocos-kdl{,-devel}", everything compiles !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants