Bill Allombert on Wed, 03 Sep 2008 19:25:36 +0200

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

Re: Cross compiling PARI/what about autoconf?

On Wed, Sep 03, 2008 at 05:56:12PM +0200, Jeroen Demeyer wrote:
> Hello PARI developers,
> There is a certain thing which I have been wondering for a while, but 
> now it seems to have become more serious: why does PARI not use autoconf?

Autoconf was not invented when Configure was designed.

> I would like to cross-compile a powerpc64-unknown-linux-gnu version of 
> PARI on a powerpc-unknown-linux-gnu system, but I don't really know how 
> to do it (PARI Configure gives me a warning that architecture 
> powerpc64-unknown-linux-gnu is not tested and it assumes that 
> sizeof(long) == 4, which is clearly wrong!)

You need to set CC to your cross compiler. Assuming 'gcc -m64' work,
just do:

CC="gcc -m64" ./Configure

For cross building i386 code on amd64, I just do:

CC="gcc -m32" ./Configure

There is a nifty tool linux32/linux64 that change the uname setting
so that the 32 and 64-bit build get different names:
For example I do:

./Configure                       #amd64  build 
CC="gcc -m32" linux32 ./Configure # i386  build
make bench          #amd64 bench
linux32 make bench  # i386 bench

> Apart from this cross-compiling issue, I think there are tons of good 
> reasons to switch to autoconf.  In particular, it is something which 
> people know how to use, and I am sure that it will make it easier for 
> GNU/Linux distributions to include PARI.

Using autoconf would not address any issue at all, because autoconf is
essentially a languqge to build configure script, and know nothing
about compiling, buidling libraries, etc. and would create lot of issue
for people that build from SVN (they would need the same version of
autoconf). We are more confortable with the shell language.