Ilya Zakharevich on Mon, 18 Jun 2001 03:44:19 -0400


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

Re: Can't build Math::PARI


On Fri, Jun 15, 2001 at 02:22:31PM +0200, Karim.Belabas wrote:
> I checked with perl-5.005_03 on Solaris, and indeed it was quite tough to
> get Math::PARI to compile:

All of your patches but one fix thing fixed long ago already...

> b) The shared library Pari.so eventually produced is incorrect:
> 
>   ld.so.1: /home/belabas/bin/solaris/perl: elf error:
>   blib/arch/auto/Math/Pari/Pari.so: bad ELF type: ET_NONE at
>   /usr/local/lib/perl5/5.00503/sun4-solaris/DynaLoader.pm line 169.

What is your link line?  What I see is

LD_RUN_PATH="/lib:/opt/SUNWspro/lib" cc -o
  blib/arch/auto/Math/Pari/Pari.so -R/lib -G -L/opt/local/lib
  -L/opt/gnu/lib Pari.o libPARI/libPARI.a -lm -R/opt/SUNWspro/lib
  -L/opt/SUNWspro/lib -lsunmath -lm

> *** ./Pari.xs.orig	Fri Jun 15 14:04:45 2001
> --- ./Pari.xs	Fri Jun 15 14:05:07 2001
> ***************
> *** 1,7 ****
> - #include <pari.h>
> - #include <language/anal.h>
> - #include <gp/gp.h>			/* init_opts */
> - 
>   #define PERL_POLLUTE			/* We use older varnames */
>   
>   #ifdef __cplusplus
> --- 1,3 ----
> ***************
> *** 15,20 ****
> --- 11,20 ----
>   #ifdef __cplusplus
>   }
>   #endif 
> + 
> + #include <pari.h>
> + #include <language/anal.h>
> + #include <gp/gp.h>			/* init_opts */
>   
>   /* This should not be defined at this moment, but in 5.001n is. */
>   #ifdef coeff

This inverts the difference between 2.001803 and 2.001804.  2.001803
does not work with multithreaded perl, since `na' becomes a macro, and
paridecl.h mentions na.

> 3) Header files get tangled up (/usr/include/sys/dl.h attempts to declare
> ladd which pari.h already defined with a different meaning)

Who includes this file?  The solution may be to

#define ladd NonPARI_ladd
...
#undef ladd

around the stuff which includes this file.  Please check if you can.
Or probably it is better to wrap the PARI includes with a similar
protection, since Pari.xs most probably is not mentioning ladd()...

Ilya