First time here? Check out the FAQ!

Ask Your Question
0

Build with optimization flags

asked Apr 19 '19

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?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Apr 19 '19

Yashas gravatar image

updated Jun 23 '19

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.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Apr 19 '19

Seen: 1,319 times

Last updated: Jun 23 '19