[MacPorts] #18780: pari gives incorrect results with GMP 4.2.4
#18780: pari gives incorrect results with GMP 4.2.4 ---------------------------------+------------------------------------------ Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: pari gmp ---------------------------------+------------------------------------------ On my Mac OS X 10.4.11 (PowerPC), pari gives incorrect results with GMP 4.2.4 (i.e. with the gmp variant): {{{ prunille:~> gp Reading GPRC: /Users/vinc17/.gprc ...Done. GP/PARI CALCULATOR Version 2.3.4 (released) PowerPC running darwin (PPC/GMP-4.2.4 kernel) 32-bit version compiled: Mar 9 2009, gcc-4.0.1 (Apple Computer, Inc. build 5367) (readline v6.0 enabled, extended help available) Copyright (C) 2000-2006 The PARI Group PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER. Type ? for help, \q to quit. Type ?12 for how to get moral (and possibly technical) support. parisize = 4000000, primelimit = 500000 ? 17. %1 = 1.000000000000000002257486487 E72 }}} Can anyone reproduce this problem? If you have the same problem, do not use the gmp variant of pari. Note: I've reported the bug to both GMP and PARI developers. I hope that PARI developers will be able to give a simple testcase. -- Ticket URL: <http://trac.macports.org/ticket/18780> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ---------------------------------+------------------------------------------ Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: pari gmp ---------------------------------+------------------------------------------ Comment(by vinc17@…): Also note that I've built a universal version (ppc ppc64). -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ---------------------------------+------------------------------------------ Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: pari gmp ---------------------------------+------------------------------------------ Comment(by vinc17@…): I've got a reply from Bill Allombert (one of the PARI developer/maintainer). PARI requires sizeof(mp_limb_t)==sizeof(long)==sizeof(long*) so, it is not compatible with GMP built with ABI=mode32. There are several solutions: * Do not use mode32 in the gmp port. This is annoying because the problem is not in GMP. However this may break some other software (provided by MacPorts or not). PARI is one of them and will not be fixed. MPFR is affected too (in the printf functions with length modifier M), but I'll apply a patch. Moreover, though ABI=mode32 is faster than ABI=32, the user can use ABI=64 instead of ABI=mode32. * Never build pari against GMP for the ppc architecture. * Have a gmp variant to choose between ABI=32 and ABI=mode32, but this is rather dangerous (because if for some reason, the ABI is changed, programs based on GMP may more or less silently fail to work, such as giving incorrect results instead of a clear error). * Use a private version of GMP (statically linked?) for pari. -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ---------------------------------+------------------------------------------ Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: pari gmp ---------------------------------+------------------------------------------ Changes (by vinc17@…): * cc: mcalhoun@… (added) Comment: Adding the maintainer of the gmp port to Cc. -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ---------------------------------+------------------------------------------ Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: pari gmp ---------------------------------+------------------------------------------ Comment(by mcalhoun@…): If mode32 already causes issues with two ports (pari and mpfr), then my initial reaction would be to abandon it for ABI=32. What is even worse, the error, at least in the case of pari, only showed up because of erronous results.[[BR]] I suspect that most projects based on gmp didn't do any testing on a PowerPC G5 processor, so ABI=32 seems a safer choice. -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ---------------------------------+------------------------------------------ Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: pari gmp ---------------------------------+------------------------------------------ Comment(by vinc17@…): The bug in MPFR is now fixed in MacPorts (note that MPFR wasn't assuming that a limb fitted in a long, it was just a confusion between a limb and a pointer to a limb). However there may be problems with other software than PARI. Unfortunately this is difficult to know, because such problems can arise under some conditions only (e.g. when some data become large enough to have some kind of overflow if a limb is stored in an unsigned long) and one may just get incorrect results, thus the error may not necessarily be detected. I don't know if many programs need to convert a limb into an explicit C native type or use a *_ui function (such as mpz_set_ui) on a limb. -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ---------------------------------+------------------------------------------ Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: pari gmp ---------------------------------+------------------------------------------ Comment(by mcalhoun@…): mode32 was removed in r47978.[[BR]] I think this is probably the safer choice. Does this fix pari? -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ----------------------------------+----------------------------------------- Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Resolution: fixed | Keywords: Port: pari gmp | ----------------------------------+----------------------------------------- Changes (by mcalhoun@…): * status: new => closed * resolution: => fixed -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18780: pari gives incorrect results with GMP 4.2.4 ----------------------------------+----------------------------------------- Reporter: vinc17@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Resolution: fixed | Keywords: Port: pari gmp | ----------------------------------+----------------------------------------- Comment(by vinc17@…): I confirm that the change fixes the problem in pari. -- Ticket URL: <http://trac.macports.org/ticket/18780#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts