-
Notifications
You must be signed in to change notification settings - Fork 424
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
Fix hpp-fcl dependency #2617
base: devel
Are you sure you want to change the base?
Fix hpp-fcl dependency #2617
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hi,
This is a reminder message to assign an extra build label to this Pull Request if needed.
By default, this PR will be build with minimal build options (URDF support and Python bindings)
The possible extra labels are:
- build_collision (build Pinocchio with coal support)
- build_casadi (build Pinocchio with CasADi support)
- build_autodiff (build Pinocchio with CppAD support)
- build_codegen (build Pinocchio with CppADCodeGen support)
- build_extra (build Pinocchio with extra algorithms)
- build_mpfr (build Pinocchio with Boost.Multiprecision support)
- build_sdf (build Pinocchio with SDF parser)
- build_accelerate (build Pinocchio with APPLE Accelerate framework support)
- build_all (build Pinocchio with ALL the options stated above)
Thanks.
The Pinocchio development team.
If template instantiation is not enabled, configuration fails because the target pinocchio_default becomes an interface library. Instead of basing the fix on the parameter ENABLE_TEMPLATE_INSTANTIATION, we detect directly if pinocchio_default is an interface library.
b4292d8
to
0999a27
Compare
Hello @abussy-aldebaran, Thank's for the contribution ! I plan to change the way I manage ENABLE_TEMPLATE_INSTANTIATION.
It's more easy to create a SHARED library with the template instantiation sources and to link it to the original target when ENABLE_TEMPLATE_INSTANTIATION is activated. What do you think of this approach ? |
To begin with, I am a bit confused by the current behaviour. I checked the installed # Create imported target pinocchio::pinocchio_headers
add_library(pinocchio::pinocchio_headers INTERFACE IMPORTED)
set_target_properties(pinocchio::pinocchio_headers PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "BOOST_MPL_LIMIT_LIST_SIZE=30;BOOST_MPL_LIMIT_VECTOR_SIZE=30"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "Eigen3::Eigen;Boost::boost;Boost::serialization"
)
# Create imported target pinocchio::pinocchio_default
add_library(pinocchio::pinocchio_default INTERFACE IMPORTED)
set_target_properties(pinocchio::pinocchio_default PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "PINOCCHIO_WITH_HPP_FCL"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;\$<TARGET_PROPERTY:hpp-fcl::hpp-fcl,INTERFACE_INCLUDE_DIRECTORIES>"
INTERFACE_LINK_LIBRARIES "pinocchio::pinocchio_headers"
) Why the difference ? I totally agree with you, it would simplify the logic greatly. Maybe you could create a third target ?
As a bonus, an error would be raised if the user specifically depended on Feel free to find another name for |
Hello, Ok, some explanations (ETI = Explicit template instantiation):
As you can see, the library type change for pinocchio_default, pinocchio_collision, pinocchio_cppadcg, pinocchio_cppad and pinocchio_casadi when ENABLE_TEMPLATE_INSTANTIATION=OFF. To answer your first question, without ENABLE_TEMPLATE_INSTANTIATION, pinocchio_default look a lot alike pinocchio_headers. But this option is more for internal pinocchio development than for consumers. It allow to rebuild 1 unit test/benchmark without rebuilding the whole library. In As an example, we will have:
If ENABLE_TEMPLATE_INSTANTIATION=ON, then pinocchio_default_eti will be built and linked to pinocchio_default. I'm not happy with |
Do you mean target_link_libraries(pinocchio_default INTERFACE pinocchio_default_eti) or target_link_libraries(pinocchio_default_eti PUBLIC pinocchio_default) ? |
I mean |
If template instantiation is not enabled, configuration fails because the target
pinocchio_default
becomes an interface library. Instead of basing the fix on the parameterENABLE_TEMPLATE_INSTANTIATION
, we detect directly ifpinocchio_default
is an interface library.I assumed that
PRIVATE
dependency was necessary ifpinocchio_default
is not an interface library. If not, we can simply replacePUBLIC
withINTERFACE
in all cases.