Karim Belabas on Wed, 28 Jan 2004 19:16:25 +0100


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

Re: FreeBSD and Pari


* Karim Belabas [2004-01-28 13:42]:
> I have received the following report. Any comments ?
[...]
> ========================================================================
> I just compiled Pari on FreeBSD. There's a workaround for FreeBSD
> (version 2.2.5) in the source file pari-2.1.5/src/gp/highlvl.c. But with
> recent version of FreeBSD (>=4.x), this workaround is I think not needed
> any more and crashes the compilation.
>
> I'm not sure the problem is in Pari, because I compiled it through perl
> module Math::Pari. Maybe the problem is in Math::Pari.

After further investigations, the problem is indeed in Math::Pari.  If
HAS_DLOPEN is define'd, Math::Pari must define DL_DFLT_NAME in paricfg.h.

Compiling Math::Pari on FreeBSD yields

  cc -c  -I.././pari-2.1.5/src/headers -I.././pari-2.1.5/src/graph -I.
  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing
  -I/usr/local/include -O    -DVERSION=\"\"  -DXS_VERSION=\"\" -DPIC -fPIC
  -Derr=pari_err -DASMINLINE -DGCC_INLINE -DDYNAMIC_PLOTTING -o highlvl.o
  .././pari-2.1.5/src/gp/highlvl.c
  ../pari-2.1.5/src/gp/highlvl.c: In function `install0':
  ../pari-2.1.5/src/gp/highlvl.c:46: error: `DL_DFLT_NAME' undeclared
  (first use in this function)
  ../pari-2.1.5/src/gp/highlvl.c:46: error: (Each undeclared identifier
  is reported only once
  ../pari-2.1.5/src/gp/highlvl.c:46: error: for each function it appears
  in.)
  *** Error code 1

  Stop in /root/.cpan/build/Math-Pari-2.010500/libPARI.
  *** Error code 1

It broke only on FreeBSD (and Cygwin since recently). Now I have moved the
workaround to Configure land and define DL_DFLT_NAME so that 
dlopen( DL_DFLT_NAME ) returns a handle to the running process. 

DL_DFLT_NAME=NULL almost everywhere, except on FreeBSD because of that old bug
documented in the code, and Cygwin because it's still needed.

    Karim.
--
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425   Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]