Problem building with non-installed dependencies

asked 2018-04-30 13:07:17 -0500

Ian Gough gravatar image

updated 2018-05-01 06:41:15 -0500

I am making a custom ROS package in C++. The problem I am having is that the build of my node fails, because dpkg-shlibdeps, which gets run during

$ fakeroot debian/rules binary

is failing to find shared objects that are not installed yet. These non-ROS libs have just been built in Jenkins which is then followed by building of non-ROS components which use the libraries and then building of the ROS components.

dh_shlibdeps -l/mnt/build/workspace/RobotCore/catkin_ws/src/t6_hardware/debian/ros-kinetic-t6-hardware//opt/ros/kinetic/lib/
    dpkg-shlibdeps -Tdebian/ros-kinetic-t6-hardware.substvars -l/mnt/build/workspace/RobotCore/catkin_ws/src/t6_hardware/debian/ros-kinetic-t6-hardware//opt/ros/kinetic/lib/ debian/ros-kinetic-t6-hardware/opt/ros/kinetic/lib/t6_hardware/t6_hardware_node
dpkg-shlibdeps: error: couldn't find library libicorutility.so.1 needed by debian/ros-kinetic-t6-hardware/opt/ros/kinetic/lib/t6_hardware/t6_hardware_node (ELF format: 'elf32-littlearm-hfabi'; RPATH: '')
dpkg-shlibdeps: error: couldn't find library libicormqtt.so.1 needed by debian/ros-kinetic-t6-hardware/opt/ros/kinetic/lib/t6_hardware/t6_hardware_node (ELF format: 'elf32-littlearm-hfabi'; RPATH: '')

The CMakeLists.txt specifies to find the libraries at the build location, but this does not seem to be transferred through bloom. These libraries are sucessessfully picked up in other, non-ROS, cmake builds with cpack to package them, with similar find_library stanzas.

EDIT: updated CMakeLists.txt

cmake_minimum_required(VERSION 3.5)

project(t6_hardware)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

set ( CMAKE_CXX_STANDARD 11 )
set ( CMAKE_BUILD_TYPE release )

find_library( ICORUTILITY_LIBRARIES
  NAMES libicorutility libicorutility.so.1
  PATHS
  ../../../shared/IcorUtilityLib/build
  ../../../../shared/IcorUtilityLib/build
)

find_library( ICORMQTT_LIBRARIES
  NAMES libicormqtt libicormqtt.so.1
  PATHS
  ../../../shared/MqttLib/build
  ../../../../shared/MqttLib/build
)

find_package( catkin REQUIRED COMPONENTS
  actionlib
  actionlib_msgs
  controller_manager
  hardware_interface
  message_generation
  roscpp
  sensor_msgs
  std_msgs
)

catkin_package(
  CATKIN_DEPENDS
  actionlib
  actionlib_msgs
  controller_manager
  hardware_interface
  roscpp
  sensor_msgs
  std_msgs
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

add_executable(${PROJECT_NAME}_node src/t6_main.cpp src/t6_robot.cpp )

message( "Utility libraries = ${ICORUTILITY_LIBRARIES}" )
message( "Mqtt libraries = ${ICORMQTT_LIBRARIES}" )

target_link_libraries(
  ${PROJECT_NAME}_node
  ${catkin_LIBRARIES}
  ${ICORUTILITY_LIBRARIES}
  ${ICORMQTT_LIBRARIES}
)

## Mark executables and/or libraries for installation
install(TARGETS ${PROJECT_NAME}_node
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY launch/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  PATTERN ".svn" EXCLUDE
)

Note that during run time, the libraries are installed from deb packages, but not at build time. Does anybody know how to get the ROS build mechanism to not fail when it learns of non-packaged dependencies through dpkg_shlibdeps?

edit retag flag offensive close merge delete

Comments

This is not an answer, but I'm confused by the mix of rosbuild and catkin in your CMakeLists.txt. Is that on purpose, or are those left-overs from a rosbuild->catkin migration?

gvdhoorn gravatar image gvdhoorn  ( 2018-04-30 13:13:25 -0500 )edit

This is my first experience with ROS and cmake. I copied and modified the CMakeLists.txt file from another source, but do not know enough to recognize that there was a mix or which bits are for catkin and which for rosbuild.

Ian Gough gravatar image Ian Gough  ( 2018-04-30 13:17:35 -0500 )edit

Then I would suggest checking wiki/catkin/CMakeLists.txt, wiki/migrating_from_rosbuild and the Catkin documentation documentation.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-30 13:19:38 -0500 )edit

but do not know enough to recognize that there was a mix or which bits are for catkin and which for rosbuild.

Well, for starters: everything with rosbuild in it is for rosbuild.

Setting EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH is also not supported any more.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-30 13:20:41 -0500 )edit

I also see:

find_package( Boost ..)

but nothing is linked against any Boost libraries.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-30 13:22:13 -0500 )edit

Thanks for your suggestions. I have removed the rosbuild cruft from the CMakeLists.txt and removed the obsolete package.xml files. So now, I guess its a more pretty, but still broken build.

Ian Gough gravatar image Ian Gough  ( 2018-04-30 15:16:10 -0500 )edit

If you changed your CMakeLists.txt, then please update the one you show in your question text, as otherwise other board members might suggest changing this that are already no longer relevant.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-01 02:41:52 -0500 )edit

and removed the obsolete package.xml files

I hope you meant to write: "the obsolete manifest.xml files". package.xml is needed, manifest.xml is not.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-01 02:42:51 -0500 )edit