# rosmake vs. make

What is the difference between make and rosmake? Which one is recommended?

edit retag close merge delete

Sort by » oldest newest most voted

Running rosmake is a superset of make. In particular, rosmake runs make on all of a package's dependencies (as defined in manifest.xml), including recursive dependencies. By contrast, make just builds the current package.

You should run rosmake the first time you build a package (say, when you first install it), when you change a package's manifest.xml (in case you need to recursively build a newly-added dependency), or when a package's dependency needs to be rebuilt.

My workflow goes like this:

1. Sit down at my desk in the morning.
2. rosinstall ~/ros /opt/ros/diamondback (this gets all of my source packages up-to-date)
3. rosmake foo (where foo is the package I'm currently developing; this makes sure the dependencies and everything else are properly dealt with)
4. After that, while working on foo, just use make.

A note: the packages that are distributed as binaries (the .deb files) include a ROS_NOBUILD file that causes rosmake to skip right over them; this causes them to (appear to) build very fast.

more

NB: these days, it's "rosinstall ~/ros /opt/ros/electric". The appropriate letter of the alphabet will evolve over time...

( 2011-10-02 10:43:33 -0500 )edit

make does finish first because it only compiles the current package that you are working on. It only works if you are in the root directory of that package.

rosmake compiles the package (or stack) named (e.g. rosmake my_package) or if you are working in a package's root directory and don't name a package, the current package. rosmake also checks and compiles any dependencies if required.

My rule of thumb is to rosmake the first time and anytime I change the manifest or CMakeLists.txt as well as anytime I modify any of a packages dependencies. If I have only made changes to source code in the package itself, I just use make.

more

It seems that rosmake attempts to compile all the package's dependencies, whereas make only compiles the package, so it's faster.

more