Ask Your Question
3

catkin_make only working with -j1 option, giving compile error otherwise?

asked 2013-07-31 11:58:09 -0500

updated 2014-01-28 17:17:30 -0500

ngrennan gravatar image

We are working with a pretty large catkin project that compiled just fine for months. Without code changes, we started seeing compile errors after some groovy updates and building from scratch, looking like:

[  2%] Building CXX object flor_common/flor_interactive_marker_server_custom/CMakeFiles/flor_interactive_marker_server_custom.dir/src/interactive_marker_server_custom.cpp.o
In file included from /home/kohlbrecher/flor_repo/catkin_ws/src/flor_common/flor_interactive_marker_server_custom/src/interactive_marker_server_custom.cpp:68:0:
/home/kohlbrecher/flor_repo/catkin_ws/src/flor_common/flor_interactive_marker_server_custom/include/flor_interactive_marker_server_custom/interactive_marker_server_custom.h:80:45: fatal error: flor_ocs_msgs/OCSTemplateUpdate.h: No such file or directory
compilation terminated.
make[2]: *** [flor_common/flor_interactive_marker_server_custom/CMakeFiles/flor_interactive_marker_server_custom.dir/src/interactive_marker_server_custom.cpp.o] Error 1
make[1]: *** [flor_common/flor_interactive_marker_server_custom/CMakeFiles/flor_interactive_marker_server_custom.dir/all] Error 2
make: *** [all] Error 2
make: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!
Invoking "make" failed

Noticing that the actual error messages changed when executing "catkin_make" multiple times, I figured there might be some issue with parallel jobs and different timings leading to different errors. Sure enough, when running "catkin_make -j1", the project compiles. Any ideas if there's something on our side making this error appear, or if this is a catkin bug?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
6

answered 2013-07-31 12:02:11 -0500

Dirk Thomas gravatar image

updated 2013-07-31 12:03:53 -0500

In the case of incompletely specified target dependencies you will face issues like the one you describe when building with multiple threads in parallel.

You should open tickets against the packages which lack proper dependencies and try to e.g. compile C++ code before the required message header have been generated.

The How-To http://ros.org/doc/groovy/api/catkin/html/howto/cpp_msg_dependencies.html should describe how the dependencies must be stated in CMake.

In the case of the posted example message that would be flor_interactive_marker_server_custom.

edit flag offensive delete link more

Comments

Dirk, does this mean that beside the declaration in package.xml and in find_package(catkin ...) a dependency to ${catkin_EXPORTED_TARGETS} or flor_ocs_msgs_generate_messages_cpp has to be declared for every single target in each dependent package that uses the generated headers?!?

Johannes Meyer gravatar imageJohannes Meyer ( 2013-08-24 12:18:29 -0500 )edit

Yes, you need a target-level dependency between the target which uses the generated message headers and the target which generates the message headers.

Dirk Thomas gravatar imageDirk Thomas ( 2013-08-24 12:42:41 -0500 )edit

The link leads to not-found. For Hydro it's found here.

130s gravatar image130s ( 2014-09-23 09:17:14 -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

1 follower

Stats

Asked: 2013-07-31 11:58:09 -0500

Seen: 2,535 times

Last updated: Jul 31 '13