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

catkin_make's option for optimization

asked 2014-06-06 11:13:38 -0600

moyashi gravatar image

I used Eigen library for my program and found that matrix calculation is very slow(Just "for loop" is faster !!).

I think that optimization is not carried out when making the program.
How can I optimize the program ?
Any good catkin option for optimization ?

Thanks in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2014-06-06 11:25:05 -0600

ahendrix gravatar image

catkin_make is just a wrapper around CMake, so you can use the standard CMake variable CMAKE_BUILD_TYPE to enable various build options.

For a release configuration with opmizations and no debugging symbols, you can use the Release build type:

catkin_make -DCMAKE_BUILD_TYPE=Release

For a release with debug configuration, with optimizations and debug symbols, you can use the RelWithDebInfo build type:

catkin_make -DCMAKE_BUILD_TYPE=RelWithDebInfo

CMake's useful variables page gives more information about build types.

edit flag offensive delete link more

Comments

Could you provide an example of compiling rviz without any optimizations?

gustavogoretkin gravatar image gustavogoretkin  ( 2015-05-04 15:58:53 -0600 )edit
1

catkin_make -DCMAKE_CXX_FLAGS=-O0 will force it to not have any optimizations, but it should be sufficient to do catkin_make -DCMAKE_BUILD_TYPE=Debug to prevent CMake from introducing optimization flags.

William gravatar image William  ( 2015-05-04 17:30:39 -0600 )edit
William gravatar image William  ( 2015-05-04 17:30:46 -0600 )edit
3

answered 2014-06-06 11:35:24 -0600

Dirk Thomas gravatar image

After entering "catkin_make -D" and hitting tab you should also get completion when using a bash shell. So you don't have to remember the exact names.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-06-06 11:13:38 -0600

Seen: 11,844 times

Last updated: Jun 06 '14