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

moveit_ros_planning fails to build with DCMAKE_BUILD_TYPE=Debug #2804

Closed
werner291 opened this issue Aug 10, 2021 · 3 comments · Fixed by #2819
Closed

moveit_ros_planning fails to build with DCMAKE_BUILD_TYPE=Debug #2804

werner291 opened this issue Aug 10, 2021 · 3 comments · Fixed by #2819
Labels

Comments

@werner291
Copy link
Contributor

Description

When building a ROS workspace with catkin build --cmake-args -DCMAKE_BUILD_TYPE=Debug, the build fails with a linker error on moveit_ros_planning.

I was hoping to debug MoveIt more easily, since I'll probably be making some modifications to it for a project I'm working on.

Your environment

  • ROS Distro: Noetic
  • OS Version: Ubuntu 20.04 LTS

Fresh catkin workspace, with moveit, moveit_visual_tools and moveit_resources cloned, all from default branch (master, probably).

Steps to reproduce

  • Create a directory containing an src subdir
  • Clone the three aforementioned repositories into it.
  • Run catkin build --cmake-args -DCMAKE_BUILD_TYPE=Debug

Expected behaviour

Buildl compiletes successfully, resulting in MoveIt with debug symbols.

Actual behaviour

moveit_ros_planning compiles, but fails linking with the following error:

