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

CppAd & Codegen test compile failures #2085

Closed
ryanelandt opened this issue Nov 14, 2023 · 3 comments
Closed

CppAd & Codegen test compile failures #2085

ryanelandt opened this issue Nov 14, 2023 · 3 comments
Assignees

Comments

@ryanelandt
Copy link

Pinocchio: 2.6.20
Boost: 1.74.0
Eigen: 3.4.0
Ubuntu: 22.04.3

Similar to #1999.

I can compile from source on master. When I modify the CMakeLists.txt file and change BUILD_WITH_AUTODIFF_SUPPORT and BUILD_WITH_CODEGEN_SUPPORT to ON I get the compile error below.

/usr/include/boost/math/constants/constants.hpp:265:3: error: no matching function for call to ‘boost::math::constants::detail::constant_pi<CppAD::AD<CppAD::cg::CG<double> > >::get(boost::math::constants::construction_traits<CppAD::AD<CppAD::cg::CG<double> >, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >::type)’
  265 |   BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884e+00, "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+00")
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ryane/dev_model/pinocchio/build/include/pinocchio/codegen/cppadcg.hpp:15,
                 from /home/ryane/dev_model/pinocchio/unittest/cppadcg-joint-configurations.cpp:5:
/home/ryane/dev_model/pinocchio/build/include/pinocchio/autodiff/cppad.hpp:35:34: note: candidate: ‘template<int N> static boost::math::constants::detail::constant_pi<CppAD::AD<Base> >::ADScalar boost::math::constants::detail::constant_pi<CppAD::AD<Base> >::get(const mpl_::int_<N>&) [with int N = N; Scalar = CppAD::cg::CG<double>]’
   35 |           static inline ADScalar get(const mpl::int_<N>& n)
      |                                  ^~~
/home/ryane/dev_model/pinocchio/build/include/pinocchio/autodiff/cppad.hpp:35:34: note:   template argument deduction/substitution failed:
In file included from /home/ryane/dev_model/pinocchio/build/include/pinocchio/math/fwd.hpp:10,
                 from /home/ryane/dev_model/pinocchio/build/include/pinocchio/codegen/cppadcg.hpp:10,
                 from /home/ryane/dev_model/pinocchio/unittest/cppadcg-joint-configurations.cpp:5:
/usr/include/boost/math/constants/constants.hpp:265:3: note:   ‘boost::math::constants::construction_traits<CppAD::AD<CppAD::cg::CG<double> >, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >::type’ {aka ‘boost::integral_constant<int, 0>’} is not derived from ‘const mpl_::int_<N>’
  265 |   BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884e+00, "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+00")
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ryane/dev_model/pinocchio/build/include/pinocchio/codegen/cppadcg.hpp:15,
                 from /home/ryane/dev_model/pinocchio/unittest/cppadcg-joint-configurations.cpp:5:
/home/ryane/dev_model/pinocchio/build/include/pinocchio/autodiff/cppad.hpp:41:34: note: candidate: ‘template<class T, T value> static boost::math::constants::detail::constant_pi<CppAD::AD<Base> >::ADScalar boost::math::constants::detail::constant_pi<CppAD::AD<Base> >::get(const std::integral_constant<T, value>&) [with T = T; T value = value; Scalar = CppAD::cg::CG<double>]’
   41 |           static inline ADScalar get(const std::integral_constant<T, value> &n)
      |                                  ^~~
/home/ryane/dev_model/pinocchio/build/include/pinocchio/autodiff/cppad.hpp:41:34: note:   template argument deduction/substitution failed:
In file included from /home/ryane/dev_model/pinocchio/build/include/pinocchio/math/fwd.hpp:10,
                 from /home/ryane/dev_model/pinocchio/build/include/pinocchio/codegen/cppadcg.hpp:10,
                 from /home/ryane/dev_model/pinocchio/unittest/cppadcg-joint-configurations.cpp:5:
/usr/include/boost/math/constants/constants.hpp:265:3: note:   ‘boost::math::constants::construction_traits<CppAD::AD<CppAD::cg::CG<double> >, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >::type’ {aka ‘boost::integral_constant<int, 0>’} is not derived from ‘const std::integral_constant<T, value>’
  265 |   BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884e+00, "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+00")
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
@ryanelandt
Copy link
Author

The fix in #2000 doesn't appear to be effective because of the renaming in Boost 1.77.

I'll test tomorrow to see if the following might work:

template <class AnyT>
static inline ADScalar get(const AnyT &n)
{
  return ADScalar(constant_pi<Scalar>::get(n));
}

@jorisv jorisv self-assigned this Nov 16, 2023
@ARBITER1994
Copy link

The fix in #2000 doesn't appear to be effective because of the renaming in Boost 1.77.

I'll test tomorrow to see if the following might work:

template <class AnyT>
static inline ADScalar get(const AnyT &n)
{
  return ADScalar(constant_pi<Scalar>::get(n));
}

Thank you so much.
I can successfully compile and pass the cppad/cppadcg-joint-configurations.cpp.
Pinocchio: 2.6.21
Boost: 1.74.0
Eigen: 3.3.0
Ubuntu: 22.04.3

@jorisv
Copy link
Contributor

jorisv commented Jan 24, 2024

Fixed in #2132

@jorisv jorisv closed this as completed Jan 24, 2024
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