GMP Module (perl)

Sisyphus kalinabears@iinet.net.au
Thu, 24 Jul 2003 11:58:29 +1000


----- Original Message -----
From: "Kevin Ryde" <user42@zip.com.au>
To: "Sisyphus" <kalinabears@iinet.net.au>
Cc: "GMP" <gmp-discuss@swox.com>
Sent: Thursday, July 24, 2003 11:25 AM
Subject: Re: GMP Module (perl)


> "Sisyphus" <kalinabears@iinet.net.au> writes:
> >
> > GMP.xs: In function `XS_GMP__Mpz_overload_add':
> > GMP.xs:1229: initializer element is not constant
> > GMP.xs:1229: (near initialization for `table[0].op')
>
> Hmm, yep, DLL imported functions don't work in initializers.  It'd be
> nice if gcc could do something to help that, since of course it's a
> fairly general problem.
>

Faik, they may have. The version of gcc that I'm using is getting a bit old.
I'll check with the gcc mailing list to see if more recent versions address
this problem.

> You might get more joy from a static build of gmp, or maybe it'd work
> to compile the generated GMP.c as C++ instead of C.
>

The second option sounds like one that should be fairly trivial to
implement. I don't know how to do that (off the top of my head) in a perl
build, but I should be able to work that out without too much difficulty.

I could, of course, simply use the msvc-built binaries with my gcc-built
perl. My reason for not doing so is that my (standard edition) msvc++ 6.0
does not perform optimisation. I'm not so sure that's a *valid* reason. The
GMP dll *was* built with an optimising compiler and, faik, it may well be
insignificant whether the actual perl module is built with an optimising
compiler or not. (If you have any views on that aspect I'd be interested to
hear them.)

Thanks Kevin.

Cheers,
Rob