Ask Your Question

Build with optimization flags

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

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

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

Yashas gravatar image

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

You can enable LTO by setting ENABLE_LTO build option.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 25 times

Last updated: Apr 19