OpenBLAS
OpenBLAS copied to clipboard
Build error with CMake + DYNAMIC_ARCH=OFF + FMA3: _mm256_fmadd_ps compiled without -mfma (target specific option mismatch)
Step to reproduce build error:
Host: modern x86_64 with AVX2 + FMA3.
Build: CMake, DYNAMIC_ARCH=OFF (e.g. vcpkg).
Results in GCC errors in sdot_k / _mm256_fmadd_ps due to missing -mfma.
My finding / root cause: commented HAVE_FMA3 block in cmake/cc.cmake.
Suggestion is to uncomment these lines in cmake/cc.cmake:
# if (HAVE_FMA3)
#set (CCOMMON_OPT "${CCOMMON_OPT} -mfma")
#endif ()
There used to be some compiler problem with having -mfma on all files, utils.cmake should be adding this option specifically for the sdot (and IIRC sgemv) kernels. I wonder if/why this does not work for you
I cannot reproduce this - which versions of OpenBLAS and gcc were you using ?