ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

What is the benefit of building ROS from source?

asked 2019-11-14 01:17:48 -0500

ignite gravatar image

updated 2019-11-14 06:07:07 -0500

I'm just wondering what are the benefits of installing ROS from source, compared to installing from pre-built binary with sudo apt-get install ros-kinetic-desktop-full?

My general understanding is that people build a library X from source because they want to:

  • customize the library X itself
  • or because they require new features from the lastest version of other library Y (which they want to build the library X with)


So my question is kind of two-fold:

  1. What are the benefits of installing ROS from source, as opposed to installing by sudo apt-get?
  2. If my understanding above is correct, how do we build ROS library with newer version of libraries such as pcl-1.9, boost-1.70, vtk-8.2.0 or OpenCV4?


For example, when I try to build ROS from source (as in the manual), it asks me to install libqt5 even if Qt5 was installed already (built from source and use in other project). How should I tell rosdep to skip this, or pass Qt5 path to rosdep (similar to the way we pass CMAKE_PREFIX_PATH to CMake)?

w@laptop:~/mylib$ cd ros_catkin_ws/
w@laptop:~/mylib/ros_catkin_ws$ rosdep install --from-paths src --ignore-src --rosdistro kinetic
executing command [sudo -H apt-get install libqt5widgets5]
[sudo] password for w: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cmake-data libjsoncpp1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5
Suggested packages:
  libqt5libqgtk2 qt5-image-formats-plugins qtwayland5
The following NEW packages will be installed:
  libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5
0 upgraded, 6 newly installed, 0 to remove and 18 not upgraded.
Need to get 0 B/7,204 kB of archives.
After this operation, 25.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
edit retag flag offensive close merge delete



re: your second question: #q289264 and #q248457.

Edit: is this an xy-problem?

gvdhoorn gravatar image gvdhoorn  ( 2019-11-14 04:55:34 -0500 )edit

@gvdhoorn, I think my question is not good, rather. So I can't (don't know how to) build ROS from source with newer libraries such as pcl-1.9 or Qt5 (X), but instead I asked a more general question of the benefits of building ROS from source and how to build with libraries in general (Y). I should have asked the 2nd part of my question in another post.

ignite gravatar image ignite  ( 2019-11-14 05:25:28 -0500 )edit

If I am not wrong, when you install a defined ros distro from binary, you are limited to the OS you are using. If you have ubuntu 18.04, you cannot install kinetic directly. Here is where you can use as workaround the source installation (even personally i would use docker, which helps you to control easier the versions inside your OS).

Solrac3589 gravatar image Solrac3589  ( 2019-11-14 10:27:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-14 04:45:25 -0500

tfoote gravatar image

You're right that the benefits are that you can customize it or the dependencies.

If you want to build against custom dependencies you need to build and install them into the environment in which you will be building ROS from source. There's nothing different about building a ROS library from any other software library if you want to update or change the dependency. You must set it up such that the newer dependencies are found by making sure that they're on the search path(CMake, Autotools, pkg-config, etc) before the default versions. Depending on your sensitivity you can install the libraries globally on your system and replace them for everything, or you can use various types of isolation that suit your needs and make sure to inject the libraries into your path.

edit flag offensive delete link more


@tfoote, (Edited) Thanks, I think your reply kind of answers my question in general. But there are some nitty-gritty details that I need to try further, as it's not very obvious to me how I can tell rosdep to look for my custom built libraries. I will keep this question open for a couple of days before accepting the answer too eaerly.

ignite gravatar image ignite  ( 2019-11-14 04:49:43 -0500 )edit

rosdep is only aware of system packages. If you're using non-standard dependencies you need to manage them yourself.

It is possible to create custom rosdep rules. But if you're installing non-standard dependencies from source etc rosdep has no clue how to handle them. It's just a meta-package manager. No package manager is aware of things like your CMAKE_PREFIX_PATH. If you've manually installed a resource you can tell rosdep to --skip-key for that. Or create a custom rosdep rule locally that will override the rosdep rule for that package to be an empty list so rosdep doesn't try to install anything for it.

tfoote gravatar image tfoote  ( 2019-11-14 13:53:14 -0500 )edit

If you want more help with that please ask a separate question. Your first question has nothing to do with rosdep.

tfoote gravatar image tfoote  ( 2019-11-14 13:54:53 -0500 )edit

Question Tools



Asked: 2019-11-14 01:08:14 -0500

Seen: 506 times

Last updated: Nov 14 '19