Errors     << moveit_ros_planning:make /home/werner/catkin_test/logs/moveit_ros_planning/build.make.000.log                                                                                                                                                                   
/usr/bin/ld: CMakeFiles/moveit_compare_collision_checking_speed_fcl_bullet.dir/src/compare_collision_speed_checking_fcl_bullet.cpp.o: undefined reference to symbol 'ccd_vec3_origin'
/usr/bin/ld: /lib/x86_64-linux-gnu/libccd.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [planning_components_tools/CMakeFiles/moveit_compare_collision_checking_speed_fcl_bullet.dir/build.make:247: /home/werner/catkin_test/devel/.private/moveit_ros_planning/lib/moveit_ros_planning/moveit_compare_collision_checking_speed_fcl_bullet] Error 1
make[1]: *** [CMakeFiles/Makefile2:3192: planning_components_tools/CMakeFiles/moveit_compare_collision_checking_speed_fcl_bullet.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
cd /home/werner/catkin_test/build/moveit_ros_planning; catkin build --get-env moveit_ros_planning | catkin env -si  /usr/bin/make --jobserver-auth=3,4; cd -

Backtrace or Console output

-------------------------------------------------------------
Profile:                     default
Extending:             [env] /opt/ros/noetic
Workspace:                   /home/werner/catkin_test
-------------------------------------------------------------
Build Space:        [exists] /home/werner/catkin_test/build
Devel Space:        [exists] /home/werner/catkin_test/devel
Install Space:      [unused] /home/werner/catkin_test/install
Log Space:         [missing] /home/werner/catkin_test/logs
Source Space:       [exists] /home/werner/catkin_test/src
DESTDIR:            [unused] None
-------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
-------------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=Debug
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
-------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
-------------------------------------------------------------
Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.
-------------------------------------------------------------
[build] Found '40' packages in 0.0 seconds.                                                                                                                                                                                                                                   
[build] Updating package table.                                                                                                                                                                                                                                               
Starting  >>> catkin_tools_prebuild                                                                                                                                                                                                                                           
Finished  <<< catkin_tools_prebuild                                          [ 1.3 seconds ]                                                                                                                                                                                  
Starting  >>> moveit_resources_fanuc_description                                                                                                                                                                                                                              
Starting  >>> moveit_resources_panda_description                                                                                                                                                                                                                              
Starting  >>> moveit_resources_pr2_description                                                                                                                                                                                                                                
Starting  >>> moveit_resources_prbt_support                                                                                                                                                                                                                                   
Finished  <<< moveit_resources_panda_description                             [ 1.7 seconds ]                                                                                                                                                                                  
Starting  >>> moveit_resources_panda_moveit_config                                                                                                                                                                                                                            
Finished  <<< moveit_resources_pr2_description                               [ 1.7 seconds ]                                                                                                                                                                                  
Finished  <<< moveit_resources_fanuc_description                             [ 1.7 seconds ]                                                                                                                                                                                  
Starting  >>> moveit_resources_fanuc_moveit_config                                                                                                                                                                                                                            
Finished  <<< moveit_resources_prbt_support                                  [ 1.8 seconds ]                                                                                                                                                                                  
Finished  <<< moveit_resources_panda_moveit_config                           [ 1.5 seconds ]                                                                                                                                                                                  
Starting  >>> moveit_core                                                                                                                                                                                                                                                     
Finished  <<< moveit_resources_fanuc_moveit_config                           [ 1.5 seconds ]                                                                                                                                                                                  
Starting  >>> moveit_resources                                                                                                                                                                                                                                                
Finished  <<< moveit_resources                                               [ 1.2 seconds ]                                                                                                                                                                                  
Finished  <<< moveit_core                                                    [ 2 minutes and 54.5 seconds ]                                                                                                                                                                   
Starting  >>> chomp_motion_planner                                                                                                                                                                                                                                            
Starting  >>> moveit_resources_prbt_ikfast_manipulator_plugin                                                                                                                                                                                                                 
Starting  >>> moveit_ros_occupancy_map_monitor                                                                                                                                                                                                                                
Starting  >>> moveit_simple_controller_manager                                                                                                                                                                                                                                
Finished  <<< moveit_simple_controller_manager                               [ 16.4 seconds ]                                                                                                                                                                                 
Starting  >>> moveit_ros_control_interface                                                                                                                                                                                                                                    
Finished  <<< moveit_resources_prbt_ikfast_manipulator_plugin                [ 22.5 seconds ]                                                                                                                                                                                 
Starting  >>> moveit_resources_prbt_moveit_config                                                                                                                                                                                                                             
Finished  <<< moveit_resources_prbt_moveit_config                            [ 2.2 seconds ]                                                                                                                                                                                  
Starting  >>> moveit_resources_prbt_pg70_support                                                                                                                                                                                                                              
Finished  <<< moveit_resources_prbt_pg70_support                             [ 2.2 seconds ]                                                                                                                                                                                  
Finished  <<< moveit_ros_control_interface                                   [ 12.1 seconds ]                                                                                                                                                                                 
Finished  <<< moveit_ros_occupancy_map_monitor                               [ 29.3 seconds ]                                                                                                                                                                                 
Starting  >>> moveit_ros_planning                                                                                                                                                                                                                                             
Finished  <<< chomp_motion_planner                                           [ 31.0 seconds ]                                                                                                                                                                                 
Starting  >>> moveit_chomp_optimizer_adapter                                                                                                                                                                                                                                  
Finished  <<< moveit_chomp_optimizer_adapter                                 [ 22.2 seconds ]                                                                                                                                                                                 
______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Errors     << moveit_ros_planning:make /home/werner/catkin_test/logs/moveit_ros_planning/build.make.000.log                                                                                                                                                                   
/usr/bin/ld: CMakeFiles/moveit_compare_collision_checking_speed_fcl_bullet.dir/src/compare_collision_speed_checking_fcl_bullet.cpp.o: undefined reference to symbol 'ccd_vec3_origin'
/usr/bin/ld: /lib/x86_64-linux-gnu/libccd.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [planning_components_tools/CMakeFiles/moveit_compare_collision_checking_speed_fcl_bullet.dir/build.make:247: /home/werner/catkin_test/devel/.private/moveit_ros_planning/lib/moveit_ros_planning/moveit_compare_collision_checking_speed_fcl_bullet] Error 1
make[1]: *** [CMakeFiles/Makefile2:3192: planning_components_tools/CMakeFiles/moveit_compare_collision_checking_speed_fcl_bullet.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
cd /home/werner/catkin_test/build/moveit_ros_planning; catkin build --get-env moveit_ros_planning | catkin env -si  /usr/bin/make --jobserver-auth=3,4; cd -
..............................................................................................................................................................................................................................................................................
Failed     << moveit_ros_planning:make                                       [ Exited with code 2 ]                                                                                                                                                                           
Failed    <<< moveit_ros_planning                                            [ 1 minute and 34.0 seconds ]                                                                                                                                                                    
Abandoned <<< moveit                                                         [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_planners                                                [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_plugins                                                 [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_commander                                               [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros                                                     [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_fake_controller_manager                                 [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_kinematics                                              [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_planners_ompl                                           [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_move_group                                          [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_manipulation                                        [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_perception                                          [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_robot_interaction                                   [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_warehouse                                           [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_benchmarks                                          [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_planning_interface                                  [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_planners_chomp                                          [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_ros_visualization                                       [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_runtime                                                 [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_servo                                                   [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_setup_assistant                                         [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< moveit_visual_tools                                            [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< pilz_industrial_motion_planner_testutils                       [ Unrelated job failed ]                                                                                                                                                                         
Abandoned <<< pilz_industrial_motion_planner                                 [ Unrelated job failed ]                                                                                                                                                                         
[build] Summary: 17 of 41 packages succeeded.                                                                                                                                                                                                                                 
[build]   Ignored:   None.                                                                                                                                                                                                                                                    
[build]   Warnings:  None.                                                                                                                                                                                                                                                    
[build]   Abandoned: 23 packages were abandoned.                                                                                                                                                                                                                              
[build]   Failed:    1 packages failed.                                                                                                                                                                                                                                       
[build] Runtime: 5 minutes and 2.9 seconds total.                                                                                                                                                                                                                             
[build] Note: Workspace packages have changed, please re-source setup files to use them.
@werner291 werner291 added the bug label Aug 10, 2021
@v4hn
Copy link
Contributor

v4hn commented Aug 11, 2021

Interesting. I have never had that issue and I develop in DEBUG builds, but I don't run on stock ubuntu. I can reproduce this in a docker container on Ubuntu 20.04.
It seems the libraries detected here do not include libccd, which is a build-export dependency of moveit_core/collision_detection_fcl.

I can't look into this any further now, but I'm wondering why the moveit_core package compiles successfully then.

@mintar
Copy link
Contributor

mintar commented Aug 17, 2021

I've dug a bit deeper into this issue.

I can confirm that this only happens when using Debug or RelWithDebugInfo builds, not Release. I've used git bisect to track down the commit that triggered this bug: 93c3f63 by @wolfv.

Specifically, that commit introduced the following lines:

https://github.com/ros-planning/moveit/blob/93c3f637b088000e5508f8efc6ce3b01e528e383/moveit_core/CMakeLists.txt#L45-L49

So after 93c3f63, we first try to use find_package to find fcl and only fall back to PkgConfig if that fails. The old behavior was to always use PkgConfig.

However, there is a bug in fcl. The find_package implementation is missing the dependencies:

find_package: FCL_LIBRARIES=fcl
PkgConfig:    FCL_LIBRARIES=/opt/ros/noetic/lib/x86_64-linux-gnu/libfcl.so;/usr/lib/x86_64-linux-gnu/libccd.so;/usr/lib/x86_64-linux-gnu/libm.so;/opt/ros/noetic/lib/liboctomap.so;/opt/ros/noetic/lib/liboctomath.so

I'll open a pull request over at the fcl repo and report back here.

mintar added a commit to mintar/fcl that referenced this issue Aug 17, 2021
The find_package CMake macro was missing the CCD and Octomap libraries
in the FCL_LIBRARIES variable, which led to linker errors in dependent
projects, for example:

moveit/moveit#2804 (comment)

The old PkgConfig implementation properly adds all external
dependencies, but the find_package implementation is missing some:

find_package: FCL_LIBRARIES=fcl
PkgConfig:    FCL_LIBRARIES=/opt/ros/noetic/lib/x86_64-linux-gnu/libfcl.so;/usr/lib/x86_64-linux-gnu/libccd.so;/usr/lib/x86_64-linux-gnu/libm.so;/opt/ros/noetic/lib/liboctomap.so;/opt/ros/noetic/lib/liboctomath.so

This commit will result in the following FCL_LIBRARIES:
FCL_LIBRARIES=fcl;/usr/lib/x86_64-linux-gnu/libccd.so;/usr/lib/x86_64-linux-gnu/libm.so;/opt/ros/noetic/lib/liboctomap.so;/opt/ros/noetic/lib/liboctomath.so
@v4hn
Copy link
Contributor

v4hn commented Aug 17, 2021 via email

jspricke added a commit to jspricke/moveit that referenced this issue Aug 17, 2021
jspricke added a commit to jspricke/moveit that referenced this issue Aug 17, 2021
jspricke added a commit to jspricke/moveit that referenced this issue Aug 17, 2021
v4hn pushed a commit that referenced this issue Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants