From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: bug#22049: libreoffice compile error Date: Mon, 29 Feb 2016 03:37:23 -0500 Message-ID: <20160229083723.GA18766@jasmine> References: <21c1059e083d3df68b981cb1a83b3a7c@openmailbox.org> <877fl0lugc.fsf@gnu.org> <931b1698a0a6d10913db88e944622dc4@openmailbox.org> <20151130195654.GA32198@jasmine> <87h9gsvhep.fsf@gnu.org> <20160229083540.GA18295@jasmine> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PNTmBPCT7hxwcZjr" Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaJLC-0005pM-SH for bug-guix@gnu.org; Mon, 29 Feb 2016 03:38:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaJL8-0003aC-M1 for bug-guix@gnu.org; Mon, 29 Feb 2016 03:38:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:54707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaJL8-0003a8-IU for bug-guix@gnu.org; Mon, 29 Feb 2016 03:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aaJL8-00062v-Eu for bug-guix@gnu.org; Mon, 29 Feb 2016 03:38:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <20160229083540.GA18295@jasmine> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: rennes@openmailbox.org, 22049@debbugs.gnu.org --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Feb 29, 2016 at 03:35:40AM -0500, Leo Famulari wrote: > On Sun, Feb 28, 2016 at 07:06:22PM +0100, Ludovic Courtès wrote: > > Leo Famulari skribis: > > > It looks like the problem is with a libreoffice dependency, ilmbase. > > > Looking at the build history on hydra.gnu.org, it hasn't built > > > successfully since at least 2015-02-25: > > > http://hydra.gnu.org/job/gnu/master/ilmbase-2.2.0.i686-linux > > > > The problem appears to be fixed in IlmBase 2.0.1: > > > > https://github.com/openexr/openexr/issues/3 > > > > Would you like to try? > > We currently package 2.2.0. I did read that bug report, and then kept > reading, until I came to the Debian bug report [0], where Steven > Chamberlain linked to our bug report with OpenEXR and produced two > patches that Debian has merged into their "unstable" branch. > > I've attached my (working) attempt at conditionally applying these > patches on i686-* architectures. Please feel free to criticize or modify > this patch :) I forgot the attachment. Here it is! > > I copied the patches from [1]. > > Thanks for the reminder! > > [0] > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815712 > > [1] > https://sources.debian.net/src/ilmbase/2.2.0-11/debian/patches/ > > [2] > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815712#194 > > Relevant commit in Debian ilmbase packaging repo: > https://anonscm.debian.org/cgit/pkg-phototools/ilmbase.git/commit/?id=ab28bb45cdad8adc32e345b777ab8e692b1d9a9c > > > --PNTmBPCT7hxwcZjr Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-ilmbase-Add-patches-to-fix-build-on-i686.patch" Content-Transfer-Encoding: 8bit >From bf1f2a1c3621ba93ec99711ec78a79663acb6e82 Mon Sep 17 00:00:00 2001 Message-Id: From: Leo Famulari Date: Mon, 29 Feb 2016 02:23:43 -0500 Subject: [PATCH 1/1] gnu: ilmbase: Add patches to fix build on i686. Fixes . * gnu/packages/patches/ilmbase-testBox.patch, gnu/packages/patches/ilmbase-testBoxAlgo.patch: New files. * gnu-system.am (dist_patch_DATA): Add them. * gnu/packages/graphics.scm (ilmbase)[native-inputs]: Add patch/testBox and patch/testBoxAlgo. [arguments]: Add 'patch-for-i686' phase. --- gnu-system.am | 2 + gnu/packages/graphics.scm | 29 ++++++ gnu/packages/patches/ilmbase-testBox.patch | 121 +++++++++++++++++++++++++ gnu/packages/patches/ilmbase-testBoxAlgo.patch | 41 +++++++++ 4 files changed, 193 insertions(+) create mode 100644 gnu/packages/patches/ilmbase-testBox.patch create mode 100644 gnu/packages/patches/ilmbase-testBoxAlgo.patch diff --git a/gnu-system.am b/gnu-system.am index 502993b..42673c5 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -529,6 +529,8 @@ dist_patch_DATA = \ gnu/packages/patches/icu4c-CVE-2014-6585.patch \ gnu/packages/patches/icu4c-CVE-2015-1270.patch \ gnu/packages/patches/icu4c-CVE-2015-4760.patch \ + gnu/packages/patches/ilmbase-testBox.patch \ + gnu/packages/patches/ilmbase-testBoxAlgo.patch \ gnu/packages/patches/imagemagick-test-segv.patch \ gnu/packages/patches/irrlicht-mesa-10.patch \ gnu/packages/patches/jasper-CVE-2007-2721.patch \ diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index 560febe..0d99b4e 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Ludovic Courtès ;;; Copyright © 2015 Tomáš ÄŒech +;;; Copyright © 2016 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -91,6 +92,34 @@ many more.") (base32 "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c")))) (build-system gnu-build-system) + + ;; ilmbase fails to build from source on the i686 architecture due to a + ;; rounding issue. These patches are applied only when building on or for + ;; i686. + + ;; Please refer to: + ;; https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html + ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815712 + (native-inputs + (if (string-prefix? "i686" (or (%current-target-system) (%current-system))) + `(("patch/testBox" + ,(search-patch "ilmbase-testBox.patch")) + ("patch/testBoxAlgo" + ,(search-patch "ilmbase-testBoxAlgo.patch"))) + '())) + (arguments + (if (string-prefix? "i686" (or (%current-target-system) (%current-system))) + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-for-i686 + (lambda* (#:key inputs #:allow-other-keys) + (let ((patches (list (assoc-ref inputs "patch/testBox") + (assoc-ref inputs "patch/testBoxAlgo")))) + (and (map (lambda (patches) + (zero? + (system* "patch" "-p1" "--input" patches))) + patches))))))) + '())) (home-page "http://www.openexr.com/") (synopsis "Utility C++ libraries for threads, maths, and exceptions") (description diff --git a/gnu/packages/patches/ilmbase-testBox.patch b/gnu/packages/patches/ilmbase-testBox.patch new file mode 100644 index 0000000..a947df3 --- /dev/null +++ b/gnu/packages/patches/ilmbase-testBox.patch @@ -0,0 +1,121 @@ +Fix FTBFS on i686-linux due to rounding issue (see references). + +Fixes Guix bug #22049 (see below). + +Copied from Debian. + +Source: +https://sources.debian.net/src/ilmbase/2.2.0-11/debian/patches/testBoxAlgo.patch/ + +References: +https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22049 +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815712 +https://anonscm.debian.org/cgit/pkg-phototools/ilmbase.git/commit/?id=ab28bb45cdad8adc32e345b777ab8e692b1d9a9c + +--- + +Subject: testBox: allow fuzzy comparison of floats, doubles +From: Steven Chamberlain +Date: Wed, 24 Feb 2016 01:10:11 +0000 + +Allow for inexact values, as long as the error is smaller than the +epsilon of the data type. + +On 32-bit x86, allow even greater discrepency at double +precision, due to possible double-rounding. See +https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html + +Index: ilmbase/ImathTest/testBox.cpp +=================================================================== +--- ilmbase.orig/ImathTest/testBox.cpp ++++ ilmbase/ImathTest/testBox.cpp +@@ -47,6 +47,58 @@ using namespace IMATH_INTERNAL_NAMESPACE + + namespace { + ++template ++bool ++approximatelyEqual (const T &p1, const T &p2) ++{ ++ /* int and short should be exact */ ++ return (p1 == p2); ++} ++ ++bool ++approximatelyEqual (const Vec2 &p1, const Vec2 &p2) ++{ ++ float e = limits::epsilon(); ++ float m = 0; ++ ++ for (int i = 0; i < 2; ++i) ++ { ++ m = max (m, abs (p1[i])); ++ m = max (m, abs (p2[i])); ++ } ++ ++ for (int i = 0; i < 2; ++i) ++ if (!equalWithAbsError (p1[i], p2[i], m * e)) ++ return false; ++ ++ return true; ++} ++ ++bool ++approximatelyEqual (const Vec2 &p1, const Vec2 &p2) ++{ ++#if defined(__i386__) || defined(_M_IX86) ++ /* double-rounding on 32-bit x86 may cause larger error: ++ use epsilon of float rather than double */ ++ double e = limits::epsilon(); ++#else ++ double e = limits::epsilon(); ++#endif ++ double m = 0; ++ ++ for (int i = 0; i < 2; ++i) ++ { ++ m = max (m, abs (p1[i])); ++ m = max (m, abs (p2[i])); ++ } ++ ++ for (int i = 0; i < 2; ++i) ++ if (!equalWithAbsError (p1[i], p2[i], m * e)) ++ return false; ++ ++ return true; ++} ++ + // + // Test case generation utility - create a vector of IMATH_INTERNAL_NAMESPACE::Vec{2,3,4} + // with all permutations of integers 1..T::dimensions(). +@@ -250,7 +302,8 @@ testExtendByPoint(const char *type) + + IMATH_INTERNAL_NAMESPACE::Box b; + b.extendBy(p); +- assert(b.min == p && b.max == p); ++ assert (approximatelyEqual (b.min, p)); ++ assert (approximatelyEqual (b.max, p)); + } + + // +@@ -283,7 +336,8 @@ testExtendByPoint(const char *type) + + b.extendBy(p); + +- assert(b.min == min && b.max == max); ++ assert (approximatelyEqual (b.min, min)); ++ assert (approximatelyEqual (b.max, max)); + } + } + } +@@ -358,7 +412,8 @@ testExtendByBox(const char *type) + } + b.extendBy(IMATH_INTERNAL_NAMESPACE::Box(p0, p1)); + +- assert(b.min == min && b.max == max); ++ assert (approximatelyEqual (b.min, min)); ++ assert (approximatelyEqual (b.max, max)); + } + } + } diff --git a/gnu/packages/patches/ilmbase-testBoxAlgo.patch b/gnu/packages/patches/ilmbase-testBoxAlgo.patch new file mode 100644 index 0000000..06752e3 --- /dev/null +++ b/gnu/packages/patches/ilmbase-testBoxAlgo.patch @@ -0,0 +1,41 @@ +Fix FTBFS on i686-linux due to rounding issue (see references). + +Fixes Guix bug #22049 (see below). + +Copied from Debian. + +Source: +https://sources.debian.net/src/ilmbase/2.2.0-11/debian/patches/testBox.patch/ + +References: +https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22049 +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815712 +https://anonscm.debian.org/cgit/pkg-phototools/ilmbase.git/commit/?id=ab28bb45cdad8adc32e345b777ab8e692b1d9a9c + +--- + +Subject: testBoxAlgo: allow fuzzy match of b12 == b2 +From: Steven Chamberlain +Date: Wed, 24 Feb 2016 01:04:11 +0000 + +Also fix a pre-existing typo. + +Index: ilmbase/ImathTest/testBoxAlgo.cpp +=================================================================== +--- ilmbase.orig/ImathTest/testBoxAlgo.cpp ++++ ilmbase/ImathTest/testBoxAlgo.cpp +@@ -886,10 +886,11 @@ boxMatrixTransform () + + assert (approximatelyEqual (b2.min, b4.min, e)); + assert (approximatelyEqual (b2.max, b4.max, e)); +- assert (approximatelyEqual (b3.max, b4.max, e)); ++ assert (approximatelyEqual (b3.min, b4.min, e)); + assert (approximatelyEqual (b3.max, b4.max, e)); + +- assert (b21 == b2); ++ assert (approximatelyEqual (b2.min, b21.min, e)); ++ assert (approximatelyEqual (b2.max, b21.max, e)); + assert (b31 == b3); + + M[0][3] = 1; -- 2.7.1 --PNTmBPCT7hxwcZjr--