PilzDE / pilz_robots

PILZ robot manipulator module PRBT 6 in ROS
https://wiki.ros.org/pilz_robots
52 stars 25 forks source link

prbt_ikfast_manipulator_plugin fails to compile on armhf #123

Closed jschleicher closed 5 years ago

jschleicher commented 5 years ago

Commit

70812c06340c8eb4c68b10a8275beec46aafb722

Steps to reproduce

In file included from /opt/ros/melodic/include/class_loader/class_loader_core.hpp:47:0,
                 from /opt/ros/melodic/include/class_loader/class_loader.hpp:46,
                 from /opt/ros/melodic/include/pluginlib/class_list_macros.hpp:40,
                 from /home/gsansone/catkin_ws/src/pilz_robots/prbt_ikfast_manipulator_plugin/src/prbt_manipulator_ikfast_moveit_plugin.cpp:1381:
/opt/ros/melodic/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = prbt_manipulator::IKFastKinematicsPlugin; B = kinematics::KinematicsBase]’:
/home/gsansone/catkin_ws/src/pilz_robots/prbt_ikfast_manipulator_plugin/src/prbt_manipulator_ikfast_moveit_plugin.cpp:1382:93:   required from here
/opt/ros/melodic/include/class_loader/meta_object.hpp:196:12: error: ‘new’ of type ‘prbt_manipulator::IKFastKinematicsPlugin’ with extended alignment 16 [-Werror=aligned-new=]
     return new C;
            ^~~~~
/opt/ros/melodic/include/class_loader/meta_object.hpp:196:12: note: uses ‘void* operator new(std::size_t)’, which does not have an alignment parameter
/opt/ros/melodic/include/class_loader/meta_object.hpp:196:12: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
$ gcc --version
gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04) 7.4.0

I do not understand, where the difference to the last (successful!) build on the official build farm is?!

Compiling with C++17 fixes the issue. prbt_ikfast_manipulator_plugin/CMakeLists.txt:15

add_compile_options(-std=c++17)
agutenkunst commented 5 years ago

Could we use a flag for armhf to enable c++17?

SansoneG commented 5 years ago

A little more system information to @jschleicher's comment:

$ lscpu
Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
CPU max MHz:         1200.0000
CPU min MHz:         600.0000
BogoMIPS:            38.40
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

Linux Kernel Version: 4.9.76-rt60-v7+

SansoneG commented 5 years ago

Setting up prbt_ikfast_manipulator_plugin/CMakeLists.txt like this also fixes the issue.

add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wno-unused-parameter)
add_compile_options(-Wno-unused-variable)
add_compile_options(-Werror)

if(CMAKE_COMPILER_IS_GNUCXX) 

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) 
set(CMAKE_CXX_FLAGS

"${CMAKE_CXX_FLAGS} -faligned-new")

endif() 
endif() 
jschleicher commented 5 years ago

@SansoneG thanks for testing. I've opened that as pull-request.