Ask Your Question
2

rosmake vs. make

asked 2011-07-16 10:09:35 -0500

updated 2011-07-16 10:11:25 -0500

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

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
10

answered 2011-07-16 10:22:03 -0500

Mac gravatar image

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.

edit flag offensive delete link more

Comments

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

Mac gravatar imageMac ( 2011-10-02 10:43:33 -0500 )edit
3

answered 2011-07-16 10:23:13 -0500

Eric Perko gravatar image

updated 2011-07-16 10:23:36 -0500

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.

edit flag offensive delete link more
1

answered 2011-07-16 10:10:37 -0500

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2011-07-16 10:09:35 -0500

Seen: 921 times

Last updated: Jul 16 '11