From 0815e2fdb15f27e4b62196d7b2725b0b235c9c6b Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Thu, 14 Jan 2021 17:32:21 +0100 Subject: Fix automated tests when building with GCC and march=native When building with more aggressive optimization flags, GCC will add FMA (Fused Multiply Add) instructions that will slightly alter the floating point operation results. This causes some automated tests to fail in blender. In clang and the intel compiler ffp-contract is set to off per default it seems from my research. (They do not have the exact same setting, but the default seems to match the off behavior) Reviewed By: Brecht Differential Revision: http://developer.blender.org/D9047 --- intern/cycles/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'intern/cycles/CMakeLists.txt') diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index b1bb1d3654d..8167576a177 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -379,6 +379,9 @@ endif() # Subdirectories if(WITH_CYCLES_BLENDER) + # Not needed to make cycles automated tests pass with -march=native. + # However Blender itself needs this flag. + remove_cc_flag("-ffp-contract=off") add_definitions(-DWITH_BLENDER_GUARDEDALLOC) add_subdirectory(blender) endif() -- cgit v1.2.3