unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Diego Nicola Barbato <dnbarbato@posteo.de>
To: 40406@debbugs.gnu.org
Subject: bug#40406: python-matplotlib fails to build on i686-linux
Date: Mon, 08 Jun 2020 16:22:52 +0200	[thread overview]
Message-ID: <87zh9d8wn7.fsf@GlaDOS.home> (raw)
In-Reply-To: <878sh5a1bf.fsf@GlaDOS.home> (Diego Nicola Barbato's message of "Tue, 02 Jun 2020 18:18:28 +0200")

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]

Hey,

Diego Nicola Barbato <dnbarbato@posteo.de> writes:

[...]

> Apparently there is nothing wrong with the slider.  Instead matrix
> multiplication, which is used under the hood for transformations, seems
> to sometimes produce incorrect results on i686-linux.  I have reported
> this as a separate bug (https://debbugs.gnu.org/41665).

I got this wrong: This issue isn't caused by the Numpy bug, since
Matplotlib doesn't use Numpy for transformations.  Both bugs are caused
by the excess precision of the x87 FPU's floating point registers.

I've attached a patch which makes sure that the C and C++ extensions are
compiled with -ffloat-store.  This doesn't get rid of all possible
rounding errors but it's enough for the slider test to pass.

[...]

Regards,

Diego


[-- Attachment #2: 0001-gnu-python-matplotlib-Fix-rounding-errors-on-x86-CPU.patch --]
[-- Type: text/x-patch, Size: 1650 bytes --]

From 7c60615e29a1aab7922139183d191cc8cedd5c7f Mon Sep 17 00:00:00 2001
From: Diego Nicola Barbato <dnbarbato@posteo.de>
Date: Mon, 8 Jun 2020 02:31:17 +0200
Subject: [PATCH] gnu: python-matplotlib: Fix rounding errors on x86 CPUs.

Fixes <https://debbugs.gnu.org/40406>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

* gnu/packages/python-xyz.scm (python-matplotlib)[arguments]: Set the
environment variable CFLAGS to -ffloat-store.
---
 gnu/packages/python-xyz.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 94e63d1c74..f0b96c6fb0 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -81,6 +81,7 @@
 ;;; Copyright © 2020 Josh Holland <josh@inv.alid.pw>
 ;;; Copyright © 2020 Yuval Kogman <nothingmuch@woobling.org>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2020 Diego N. Barbato <dnbarbato@posteo.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4744,6 +4745,10 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
                ;; has not effect.
                (setenv "LD_LIBRARY_PATH" (string-append cairo "/lib"))
                (setenv "HOME" (getcwd))
+               ;; Fix rounding errors when using the x87 FPU.
+               ,@(if (string-prefix? "i686" (%current-system))
+                     '((setenv "CFLAGS" "-ffloat-store"))
+                     '())
                (call-with-output-file "setup.cfg"
                  (lambda (port)
                    (format port "[directories]~%
-- 
2.26.2


  parent reply	other threads:[~2020-06-08 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 15:20 bug#40406: python-matplotlib fails to build on i686-linux Diego Nicola Barbato
2020-04-03 16:18 ` Leo Famulari
2020-06-02 16:18   ` Diego Nicola Barbato
2020-06-02 17:39     ` Leo Famulari
2020-06-08 14:22     ` Diego Nicola Barbato [this message]
2020-11-15  3:14       ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh9d8wn7.fsf@GlaDOS.home \
    --to=dnbarbato@posteo.de \
    --cc=40406@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).