Problem building with non-installed dependencies
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?
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?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.
Then I would suggest checking wiki/catkin/CMakeLists.txt, wiki/migrating_from_rosbuild and the Catkin documentation documentation.
Well, for starters: everything with
rosbuild
in it is for rosbuild.Setting
EXECUTABLE_OUTPUT_PATH
andLIBRARY_OUTPUT_PATH
is also not supported any more.I also see:
but nothing is linked against any Boost libraries.
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.
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.I hope you meant to write: "the obsolete manifest.xml files".
package.xml
is needed,manifest.xml
is not.