Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2021-01-14 19:32:21 +0300
committerSebastian Parborg <darkdefende@gmail.com>2021-01-14 19:37:39 +0300
commit0815e2fdb15f27e4b62196d7b2725b0b235c9c6b (patch)
tree9fd602655c02488ebb2aa9710c0bace821e57acf /build_files
parente5ee7e9a2df93d7f28f9e1f8bc0eb2d33dfadfb4 (diff)
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
Diffstat (limited to 'build_files')
-rw-r--r--build_files/cmake/platform/platform_unix.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index b304e89d74f..abacd0500e5 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -610,7 +610,13 @@ endif()
# GNU Compiler
if(CMAKE_COMPILER_IS_GNUCC)
- set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
+ # ffp-contract=off:
+ # Automatically turned on when building with "-march=native". This is
+ # explicitly turned off here as it will make floating point math give a bit
+ # different results. This will lead to automated test failures. So disable
+ # this until we support it. Seems to default to off in clang and the intel
+ # compiler.
+ set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off")
# `maybe-uninitialized` is unreliable in release builds, but fine in debug builds.
set(GCC_EXTRA_FLAGS_RELEASE "-Wno-maybe-uninitialized")