Rviz build on Linux

Setup new ubuntu 16.04 environment to build rviz of ros2, there are always some dependence packages not found, here list build errors and fixing solution for reference.

Follow rviz 2 readme.md:

###############################################
Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)

apt-get install libsdl2-dev

###############################################
By not providing “FindQt5.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “Qt5”, but
CMake did not find one.

Could not find a package configuration file provided by “Qt5” with any of
the following names:
Qt5Config.cmake
qt5-config.cmake

apt-get install qt5-defalut

###############################################
Could not find freeimage library

apt-get install libfreeimage-dev

###############################################
Checking for module ‘yaml-cpp>=0.5’
CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
A required package was not found

apt-get install libyaml-cpp-dev

###############################################
Could not find a package configuration file provided by “ASSIMP” with any
of the following names:
ASSIMPConfig.cmake
assimp-config.cmake

apt-get install libassimp-dev

###############################################
Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)

apt-get install libcurl4-openssl-dev

###############################################

2 Likes

Thanks very much for your work here, Chris. It seems that the make file is
quite a mess! You saved a lot of us less skilled people a lot of hunting
and despair.

Hi Chris, thanks for documenting the RViz dependencies!

We are aware that the build instructions are not very clear right now.
The following pull request should make it clearer:

Some comments regarding your findings:

  • Thanks to your post I noticed that the instructions still missed curl in the dependency list and added it.
  • FreeImage is currently not required for building RViz. The error message is printed but it is not relevant for now.
  • SDL is built automatically together with OGRE. It should therefore not be necessary to install the apt package.
    However, installing the SDL apt package also installs two required dependencies, namely libgles2-mesa-dev and libglu1-mesa-dev. These are included in the new build instructions.

I have an equivalent error on OSX. Have you update the relevant instructions, also?
Thanks Dennis

I do not try on OSX, hope anyone else working on OSX could help you

@greimela-si Just to confirm that it’s still necessary to install libyaml-cpp-dev ? it seems that rviz2 has its own yaml-cpp now

Sorry for the late reply!

No, some of the dependencies listed in this post such as yaml-cpp should not be necessary to install anymore.

The dependencies listed on this page should be enough