OpenBLAS icon indicating copy to clipboard operation
OpenBLAS copied to clipboard

Build error with CMake + DYNAMIC_ARCH=OFF + FMA3: _mm256_fmadd_ps compiled without -mfma (target specific option mismatch)

Open toblil opened this issue 1 month ago • 2 comments

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

toblil avatar Nov 16 '25 22:11 toblil

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

martin-frbg avatar Nov 17 '25 09:11 martin-frbg

I cannot reproduce this - which versions of OpenBLAS and gcc were you using ?

martin-frbg avatar Nov 24 '25 07:11 martin-frbg