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

How to see compiler invocation in colcon build

asked 2020-10-09 03:04:56 -0500

fredBeauj gravatar image

I build a package with colcon build and get an error about including a missing header file. I suspect something is off with the -I flags passed to the compiler. How can I see the exact command with which the compiler is called?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2020-10-09 03:34:36 -0500

fredBeauj gravatar image

updated 2020-10-09 09:54:33 -0500

It's in the colcon manual but it wasn't clear enough so I missed it the first time

colcon build --packages-select my_pkg --event-handlers console_direct+

As an alternative, it the package has already been built and cmake uses make, one can just go to the build directory and invoke make directly

cd build/my_pkg
make

When there is a lot of errors, it's useful to step through the colored output of the compiler

unbuffer colcon build --packages-select mpc_follower --event-handlers console_direct+ |& less -r

the unbuffer command is available via sudo apt install expect

edit flag offensive delete link more
1

answered 2020-10-09 09:21:31 -0500

Dirk Thomas gravatar image

updated 2020-10-09 09:23:48 -0500

Assuming you are referring to a CMake packages using Make under the hood: you can prefix the colcon build invocation with VERBOSE=1 optionally together with --event-handlers console_direct+to see stdout output directly rather than having to look in the log files (log/latest/<pkgname>/stout.log).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-10-09 03:04:56 -0500

Seen: 5,023 times

Last updated: Oct 09 '20