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

Difference between installing ROS from source and already-built one

asked 2011-09-27 19:42:55 -0600

alfa_80 gravatar image

updated 2011-09-28 04:14:11 -0600

joq gravatar image


I would like to know what is the difference between installing ROS from source and "already-built" one. Despite knowing that as mentioned in the web page that the one that "already-built" is more efficient over the other, what is its limitation. I have also once heard from somebody telling that the best practice if we are developing something (not only using it) is to use the one built from source. Is that one right?

Thanks in advance.


edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted

answered 2011-09-28 03:43:10 -0600

DimitriProsser gravatar image

By taking the pre-built packages from the repositories, they're by default read-only. This means that if you want to modify them, you'd need to change the permissions on every file.

The reason that they're read-only, however, is because the packages downloaded from the repositories (the pre-built packages) are the stable, maintained versions of the code. Occasionally, updates will be released. These updates will overwrite any local modifications to the packages, but will provide you with the latest stable builds.

Building from source, on the other hand, always gives you the most up-to-date version of each package. Checking out the source code also gives the code default read/write permissions, and it won't ever be updated, unless you do it manually. Checking out from source gives you more control over versions, modifications, etc.

The choice is really up to you. It really depends what you intend to do with the code. I hope this helps to clarify it a bit. I can't guarantee that this is a comprehensive list, but this is just my 2 cents.

edit flag offensive delete link more


@DimitriProsser: Just want to know, are using the pre-built binaries?
alfa_80 gravatar image alfa_80  ( 2011-09-28 05:44:32 -0600 )edit
I use the pre-build binaries for most applications. I have my own code that I've written for my specific application, and then I use ROS packages for navigation, msgs, visualization, plugins, simulator, etc. I've created a few forks of ROS packages as well.
DimitriProsser gravatar image DimitriProsser  ( 2011-09-28 05:46:50 -0600 )edit
Thanks a lot for sharing your experience..
alfa_80 gravatar image alfa_80  ( 2011-09-28 05:57:17 -0600 )edit

answered 2011-09-28 04:11:20 -0600

joq gravatar image

Source code is the human-readable and editable representation of a ROS package (or any other computer program). You need that for making changes to the program.

In most cases, some form of translation is required before a source program can be run on a computer. That is often called building the program. In ROS, rosmake will build any source package.

For relatively recent versions of Ubuntu Linux, the ROS community provides pre-built packages in native Ubuntu format. Those packages are usually easier and less error-prone to install.

Most ROS packages depend on other ROS packages for needed interfaces. For them, installing pre-built binary packages makes sense.

edit flag offensive delete link more

answered 2011-09-28 05:26:18 -0600

Mac gravatar image

You'll save yourself a great deal of time (and a fair amont of pain) if you use pre-built binary packages wherever you can. As has been pointed out above, this won't work for packages you're currently coding on; those need to be recompiled every time you change something.

For things you aren't actively changing, having the pre-built binaries can save you a lot of time (building some of them takes hours) and guarantees that you're coding against the very same version of ROS that the rest of us are using, thereby making sure your code is portable.

edit flag offensive delete link more

answered 2011-09-28 23:00:07 -0600

Daniel Stonier gravatar image

I think the others missed pointing out why you might want to compile from source. Pre built binaries are useful if default vanilla build options will suit you. There are various use cases where this is not desirable though and rosinstall'ing ( becomes easier.

  • setting custom cflags (eg optimisation for an intel atom cpu, or for size or globally setting a macro)
  • changing the build mode (debug, ...)
  • cross compiling

Note that you probably want to avoid recompiling pre built debs as you will have to muck around with permissions and you will have to watch for whenever the debs install an updated version.

edit flag offensive delete link more

answered 2011-10-03 23:36:22 -0600

I've used Gentoo for a long time, chasing the idea that compiling the source code enables you to optimize the binaries for you specific machine. I think this hold only when you have some fancy hardware or when gcc supports the specific architecture you're working with. For example, a compiler might align your data so that they will create less cache miss given your processor's cache size.

In practice, the speed-up is often barely noticeable, so using binaries is most of the time no different from compiling the source code.

Unless one wants to do things the real geeky way :)

edit flag offensive delete link more


I used to use gentoo, but often there's a big difference between a robot and a desktop. Most of the time the desktop uses a fraction of its capability, so speedup is not very noticable. On a commercial/embedded robot with 'just enough' specs on the cpu, good cflag settings can be pretty critical.
Daniel Stonier gravatar image Daniel Stonier  ( 2011-10-08 14:20:06 -0600 )edit

Question Tools


Asked: 2011-09-27 19:42:55 -0600

Seen: 1,357 times

Last updated: Oct 03 '11