ADVRHumanoids/xbot2_examples

xbot2_examples make -j install fail (fatal error: matio.h: No such file or directory #include <matio.h>)

Closed this issue · 5 comments

OS: Ubuntu 18.04

I've downloaded Xbot 2.0-devel-core-updated bionic-latest.tar.xz, extracted it, and installed it with the provided install.sh.
I put here the steps (from the very beginning) of what I have done to install xbot2_examples

mtartari@ThinkPad-E595:~ $ mkdir -p xbot_ws/src
mtartari@ThinkPad-E595:~ $ cd xbot_ws/src/
mtartari@ThinkPad-E595:~/xbot_ws/src $ git clone https://github.com/ADVRHumanoids/xbot2_examples.git
Cloning into 'xbot2_examples'...
remote: Enumerating objects: 407, done.
remote: Counting objects: 100% (407/407), done.
remote: Compressing objects: 100% (266/266), done.
remote: Total 407 (delta 203), reused 325 (delta 122), pack-reused 0
Receiving objects: 100% (407/407), 810.35 KiB | 420.00 KiB/s, done.
Resolving deltas: 100% (203/203), done.
mtartari@ThinkPad-E595:~/xbot_ws/src $ cd ..
mtartari@ThinkPad-E595:~/xbot_ws $ mkdir install
mtartari@ThinkPad-E595:~/xbot_ws $ mkdir build && cd build
mtartari@ThinkPad-E595:~/xbot_ws/build $ ccmake /home/mtartari/xbot_ws/src/xbot2_examples/

When I configure it (c), I get the following warning

 CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindBoost.cmake:911 (if):
   Policy CMP0054 is not set: Only interpret if() arguments as variables or
   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
   details.  Use the cmake_policy command to set the policy and suppress this
   warning.

   Quoted variables like "chrono" will no longer be dereferenced when the
   policy is set to NEW.  Since the policy is not set the OLD behavior will be
   used.
 Call Stack (most recent call first):
   /usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 (_Boost_MISSING_DEPENDENCIES)
   /usr/share/OGRE/cmake/modules/FindOGRE.cmake:318 (find_package)
   /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:175 (find_package)
   src/device/CMakeLists.txt:2 (find_package)
 This warning is for project developers.  Use -Wno-dev to suppress it.

I ignore it (e) and I set:

CMAKE_BUILD_TYPE                 RelWithDebInfo                                            
CMAKE_INSTALL_PREFIX             /home/mtartari/xbot_ws/install 

I configure again (I get and ignore the warning a second time) then generate and exit (g).
I then proceed to do a make -j install which encounters a fatal failure

mtartari@ThinkPad-E595:~/xbot_ws/build $ make -j install
Scanning dependencies of target malloc_example
Scanning dependencies of target homing_example
Scanning dependencies of target talker
Scanning dependencies of target clock_example
Scanning dependencies of target server
Scanning dependencies of target listener
Scanning dependencies of target ros_from_rt
Scanning dependencies of target client
Scanning dependencies of target rocket_commander
Scanning dependencies of target xbot2_gz_rocket_server
Scanning dependencies of target rocket
Scanning dependencies of target joint_impedance
Scanning dependencies of target impedance_setpoint
Scanning dependencies of target cartesio_rt
[  3%] Building CXX object src/talker_listener/CMakeFiles/talker.dir/talker.cpp.o
[  7%] Building CXX object src/malloc_example/CMakeFiles/malloc_example.dir/malloc_example.cpp.o
[ 10%] Building CXX object src/clock/CMakeFiles/clock_example.dir/clock.cpp.o
[ 14%] Building CXX object src/device/CMakeFiles/rocket.dir/rocket_device.cpp.o
[ 17%] Building CXX object src/homing_example/CMakeFiles/homing_example.dir/homing_example.cpp.o
[ 21%] Building CXX object src/client_server/CMakeFiles/client.dir/client.cpp.o
[ 25%] Building CXX object src/client_server/CMakeFiles/server.dir/server.cpp.o
[ 28%] Building CXX object src/ros_from_rt/CMakeFiles/ros_from_rt.dir/ros_from_rt.cpp.o
[ 32%] Building CXX object src/talker_listener/CMakeFiles/listener.dir/listener.cpp.o
[ 35%] Building CXX object src/device/CMakeFiles/xbot2_gz_rocket_server.dir/gz_rocket_server.cpp.o
[ 39%] Building CXX object src/joint_impedance/CMakeFiles/joint_impedance.dir/joint_impedance.cpp.o
[ 42%] Building CXX object src/impedance_setpoint/CMakeFiles/impedance_setpoint.dir/impedance_setpoint.cpp.o
[ 46%] Building CXX object src/device/CMakeFiles/rocket_commander.dir/rocket_plugin.cpp.o
[ 50%] Building CXX object src/cartesio/CMakeFiles/cartesio_rt.dir/cartesio_rt.cpp.o
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/clock/clock.h:2,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/clock/clock.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/clock/CMakeFiles/clock_example.dir/build.make:62: recipe for target 'src/clock/CMakeFiles/clock_example.dir/clock.cpp.o' failed
make[2]: *** [src/clock/CMakeFiles/clock_example.dir/clock.cpp.o] Error 1
CMakeFiles/Makefile2:351: recipe for target 'src/clock/CMakeFiles/clock_example.dir/all' failed
make[1]: *** [src/clock/CMakeFiles/clock_example.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/homing_example/homing_example.h:5,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/homing_example/homing_example.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/homing_example/CMakeFiles/homing_example.dir/build.make:62: recipe for target 'src/homing_example/CMakeFiles/homing_example.dir/homing_example.cpp.o' failed
make[2]: *** [src/homing_example/CMakeFiles/homing_example.dir/homing_example.cpp.o] Error 1
CMakeFiles/Makefile2:525: recipe for target 'src/homing_example/CMakeFiles/homing_example.dir/all' failed
make[1]: *** [src/homing_example/CMakeFiles/homing_example.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/talker_listener/talker.h:2,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/talker_listener/talker.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/talker_listener/CMakeFiles/talker.dir/build.make:62: recipe for target 'src/talker_listener/CMakeFiles/talker.dir/talker.cpp.o' failed
make[2]: *** [src/talker_listener/CMakeFiles/talker.dir/talker.cpp.o] Error 1
CMakeFiles/Makefile2:674: recipe for target 'src/talker_listener/CMakeFiles/talker.dir/all' failed
make[1]: *** [src/talker_listener/CMakeFiles/talker.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/joint_impedance/joint_impedance.h:5,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/joint_impedance/joint_impedance.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/joint_impedance/CMakeFiles/joint_impedance.dir/build.make:62: recipe for target 'src/joint_impedance/CMakeFiles/joint_impedance.dir/joint_impedance.cpp.o' failed
make[2]: *** [src/joint_impedance/CMakeFiles/joint_impedance.dir/joint_impedance.cpp.o] Error 1
CMakeFiles/Makefile2:956: recipe for target 'src/joint_impedance/CMakeFiles/joint_impedance.dir/all' failed
make[1]: *** [src/joint_impedance/CMakeFiles/joint_impedance.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/malloc_example/malloc_example.h:2,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/malloc_example/malloc_example.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/malloc_example/CMakeFiles/malloc_example.dir/build.make:62: recipe for target 'src/malloc_example/CMakeFiles/malloc_example.dir/malloc_example.cpp.o' failed
make[2]: *** [src/malloc_example/CMakeFiles/malloc_example.dir/malloc_example.cpp.o] Error 1
CMakeFiles/Makefile2:470: recipe for target 'src/malloc_example/CMakeFiles/malloc_example.dir/all' failed
make[1]: *** [src/malloc_example/CMakeFiles/malloc_example.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/impedance_setpoint/impedance_setpoint.h:5,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/impedance_setpoint/impedance_setpoint.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/talker_listener/listener.h:2,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/talker_listener/listener.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/talker_listener/CMakeFiles/listener.dir/build.make:62: recipe for target 'src/talker_listener/CMakeFiles/listener.dir/listener.cpp.o' failed
src/impedance_setpoint/CMakeFiles/impedance_setpoint.dir/build.make:62: recipe for target 'src/impedance_setpoint/CMakeFiles/impedance_setpoint.dir/impedance_setpoint.cpp.o' failed
make[2]: *** [src/talker_listener/CMakeFiles/listener.dir/listener.cpp.o] Error 1
make[2]: *** [src/impedance_setpoint/CMakeFiles/impedance_setpoint.dir/impedance_setpoint.cpp.o] Error 1
CMakeFiles/Makefile2:637: recipe for target 'src/talker_listener/CMakeFiles/listener.dir/all' failed
make[1]: *** [src/talker_listener/CMakeFiles/listener.dir/all] Error 2
CMakeFiles/Makefile2:1066: recipe for target 'src/impedance_setpoint/CMakeFiles/impedance_setpoint.dir/all' failed
make[1]: *** [src/impedance_setpoint/CMakeFiles/impedance_setpoint.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/device/rocket_plugin.h:5,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/device/rocket_plugin.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/device/CMakeFiles/rocket_commander.dir/build.make:62: recipe for target 'src/device/CMakeFiles/rocket_commander.dir/rocket_plugin.cpp.o' failed
make[2]: *** [src/device/CMakeFiles/rocket_commander.dir/rocket_plugin.cpp.o] Error 1
CMakeFiles/Makefile2:901: recipe for target 'src/device/CMakeFiles/rocket_commander.dir/all' failed
make[1]: *** [src/device/CMakeFiles/rocket_commander.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/client_server/client.h:2,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/client_server/client.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/client_server/CMakeFiles/client.dir/build.make:62: recipe for target 'src/client_server/CMakeFiles/client.dir/client.cpp.o' failed
make[2]: *** [src/client_server/CMakeFiles/client.dir/client.cpp.o] Error 1
CMakeFiles/Makefile2:768: recipe for target 'src/client_server/CMakeFiles/client.dir/all' failed
make[1]: *** [src/client_server/CMakeFiles/client.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/client_server/server.h:2,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/client_server/server.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/client_server/CMakeFiles/server.dir/build.make:62: recipe for target 'src/client_server/CMakeFiles/server.dir/server.cpp.o' failed
make[2]: *** [src/client_server/CMakeFiles/server.dir/server.cpp.o] Error 1
CMakeFiles/Makefile2:731: recipe for target 'src/client_server/CMakeFiles/server.dir/all' failed
make[1]: *** [src/client_server/CMakeFiles/server.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/ros_from_rt/ros_from_rt.h:2,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/ros_from_rt/ros_from_rt.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/ros_from_rt/CMakeFiles/ros_from_rt.dir/build.make:62: recipe for target 'src/ros_from_rt/CMakeFiles/ros_from_rt.dir/ros_from_rt.cpp.o' failed
make[2]: *** [src/ros_from_rt/CMakeFiles/ros_from_rt.dir/ros_from_rt.cpp.o] Error 1
CMakeFiles/Makefile2:580: recipe for target 'src/ros_from_rt/CMakeFiles/ros_from_rt.dir/all' failed
make[1]: *** [src/ros_from_rt/CMakeFiles/ros_from_rt.dir/all] Error 2
In file included from /opt/xbot/include/XBotInterface/Logger.hpp:2:0,
                 from /opt/xbot/include/XBotInterface/XBotInterface.h:34,
                 from /opt/xbot/include/XBotInterface/RobotInterface.h:29,
                 from /opt/xbot/include/xbot2/robot_interface/robot_interface_xbot_rt.h:4,
                 from /opt/xbot/include/xbot2/rt_plugin/control_plugin.h:4,
                 from /opt/xbot/include/xbot2/xbot2.h:1,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/cartesio/cartesio_rt.h:4,
                 from /home/mtartari/xbot_ws/src/xbot2_examples/src/cartesio/cartesio_rt.cpp:1:
/opt/xbot/include/XBotInterface/MatLogger.hpp:40:10: fatal error: matio.h: No such file or directory
 #include <matio.h>
          ^~~~~~~~~
compilation terminated.
src/cartesio/CMakeFiles/cartesio_rt.dir/build.make:62: recipe for target 'src/cartesio/CMakeFiles/cartesio_rt.dir/cartesio_rt.cpp.o' failed
make[2]: *** [src/cartesio/CMakeFiles/cartesio_rt.dir/cartesio_rt.cpp.o] Error 1
CMakeFiles/Makefile2:1011: recipe for target 'src/cartesio/CMakeFiles/cartesio_rt.dir/all' failed
make[1]: *** [src/cartesio/CMakeFiles/cartesio_rt.dir/all] Error 2
[ 53%] Linking CXX shared library libxbotdev_rocket.so
/usr/bin/ld: cannot find -lmatio
collect2: error: ld returned 1 exit status
src/device/CMakeFiles/rocket.dir/build.make:110: recipe for target 'src/device/libxbotdev_rocket.so' failed
make[2]: *** [src/device/libxbotdev_rocket.so] Error 1
CMakeFiles/Makefile2:864: recipe for target 'src/device/CMakeFiles/rocket.dir/all' failed
make[1]: *** [src/device/CMakeFiles/rocket.dir/all] Error 2
[ 57%] Linking CXX shared library libxbot2_gz_rocket_server.so
/usr/bin/ld: cannot find -lmatio
collect2: error: ld returned 1 exit status
src/device/CMakeFiles/xbot2_gz_rocket_server.dir/build.make:110: recipe for target 'src/device/libxbot2_gz_rocket_server.so' failed
make[2]: *** [src/device/libxbot2_gz_rocket_server.so] Error 1
CMakeFiles/Makefile2:827: recipe for target 'src/device/CMakeFiles/xbot2_gz_rocket_server.dir/all' failed
make[1]: *** [src/device/CMakeFiles/xbot2_gz_rocket_server.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
mtartari@ThinkPad-E595:~/xbot_ws/build $ 

The problem was caused by the absence of MAT File I/O Library. It was solved by downloading the package from https://sourceforge.net/projects/matio/ then unzipping it and installing it:

$ cd matio-1.5.19
$ ./configure
$ make
$ make check
$ sudo make install

It would be useful to add a note in the documentation.

Hi @m-tartari, thanks for the feedback on the above.

To solve the issue you will need to install the following system dependency:

sudo apt-get install libmatio-dev

We have to find a way to do this automatically and you will see some open issues on this matter.

@m-tartari we basically wrote at the same time: we are refactoring the way the debian are shipped to the user.

In the past the gdebi command would install automatically the system dependencies, now we are testing a docker based solution which seems pretty stable, but not yet fully documented.

Anyhow you should be able to use the apt install command for libmatio-dev.

Thanks for the feedback!

To solve the issue you will need to install the following system dependency:

sudo apt-get install libmatio-dev

@m-tartari if you can check also the above solution and in case of success close this issue, I will open another one strictly related to the debian generation and the setup for the system dependencies.

Thanks again!

@liesrock Thank you, it seems to all work correctly