Clang apparently produces buggy code both for verlet kernels
and group kernels when the AVX_128_FMA acceleration is enabled.
Since it happens in two places it is unlikely to be a minor
bug, and since it covers versions up to the currently
released one, we don't have much choice but to disallow this
combination for now.
Fixes #1099.
Change-Id: If8346fa0a58f51a0ef6ac16e4801fe98ad1c73c9
# Set the FMA4 flags (MSVC doesn't require any)
if(${GMX_CPU_ACCELERATION} STREQUAL "AVX_128_FMA" AND NOT MSVC)
+ if (${CMAKE_COMPILER_ID} MATCHES "Clang")
+ message(FATAL_ERROR "Clang up to at least version 3.2 produces incorrect code for AVX_128_FMA. Sorry, but you will have to select a different compiler or acceleration.")
+ endif()
GMX_TEST_CFLAG(GNU_FMA_CFLAG "-mfma4" ACCELERATION_C_FLAGS)
if (NOT GNU_FMA_CFLAG)
message(WARNING "No C FMA4 flag found. Consider a newer compiler, or try SSE4.1 (lower performance).")