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

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
3

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

joq gravatar image

In your CMakeLists.txt define this near the top:

set(ROS_BUILD_TYPE Debug)
edit flag offensive delete link more

Comments

This does not work for catkin

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

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
8

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

Comments

2

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
2

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

Stats

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

Seen: 7,841 times

Last updated: Oct 01 '14