Gordon Royle on Tue, 16 Aug 2011 05:52:35 +0200

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

Re: polroots: impossible inverse

Unfortunately I still can't make it work, though probably it is my configuration rather than any problem with Pari.

Anyway, just in case anyone can help, here is the situation:

- new machine running Mac OS X Lion 64-bit kernel (uname -m returns x86_64)
- fink-installed version of gcc4.6 (no version 4.5 for Lion)

However I can't figure out how to actually change the pari-gp configure or makefile to use the gcc4.6 and nor can I work out how to make gcc4.6 the default compiler for everything.

(I did try the dumbest thing, which was just to point the symlink /usr/bin/gcc to the new version of gcc, and it compiled ok, but immediately crashed on starting gp)

Any help would be appreciated, though I understand this problem is getting pretty peripheral to the list..

On 12/08/2011, at 5:26 PM, Bill Allombert wrote:

> 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.

Professor Gordon Royle
School of Mathematics and Statistics
University of Western Australia