Important: Please read the Qt Code of Conduct -

AVX2 on OS X

  • Hello,

    I wan't to use some AVX2 code in my Qt App and run into a problem. On Windows every thing works as expected. But on OS X it only compiles, when I set QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2. Only then the App doesn't work on non AVX2 CPUs at all and crashes on start up, not when my code executes.

    It there a way around it?


  • What is the exact error you get if you compile without QMAKE_CXXFLAGS += $QMAKE_CFLAGS_AVX2? That instructs the compiler to use AVX2 in general if appropiate optimization is on place, not only when used by hand.

  • If I don't include QMAKE_CXXFLAGS += $QMAKE_CFLAGS_AVX2 the compiler doesn't find any AVX2 instructions, even when <immintrin.h> is included.

Log in to reply