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 ()