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

how to compile package with debug option

asked 2012-05-29 15:01:02 -0600

Kei Okada gravatar image

I'm not sure if this is newbie cmake question or rosbuild question, but is there way to compile package with debugging option as -g, -pg? (I found make VERBOSE=1 can generate more verbose output message, so look for something like make DEBUG=1 option.)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-05-29 16:44:08 -0600

joq gravatar image

In your CMakeLists.txt define this near the top:

edit flag offensive delete link more


This does not work for catkin

Robocop87 gravatar image Robocop87  ( 2015-08-26 14:54:00 -0600 )edit

True, but note that the question was originally asked with the rosbuild tag, and answered in 2012.

joq gravatar image joq  ( 2016-01-13 10:40:48 -0600 )edit

Thanks for the clarification!

Robocop87 gravatar image Robocop87  ( 2016-01-21 09:25:49 -0600 )edit

answered 2014-10-01 21:50:36 -0600

PaulBouchier gravatar image

The ROS_BUILD_TYPE option above appears to be incorrect for catkin. The proper build command is: catkin_make -DCMAKE_BUILD_TYPE=Debug

edit flag offensive delete link more



This is the correct answer. But this compiles all packages in the workspace with debug flags. Is there a way to target just one?

Robocop87 gravatar image Robocop87  ( 2015-08-26 14:53:45 -0600 )edit

with -DCATKIN_WHITELIST_PACKAGES="your_package_name,other_package_name" or with -DCATKIN_BLACKLIST_PACKAGES= ...

JulesW gravatar image JulesW  ( 2016-06-30 08:37:43 -0600 )edit

Question Tools


Asked: 2012-05-29 15:01:02 -0600

Seen: 7,665 times

Last updated: Oct 01 '14