From 2e7a27e66b07e44f09c04e197e853dc60d6a14df Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 17 Apr 2023 23:32:00 +0100 Subject: [PATCH] pkgsi686Linux.openexr_3: enforce SSE arithmetics (instead of x87) On i686 with x87 80-bit FPU precision tests fail as: F float at 59, 0 not equal: C++ loaded C 0x7f84e300 (nan) vs C++ loaded C++ 7fc4e300 (nan) Core Test failed: a.iv == b.iv file:/build/source/src/test/OpenEXRCoreTest/compression.cpp line:423 function:static void pixels::compareExact(float, float, int, int, const char*, const char*, const char*) Force SSE arithmetic to get expected rounding and precision. --- pkgs/development/libraries/openexr/3.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/libraries/openexr/3.nix b/pkgs/development/libraries/openexr/3.nix index 4cf535cb2f94..5ab6ecf2f3d5 100644 --- a/pkgs/development/libraries/openexr/3.nix +++ b/pkgs/development/libraries/openexr/3.nix @@ -32,6 +32,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; propagatedBuildInputs = [ imath zlib ]; + # Without 'sse' enforcement tests fail on i686 as due to excessive precision as: + # error reading back channel B pixel 21,-76 got -nan expected -nan + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse"; + doCheck = true; meta = with lib; {