Ask Your Question
0

How can I add C++ optimization flags to ROS

asked 2015-07-15 09:24:53 -0600

adnansousi gravatar image

I am running an opencv code on ROS and I really need to turn on the -O3 optimization flag.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2015-07-15 10:10:57 -0600

mgruhler gravatar image

updated 2015-07-15 10:28:21 -0600

Call catkin_make -DCMAKE_BUILD_TYPE=Release to turn on the default optimization flags for release builds. -O3 should be in there, as far as I know.

Otherwise, you can add compile flags on a per node basis by specifying set_target_properties(<TARGET> PROPERTIES COMPILE_FLAGS "-O3") in the CMakeLists.txt. However, I'm not sure how this is handled then in combination with a build type.

edit flag offensive delete link more

Comments

thank you very much. I just typed in catkin_make -DCMAKE_BUILD_TYPE=Release and it worked fine thanks.

adnansousi gravatar imageadnansousi ( 2015-07-15 10:30:18 -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

Stats

Asked: 2015-07-15 09:24:53 -0600

Seen: 1,180 times

Last updated: Jul 15 '15