Karim BELABAS on Thu, 17 Apr 2003 00:36:21 +0200 (MEST)

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

Re: Cygwin + DLL

On Sun, 6 Apr 2003, Ilya Zakharevich wrote:
> On Sun, Apr 06, 2003 at 05:31:00PM +0200, Karim BELABAS wrote:
> >   I have downloaded a recent Cygwin version to try and build that ellusive
> > libpari.dll, which has been periodically requested, and which I had been
> > unable to build so far [ actually, I could get the DLL to build, but gp-dyn
> > crashed ].
> The recent Math::Pari build DLLs not only with Cygwin, but with mingw
> and M$ cl as well.  So the simplest way out may be to modify the
> export list (FUNCLIST of the toplevel Makefile.PL) so that the
> resulting DLL works with gp-dyn.

I checked out Math-Pari-2.010402 (dated Mar 21 2003, which looked recent
enough) and I can't find FUNCLIST anywhere.

> > 1) install() does not work with gp-sta. install itself seems to behave
> > correctly, but the DLL is apparently not properly loaded and gp-sta segfaults
> > when calling the installed function [ later, it actually crashed XP... ].
> > Since gp-dyn is (much smaller and) a little faster than gp-sta, it is not a
> > major problem. I changed Configure to build gp-dyn.exe by default.
> Did you create the export list for the EXE file?  [This does not work
> on OS/2, so I can't be of more assistance; but this is reported to
> work on Win32.]

I hardly did anything: I simply call

  gcc -shared -Wl,--out-implib=\$(LIBPARI_SO)\$(_A),--export-all-symbol

which should do all the necessary magic [ the --export-all-symbol may be
overkill ]. Linking gp-sta.exe with or without the import library
(libpari.dll.a above) doesn't change a thing: dlopen() works, but calling any
installed routine produces a SEGV.

Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425   Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://www.parigp-home.de/  [PARI/GP]