+
+ # We don't have the full compiler version string yet (BUILD_C_COMPILER),
+ # so we can't distinguish vanilla and Apple clang, but catering for AMD
+ # hackintoshes is not worth the effort.
+ if (APPLE AND (${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR
+ ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
+ message(WARNING "Due to a known compiler bug, Clang up to version 3.2 (and Apple Clang up to version 4.1) produces incorrect code with AVX_128_FMA acceleration. As we can not work around this bug on OS X, you will have to select a different compiler or CPU acceleration.")
+ endif()
+
+ if (GMX_USE_CLANG_C_FMA_BUG_WORKAROUND)
+ # we assume that we have an external assembler that supports AVX
+ message(STATUS "Clang ${C_COMPILER_VERSION} detected, enabling FMA bug workaround")
+ set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -no-integrated-as")
+ endif()
+ if (GMX_USE_CLANG_CXX_FMA_BUG_WORKAROUND)
+ # we assume that we have an external assembler that supports AVX
+ message(STATUS "Clang ${CXX_COMPILER_VERSION} detected, enabling FMA bug workaround")
+ set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -no-integrated-as")
+ endif()
+