Indigo: failing to build rosbag, missing header [closed]

asked 2018-05-16 06:06:06 -0500

jotator gravatar image

updated 2018-05-16 06:07:10 -0500

Hello everyone,

I am trying to build and cross compile ROS Indigo for a custom board that features an ARM processor running a custom Linux distribution.

Besides a few identical warnings I will deal with later, the process fails at what seems to be the very end of the build process, when when putting together the rosbag package. The output is the following:

Scanning dependencies of target rosbag
    [ 12%] Building CXX object CMakeFiles/rosbag.dir/src/player.cpp.o
    [ 25%] Building CXX object CMakeFiles/rosbag.dir/src/recorder.cpp.o
    In file included from /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag_storage/include/rosbag/bag.h:41:0,
                     from /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag/include/rosbag/recorder.h:59,
                     from /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag/src/recorder.cpp:35:
    /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag_storage/include/rosbag/chunked_file.h:44:19: fatal error: bzlib.h: No such file or directory
    compilation terminated.
    CMakeFiles/rosbag.dir/build.make:86: recipe for target 'CMakeFiles/rosbag.dir/src/recorder.cpp.o' failed
    make[2]: *** [CMakeFiles/rosbag.dir/src/recorder.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    In file included from /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag_storage/include/rosbag/bag.h:41:0,
                     from /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag/include/rosbag/player.h:51,
                     from /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag/src/player.cpp:35:
    /home/jjtq/mtp_catkin_ws/src/ros_comm/rosbag_storage/include/rosbag/chunked_file.h:44:19: fatal error: bzlib.h: No such file or directory
    compilation terminated.
    CMakeFiles/rosbag.dir/build.make:62: recipe for target 'CMakeFiles/rosbag.dir/src/player.cpp.o' failed
    make[2]: *** [CMakeFiles/rosbag.dir/src/player.cpp.o] Error 1
    CMakeFiles/Makefile2:648: recipe for target 'CMakeFiles/rosbag.dir/all' failed
    make[1]: *** [CMakeFiles/rosbag.dir/all] Error 2
    Makefile:138: recipe for target 'all' failed
    make: *** [all] Error 2

I am using the following toolchain file:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)
set(CMAKE_SYSROOT /home/jjtq/mtp_catkin_ws/cross/sysroots/cortexa7hf-neon-poky-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH /home/jjtq/mtp_catkin_ws /home/jjtq/mtp_catkin_ws/cross /home/jjtq/mtp_catkin_ws/cross/install /home/jjtq/mtp_catkin_ws/lz4-1_1.8.1.2-1-arm.pkg/usr)
set(PYTHON_LIBRARY /home/jjtq/mtp_catkin_ws/cross/libpython2.7.so.1.0)
set(PYTHON_INCLUDE_DIR /home/jjtq/mtp_catkin_ws/cross/include/python)
set(TinyXML_LIBRARY /home/jjtq/mtp_catkin_ws/cross/libtinyxml.so.2.6.2)
set(TinyXML_INCLUDE_DIR /usr/include)
set(BZIP2_LIBRARIES /home/jjtq/mtp_catkin_ws/cross/libbz2.so.1.0.6)
set(BZIP2_INCLUDE_DIR /usr/include)

# Have to set this one to BOTH, to allow CMake to find rospack
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

I have checked and the header "bzlib.h" is indeed in folder /usr/include, which is set in the toolchain file for BZIP2_INCLUDE_DIR. Any idea of what is it that I am missing?

The process has so far been kind of dirty and "hacky" because I am not familiar with build systems and crosscompiling to this degree, so please forgive any inacuracies and screw ups :)

Best regards!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by jotator
close date 2018-11-14 11:17:57.987647

Comments

I know this is old but I've faced the exact same error with rosbag when trying to compile melodic on a raspberry pi variant of debian stretch. May I at least know of the status when you closed this question? Did you ever managed to solve it?

Irin Thirdwater gravatar image Irin Thirdwater  ( 2019-08-24 23:55:14 -0500 )edit