Choosing SSE / AVX Flag Advice

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Choosing SSE / AVX Flag Advice

Stephen McDowell

I was originally using -march=native for non-windows, but in my attempts to support embedded architectures learned that this flag is broken and/or does nothing for many compilers (fixed for ARM in gcc 8 I think though).  Enter the glorious work of the folks at Vc:

It’s quite comprehensive, and though it may not be ready for cross-compiling (still testing that, but I have to learn how to cross compile first!), it does appear to support native optimizations for embedded architectures.  Here is my concern, the following flags are generated:


I am concerned only because these flags will be a part of the PUBLIC compile features of a library, Eigen is the main math library backend as well as there are some templated image conversion routines that use SSE2 intrinsics to operate in my library.  Having that many additional flags could ultimately lead to undesirable consequences such as command line arguments being too long?

I’m currently reworking it so that just the highest version (e.g. -mavx2) is used, but I’m not sure if I should even be worried about this.

Thanks for any thoughts!



Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: