Karim Belabas on Wed, 06 May 2009 10:26:00 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Updating an old C program which uses parilib |
* Bill Allombert [2009-05-05 17:30]: > On Tue, May 05, 2009 at 10:58:16AM -0400, Jack Fearnley wrote: > > I am trying to run a program I wrote and ran successfully some years > > back. It computes Dirichlet twists of elliptic L-functions. The > > program uses lisGEN which seems no longer to exist. The usage is > > ee = smallinitell(lisGEN(stdin)); > > where stdin contains [0,1,0,4,4] for example. > > > > There seems to be no exact replacement for this function so I am using > > scanf to read the five coefficients as longs and then using mkvecn to > > package the coefficients into a vector. > > scanf("%ld %ld %ld %ld %ld",&c1,&c2,&c3,&c4,&c5); > > printf("%ld %ld %ld %ld %ld \n",c1,c2,c3,c4,c5); > > eee=mkvecn(5,(GEN)c1,(GEN)c2,(GEN)c3,(GEN)c4,(GEN)c5); > > ee = smallinitell(eee); > > > > Where ee and eee are defined as GEN. > > > > The printed result is > > > > > > 0 1 0 4 4 > > > > *** segmentation fault: bug in PARI or calling program. > > *** Error in the PARI system. End of program. > > > > 1) Is there an exact replacement for lisGEN? > > yes, gp_read_stream. thought it seems we forgot to add it to the COMPAT > file. [...] > > 3) Where did gzero go? > > It has been renamed to gen_0, see the COMPAT file. There is something fishy in Jack's setup: for backward compatibility both gzero and lisGEN are aliased to the correct names (given above) in the file pariold.h. That file should have been installed in /usr/local/include/pari/. Are your header files up to date ? (and properly included, they may be overridden by another older install) What exact version of PARI are you trying to run ? Cheers, K.B. P.S: There has been a massive cleanup in libpari names: - lisGEN has been obsoleted about four years age, and successively renamed readexpr(), then freadexpr(), before the new name settled in. Reason: french name. - gun, gzero & friends have been renamed : 'gun' was way too short ( and french ), 'un' was even worse ! -- Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17 Universite Bordeaux 1 Fax: (+33) (0)5 40 00 69 50 351, cours de la Liberation http://www.math.u-bordeaux1.fr/~belabas/ F-33405 Talence (France) http://pari.math.u-bordeaux1.fr/ [PARI/GP] `