Ask Your Question
0

Build with optimization flags

asked 2019-04-19 05:59:50 -0600

alcoan gravatar image

I would like to build opencv4 with the following optimization flags:

-march=native -O3 -flto

What is the right way to specify those flags?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2019-04-19 10:40:24 -0600

Yashas gravatar image

updated 2019-06-23 11:10:51 -0600

You can add -march=native -O3 to CMAKE_CXX_FLAGS (or to CMAKE_CXX_FLAGS_config where config is RELEASE, DEBUG, etc).

You can enable LTO by setting ENABLE_LTO build option.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-04-19 05:59:50 -0600

Seen: 1,041 times

Last updated: Jun 23 '19