Ask Your Question
2

For what purpose catkin_make -DCMAKE_BUILD_TYPE=Release command is used?

asked 2018-06-24 20:36:08 -0600

malgudi gravatar image

When to use or what is the purpose of catkin_make -DCMAKE_BUILD_TYPE=Release command? How it differs from catkin_make command. Thank you.

edit retag flag offensive close merge delete

Comments

1

This is a direct duplicate of at least #q294789, which was asked 4 days ago.

gvdhoorn gravatar imagegvdhoorn ( 2018-06-25 03:26:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-06-24 21:34:48 -0600

updated 2018-06-24 21:35:54 -0600

The CMAKE_BUILD_TYPE variable is used to specify a build type. Typically, the selected option (by default empty, but it can be Release, Debug, or some others) is used to figure out what options to use/flags to set when cmake actually calls the compiler.

In short, Release tells the compiler to do optimization and omit debug information that Debug would tell it to keep. I've seen some people recommend using -DCMAKE_BUILD_TYPE=Release for better performance.

Calling catkin_make (and not specifying a value for CMAKE_BUILD_TYPE) results in something similar to using the Debug value.

See:
https://codeyarns.com/2015/05/14/buil...
https://cmake.org/cmake/help/v3.0/var...

edit flag offensive delete link more

Comments

1

+1 to use Release for better performance. It depends on the source how much the gain is but I had cases where a release build was running around 100 times faster than a debug build. So as a rule of thumb: Always use Release except when debug symbols are explicitly needed.

Felix Widmaier gravatar imageFelix Widmaier ( 2018-10-17 02:59:21 -0600 )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: 2018-06-24 20:36:08 -0600

Seen: 1,711 times

Last updated: Jun 24 '18