Bill Allombert on Fri, 12 Aug 2011 11:26:32 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: polroots: impossible inverse


On Fri, Aug 12, 2011 at 03:16:28PM +0800, Gordon Royle wrote:
> I have just compiled Pari/GP for Mac OS X (10.7) from source.
> 
> When I try
> 
> p = 0+(0*x^0)+(0*x^1)+(11*x^2)+(-25*x^3)+(20*x^4)+(-7*x^5)+(1*x^6);
> polrootsâ
> 
> I get
> 
> ? polroots(p)
>   ***   at top-level: polroots(p)
>   ***                 ^-----------
>   *** polroots: impossible inverse modulo: Mod(4, 27457).
>   ***   Break loop: type 'break' to go back to GP
> 
> 
> Why is this?

Every new Mac OS X major release comes with a broken compiler.  This one generates
wrong code for the modular inverse code.

To work around this problem, you can do:

rm Odarwin-i386/mp.o; make -C Odarwin-i386 gp CFLAGS="-O0 -fno-strict-aliasing"

but you will get a slow binary.

Better is to install gcc 4.5 and use it instead.

Cheers,
Bill.
PS: please note the new list address.