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

Why do we need the devel, build and install spaces in a catkin workspace?

asked 2018-03-21 08:48:38 -0500

nbro gravatar image

updated 2018-03-21 08:55:04 -0500

I have read the initial part of the article http://wiki.ros.org/catkin/workspaces , but I am still not having an intuitive understanding of why we need the devel, build and install spaces. I can infer that the devel space may contain mainly packages useful while developing (i.e. while editing the files in the src directory, i.e. the source files, but then what's the purpose of the src space?). What’s the difference between the devel, build and install spaces?

I also have a few specific questions regarding the documentation I am linking you to above.

Regarding the build space, it states

The build space is where CMake is invoked to build the catkin packages in the source space.

Given that I am not very familiar with make and cmake, what does it mean "to build a package" in the context of catkin?

Then, it states regarding the devel space

The development space (or devel space) is where built targets are placed prior to being installed.

Again, given my ignorance regarding make and cmake, first of all, what is a target in the context of catkin, workspaces and ROS packages? What is a built target? Why do we need to place built targets here before installing them? How is building a package different from installing? I understood we are building packages, but what are we installing? When do we need to install after building (which I associate more to compiling and linking source files)? When don't we need to install?

Why are the folders devel, src, build and install called spaces?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
8

answered 2018-03-21 20:21:36 -0500

William gravatar image

I believe almost all of your questions are answered by these pages:

Given that I am not very familiar with make and cmake, what does it mean "to build a package" in the context of catkin?

I would suggest reading some introductory material on cmake and make development on Linux, that's a pretty core concept that you'll need to work with ROS.

There are lots of cmake tutorials and guides out there, but I don't have one to recommend over others. Specifically for the question about targets, you might benefit from this:

https://stackoverflow.com/questions/1...

It's asking/answering a more complex question, but the answer has some foundational details on what a target means in cmake and how it relates to make.

what is a target in the context of catkin, workspaces and ROS packages?

It means the same thing as it does for make and cmake (both of which are target oriented), again I believe that's out of the scope of this forum. There's not thing special about targets in catkin, they're just cmake or make targets.

What is a built target? Why do we need to place built targets here before installing them?

How is building a package different from installing?

Again, this is a generic cmake question, but basically you need to build the code and see that it successfully built and then you'll install some but not all of those files from build, usually for the purpose of redistribution.

I understood we are building packages, but what are we installing?

It depends on the package, but usually it's executables, libraries, and headers for C++.

When do we need to install after building (which I associate more to compiling and linking source files)? When don't we need to install?

Again it depends. catkin lets you do more than normal without installing (that's the purpose of the devel space, again see https://wiki.ros.org/catkin/workspaces ), but in normal cmake/make type setups, you usually can run tests and examples after building, but you usually install to produce a result which only includes what you need to actually run the program or use the library.

edit flag offensive delete link more

Question Tools

4 followers

Stats

Asked: 2018-03-21 08:48:38 -0500

Seen: 9,030 times

Last updated: Mar 21 '18