ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Catkin - files are not found after install. Wrong directories?

asked 2013-03-30 05:04:37 -0500

obsti gravatar image

Hi all,

I compiled some packages using catkin. Now on installation ($ catkin_make install) all the files are installed to the catkin_ws/install folder. But there they are not found. I think they should be copied to different systems paths, right?

Do I need to source a file in the workspace to use the compiled and installed files there? How can I get all the files in the right system folders?


edit retag flag offensive close merge delete


Did you configure the CMAKE_INSTALL_PREFIX? Did your CMakeLists.txt invoke the CMake install() macro?

joq gravatar image joq  ( 2013-03-30 05:13:57 -0500 )edit

No I didn't especially set the CMAKE_INSTALL_PREFIX. To which path do I need to set it? And in the top-level CMakeLists.txt I didn't find any command for the install() macro. How can I set it?

obsti gravatar image obsti  ( 2013-03-30 05:30:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-30 05:51:21 -0500

joq gravatar image

updated 2013-03-30 05:59:13 -0500

Unfortunately, the default CMake install location is /usr/local, not a good destination for ROS packages. So, you need to configure your catkin workspace, somewhat like this example:

$ cd ~/catkin_ws/build
$ cmake ../src -DCMAKE_INSTALL_PREFIX=../install

Then, you need to add CMake install() commands to your CMakeLists.txt.

For example, if you need to install C++ headers where they can be found by other packages:

install(DIRECTORY include/

Similarly, if there is a shared libraries needed by other packages at runtime:

  TARGETS your_shared_library

Note that catkin library names have system-wide scope, so make sure they clearly describe their role. Include names are less of an issue, since they are usually in a subdirectory under your package name.

edit flag offensive delete link more


What I missed was sourcing the setup.bash in the install directory. Doing this the files are found and the nodes are launching correctly! Thanks a lot joq!

obsti gravatar image obsti  ( 2013-03-30 10:40:53 -0500 )edit

That is easy to miss. Glad it's working now.

joq gravatar image joq  ( 2013-03-30 11:56:19 -0500 )edit

Is there a way to embed -DCMAKE_INSTALL_PREFIX=../install in CMakeLists.txt so I don't have to remember it on the command line?

Kevin gravatar image Kevin  ( 2013-06-13 12:29:48 -0500 )edit

When you call catkin_make that is always the default location for the install prefix.

Dirk Thomas gravatar image Dirk Thomas  ( 2013-06-13 12:35:10 -0500 )edit

Ah yes, sorry ... that is not exactly what I meant. Is there a way to embed -DCMAKE_INSTALL_PREFIX=/some/place/else in CMakeLists.txt so I don't have to remember it on the command line?

Kevin gravatar image Kevin  ( 2013-06-13 15:42:59 -0500 )edit

You might could do something like this: (I haven't tried this, might need different syntax or logic)

William gravatar image William  ( 2013-06-13 17:18:46 -0500 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2013-03-30 05:04:37 -0500

Seen: 2,137 times

Last updated: Mar 30 '13