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

Fix ModelTpl::check() link #2624

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

abussy-aldebaran
Copy link
Contributor

When cross-compiling, I get a link error that ModelTpl::check() is undefined :

ld: src/libpinocchio_default.so.3.4.0: undefined reference to `pinocchio::ModelTpl<double, 0, pinocchio::JointCollectionDefaultTpl>::check(pinocchio::DataTpl<double, 0, pinocchio::JointCollectionDefaultTpl> const&) const'

Indeed the command objdump returns

❯ objdump -TC src/libpinocchio_default.so | grep check
0000000000000000      D  *UND*	0000000000000000  Base        pinocchio::ModelTpl<double, 0, pinocchio::JointCollectionDefaultTpl>::check(pinocchio::DataTpl<double, 0, pinocchio::JointCollectionDefaultTpl> const&) const

I don't know why I get this error when cross-compiling, and not with a native build. The fix I propose seems innocuous enough. It seems to be the right place to add it.

In my investigation, I added inline to the declaration and got a warning :

/.../include/pinocchio/multibody/model.hpp:517:17: warning: inline function 'bool pinocchio::ModelTpl<_Scalar, _Options, JointCollectionTpl>::check(const Data&) const [with _Scalar = double; int _Options = 0; JointCollectionTpl = pinocchio::JointCollectionDefaultTpl; Data = pinocchio::DataTpl<double, 0>]' used but never defined
  517 |     inline bool check(const Data & data) const;

when src/algorithm/contact-jacobian.cpp and src/algorithm/contact-cholesky.cpp are compiled.

Instead of fixing these specific files, I figured that a global fix was more foolproof.

@hrp2-14
Copy link

hrp2-14 commented Mar 20, 2025

Hi ! This project doesn't usually accept pull requests on the main branch.
If this wasn't intentionnal, you can change the base branch of this PR to devel
(No need to close it for that). Best, a bot.

Copy link

@github-actions github-actions bot left a 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.

@abussy-aldebaran abussy-aldebaran changed the title Topic/check data link Fix ModelTpl::check() link Mar 20, 2025
@abussy-aldebaran abussy-aldebaran changed the base branch from master to devel March 20, 2025 10:37
@jorisv
Copy link
Contributor

jorisv commented Mar 20, 2025

I put the build_all label because we can have tricky header issue with some custom scalar.

@pgraverdy pgraverdy added the pr status to review To review in weekly meeting label Mar 24, 2025
@jorisv jorisv force-pushed the topic/check-data-link branch from 674e4ca to a99f580 Compare March 24, 2025 14:35
@jorisv jorisv merged commit 786cf5d into stack-of-tasks:devel Mar 26, 2025
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build_all pr status to review To review in weekly meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants