Hello,
unfortunately, pinocchio doesn't compile anymore using gcc. It used to, but currently I get always a segmentation fault during compilation process:
[ 20%] Building CXX object bindings/python/CMakeFiles/pinocchio_pywrap.dir/algorithm/expose-kinematics-derivatives.cpp.o
cd /home/freemotion/freemotion/src/external/pinocchio/build/bindings/python && /usr/bin/c++ -DBOOST_MPL_LIMIT_LIST_SIZE=30 -DBOOST_MPL_LIMIT_VECTOR_SIZE=30 -DPINOCCHIO_WITH_URDFDOM -Dpinocchio_pywrap_EXPORTS -I/home/freemotion/freemotion/src/external/pinocchio/build -I/home/freemotion/freemotion/src/external/pinocchio/build/include -I/home/freemotion/freemotion/src/external/pinocchio/include -isystem /usr/include/python2.7 -isystem /usr/include/eigen3 -isystem /usr/lib/python2.7/dist-packages/numpy/core/include -isystem /opt/ros/melodic/include -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion -O3 -DNDEBUG -fPIC -Wno-conversion -Wno-comment -std=gnu++11 -o CMakeFiles/pinocchio_pywrap.dir/algorithm/expose-kinematics-derivatives.cpp.o -c /home/freemotion/freemotion/src/external/pinocchio/bindings/python/algorithm/expose-kinematics-derivatives.cpp
In file included from /usr/include/eigen3/Eigen/Core:473:0,
from /home/freemotion/freemotion/src/external/pinocchio/build/include/pinocchio/utils/cast.hpp:8,
from /home/freemotion/freemotion/src/external/pinocchio/build/include/pinocchio/fwd.hpp:23,
from /home/freemotion/freemotion/src/external/pinocchio/build/include/pinocchio/bindings/python/fwd.hpp:9,
from /home/freemotion/freemotion/src/external/pinocchio/build/include/pinocchio/bindings/python/algorithm/algorithms.hpp:8,
from /home/freemotion/freemotion/src/external/pinocchio/bindings/python/algorithm/expose-joints.cpp:5:
/usr/include/eigen3/Eigen/src/Core/ProductEvaluators.h: In instantiation of ‘const CoeffReturnType Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, 1>, ProductTag, Eigen::DenseShape, Eigen::DenseShape>::coeff(Eigen::Index) const [with Lhs = Eigen::Transpose<Eigen::Matrix<double, 3, 3> >; Rhs = Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<double, double>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false> >; int ProductTag = 3; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, 1>::Rhs>::Scalar = double; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, 1>::Lhs>::Scalar = double; Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, 1>, ProductTag, Eigen::DenseShape, Eigen::DenseShape>::CoeffReturnType = double; Eigen::Index = long int]’:
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:637:5: required from ‘void Eigen::internal::generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, Version>::assignCoeff(Eigen::Index) [with DstEvaluatorTypeT = Eigen::internal::evaluator<Eigen::Matrix<double, 3, 1> >; SrcEvaluatorTypeT = Eigen::internal::evaluator<Eigen::Product<Eigen::Transpose<Eigen::Matrix<double, 3, 3> >, Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<double, double>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false> >, 1> >; Functor = Eigen::internal::assign_op<double, double>; int Version = 0; Eigen::Index = long int]’
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:242:5: required from ‘static void Eigen::internal::copy_using_evaluator_LinearTraversal_CompleteUnrolling<Kernel, Index, Stop>::run(Kernel&) [with Kernel = Eigen::internal::generic_dense_assignment_kernel<Eigen::internal::evaluator<Eigen::Matrix<double, 3, 1> >, Eigen::internal::evaluator<Eigen::Product<Eigen::Transpose<Eigen::Matrix<double, 3, 3> >, Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<double, double>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false> >, 1> >, Eigen::internal::assign_op<double, double>, 0>; int Index = 0; int Stop = 3]’
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:507:106: required from ‘static void Eigen::internal::dense_assignment_loop<Kernel, 1, 2>::run(Kernel&) [with Kernel = Eigen::internal::generic_dense_assignment_kernel<Eigen::internal::evaluator<Eigen::Matrix<double, 3, 1> >, Eigen::internal::evaluator<Eigen::Product<Eigen::Transpose<Eigen::Matrix<double, 3, 3> >, Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<double, double>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false> >, 1> >, Eigen::internal::assign_op<double, double>, 0>]’
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:741:37: required from ‘void Eigen::internal::call_dense_assignment_loop(DstXprType&, const SrcXprType&, const Functor&) [with DstXprType = Eigen::Matrix<double, 3, 1>; SrcXprType = Eigen::Product<Eigen::Transpose<Eigen::Matrix<double, 3, 3> >, Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<double, double>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false> >, 1>; Functor = Eigen::internal::assign_op<double, double>]’
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:879:31: required from ‘static void Eigen::internal::Assignment<DstXprType, SrcXprType, Functor, Eigen::internal::Dense2Dense, Weak>::run(DstXprType&, const SrcXprType&, const Functor&) [with DstXprType = Eigen::Matrix<double, 3, 1>; SrcXprType = Eigen::Product<Eigen::Transpose<Eigen::Matrix<double, 3, 3> >, Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<double, double>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false>, const Eigen::Block<const Eigen::Block<const Eigen::Matrix<double, -1, 1>, 7, 1, false>, 3, 1, false> >, 1>; Functor = Eigen::internal::assign_op<double, double>; Weak = void]’
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:836:49: [ skipping 19 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/boost/variant/variant.hpp:2441:52: required from ‘typename Visitor::result_type boost::variant<T0, TN>::apply_visitor(Visitor&) const [with Visitor = pinocchio::fusion::JointUnaryVisitorBase<pinocchio::dDifferenceStep<pinocchio::LieGroupMap, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, -1> >, void>::InternalVisitorModel<boost::fusion::vector<const Eigen::Matrix<double, -1, 1, 0, -1, 1>&, const Eigen::Matrix<double, -1, 1, 0, -1, 1>&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&, const pinocchio::ArgumentPosition&>, void>; T0_ = pinocchio::JointModelRevoluteTpl<double, 0, 0>; TN = {pinocchio::JointModelRevoluteTpl<double, 0, 1>, pinocchio::JointModelRevoluteTpl<double, 0, 2>, pinocchio::JointModelMimic<pinocchio::JointModelRevoluteTpl<double, 0, 0> >, pinocchio::JointModelMimic<pinocchio::JointModelRevoluteTpl<double, 0, 1> >, pinocchio::JointModelMimic<pinocchio::JointModelRevoluteTpl<double, 0, 2> >, pinocchio::JointModelFreeFlyerTpl<double, 0>, pinocchio::JointModelPlanarTpl<double, 0>, pinocchio::JointModelRevoluteUnalignedTpl<double, 0>, pinocchio::JointModelSphericalTpl<double, 0>, pinocchio::JointModelSphericalZYXTpl<double, 0>, pinocchio::JointModelPrismaticTpl<double, 0, 0>, pinocchio::JointModelPrismaticTpl<double, 0, 1>, pinocchio::JointModelPrismaticTpl<double, 0, 2>, pinocchio::JointModelPrismaticUnalignedTpl<double, 0>, pinocchio::JointModelTranslationTpl<double, 0>, pinocchio::JointModelRevoluteUnboundedTpl<double, 0, 0>, pinocchio::JointModelRevoluteUnboundedTpl<double, 0, 1>, pinocchio::JointModelRevoluteUnboundedTpl<double, 0, 2>, pinocchio::JointModelRevoluteUnboundedUnalignedTpl<double, 0>, boost::recursive_wrapper<pinocchio::JointModelCompositeTpl<double, 0, pinocchio::JointCollectionDefaultTpl> >}; typename Visitor::result_type = void]’
/usr/include/boost/variant/detail/apply_visitor_unary.hpp:70:43: required from ‘typename Visitor::result_type boost::apply_visitor(Visitor&, Visitable&) [with Visitor = pinocchio::fusion::JointUnaryVisitorBase<pinocchio::dDifferenceStep<pinocchio::LieGroupMap, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, -1> >, void>::InternalVisitorModel<boost::fusion::vector<const Eigen::Matrix<double, -1, 1, 0, -1, 1>&, const Eigen::Matrix<double, -1, 1, 0, -1, 1>&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&, const pinocchio::ArgumentPosition&>, void>; Visitable = const pinocchio::JointModelTpl<double>; typename Visitor::result_type = void]’
/home/freemotion/freemotion/src/external/pinocchio/build/include/pinocchio/multibody/visitor/joint-unary-visitor.hpp:69:36: required from ‘static ReturnType pinocchio::fusion::JointUnaryVisitorBase<JointVisitorDerived, ReturnType>::run(const pinocchio::JointModelTpl<Scalar, Options, JointCollectionTpl>&, ArgsTmp) [with Scalar = double; int Options = 0; JointCollectionTpl = pinocchio::JointCollectionDefaultTpl; ArgsTmp = boost::fusion::vector<const Eigen::Matrix<double, -1, 1, 0, -1, 1>&, const Eigen::Matrix<double, -1, 1, 0, -1, 1>&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&, const pinocchio::ArgumentPosition&>; JointVisitorDerived = pinocchio::dDifferenceStep<pinocchio::LieGroupMap, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, -1> >; ReturnType = void]’
/home/freemotion/freemotion/src/external/pinocchio/build/include/pinocchio/algorithm/joint-configuration.hxx:241:16: required from ‘void pinocchio::dDifference(const pinocchio::ModelTpl<Scalar, Options, JointCollectionTpl>&, const Eigen::MatrixBase<MatRet>&, const Eigen::MatrixBase<TangentVectorType>&, const Eigen::MatrixBase<ReturnType>&, pinocchio::ArgumentPosition) [with LieGroup_t = pinocchio::LieGroupMap; Scalar = double; int Options = 0; JointCollectionTpl = pinocchio::JointCollectionDefaultTpl; ConfigVector1 = Eigen::Matrix<double, -1, 1>; ConfigVector2 = Eigen::Matrix<double, -1, 1>; JacobianMatrix = Eigen::Matrix<double, -1, -1>]’
/home/freemotion/freemotion/src/external/pinocchio/build/include/pinocchio/algorithm/joint-configuration.hpp:512:5: required from ‘void pinocchio::dDifference(const pinocchio::ModelTpl<Scalar, Options, JointCollectionTpl>&, const Eigen::MatrixBase<Matrix3Like>&, const Eigen::MatrixBase<MatRet>&, const Eigen::MatrixBase<TangentVectorType>&, pinocchio::ArgumentPosition) [with Scalar = double; int Options = 0; JointCollectionTpl = pinocchio::JointCollectionDefaultTpl; ConfigVector1 = Eigen::Matrix<double, -1, 1>; ConfigVector2 = Eigen::Matrix<double, -1, 1>; JacobianMatrix = Eigen::Matrix<double, -1, -1>]’
/home/freemotion/freemotion/src/external/pinocchio/bindings/python/algorithm/expose-joints.cpp:60:38: required from here
/usr/include/eigen3/Eigen/src/Core/ProductEvaluators.h:564:3: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
It doesnt matter if I'm compiling multi-threaded or single-threaded. I've also checked that the system is not running out of memory, which easily happens to me when compiling pinocchio.
Here are the system specs:
pinocchio v2.6.0
Ubuntu 18.04.5
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
cmake version 3.10.2
AMD Ryzen 5950X
32GB RAM
I'm looking forward for any suggestion how to solve this issue.
Best regards
Hi,
It seems the error is related to Eigen. Which version are you using?
Are you compiling Pinocchio with parallel make option on?
To help us, it would be nice to provide the commit id and even better, a docker image. Could you do that please?
The system uses Eigen 3.3.4. Unfortunately I'm not familiar how to create Docker images properly yet.
It's a newly installed Ubuntu machine running ROS Melodic.
@nim65s could you check?
Hi @astumpf ,
I just tried to compile and install eigenpy 2.6.3, hpp-fcl 1.7.2 & pinocchio 2.6.0 on ubuntu 18.04 with gcc 7.5.0 and cmake 3.10.2 in a very standard way, and it works for me: I was not able to reproduce your issue.
I did this on a i9-9900 with 64GB RAM, but I sincerely doubt that gcc would segfault on your AMD CPU while it would work on my Intel one (I ordered a 5950X some time ago, it is on its way, so I should be able to definitely ensure this in a week or 2 if necessary)
So I guess this issue either comes from ROS, or from something else on your computer.
Here is the Dockerfile I used: https://github.com/Gepetto/gepetto-utils/blob/master/docker/pinocchio/Dockerfile.nolts
Could you provide the steps you used to try to build this with ROS, so that I can double-check this part ?
Update: After multiple tries, it managed to compile somehow.. I don't know why. But I guess after a clean, I would run in the same issue again.
On this brand new machine I've just installed Ubuntu 18.04.5 and ROS Melodic. Then I setup a standard catkin workspace, checkout your repo in the src folder and run catkin build (-j1 for single thread):
catkin build -j1 --mem-limit 10G -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_CASADI_SUPPORT=OFF
During each try, the compile sometimes progresses further. At some point It even reaches 100%. But in between the compiler crashes with sefaults.
I would suggest using clang as the main compiler. It is more efficient and uses less RAM.
Have you tried this in combination with a ROS workspace? Can you mix up gcc and clang libraries?
Have you tried this in combination with a ROS workspace? Can you mix up gcc and clang libraries?
I am compiling Pinocchio in catkin workspaces and it works. I've recently switched to clang so cannot confirm if it still does with gcc & a catkin workspace. We've been successful compiling using 2 cores with 16 GB in a catkin workspace using clang.
We are packaging Pinocchio for Melodic & Noetic on the ROS buildfarm (ros-melodic/noetic-pinocchio) which runs gcc, so it should still work, even with limited system memory (the buildfarm has <8 GB memory).
When using a catkin workspace, make sure to manually turn off unit tests and benchmarks since these take the most memory. You can either set it via catkin config --cmake-args -DBUILD_UNIT_TESTS=OFF -DBUILD_BENCHMARK=OFF or edit the CMakeLists.
Hey, I guess I figured it out as I just experienced the same compile errors in other projects. It seems, the real problem was that it is a brand new machine and the RAM XMP Profile was not working properly. Turning off XMP solved this issues. Memtest confirmed that the RAM was not working properly in XMP mode.
I've also added -DBUILD_UNIT_TESTS=OFF -DBUILD_BENCHMARK=OFF, thanks for this suggestion!
Anyway, thanks for your very quick help!