Bug#841738: patch for building with PARI 2.9

Bill Allombert ballombe at debian.org
Sat Oct 22 23:01:40 UTC 2016


Package: lcalc
Version: 1.23+dfsg-5
Severity: important

Dear Debian science team,

lcalc will FTBFS when pari 2.9.0 is uploaded to Debian.

Please find two patches to fix that.
The first one fixes lcalc to use current function names.
(another way to fix this is to add
#include <pari/pariold.h>
to Lcommandline_elliptic.cc to add back the old names)

The second fixes an API change between pari 2.7 and 2.9.

With theses patches, lcalc should build with both PARI 2.7.6
and 2.9.0.

Cheers,
-- 
Bill. <ballombe at debian.org>

Imagine a large red swirl here. 
-------------- next part --------------
Index: lcalc-1.23+dfsg/src/Lcommandline_elliptic.cc
===================================================================
--- lcalc-1.23+dfsg.orig/src/Lcommandline_elliptic.cc
+++ lcalc-1.23+dfsg/src/Lcommandline_elliptic.cc
@@ -133,15 +133,15 @@ void data_E(char *a1, char *a2, char *a3
     //gaffsg(a4,(GEN) F[4]);
     //gaffsg(a6,(GEN) F[5]);
 
-    gaffect(strtoGEN(a1), (GEN) F[1]);
-    gaffect(strtoGEN(a2), (GEN) F[2]);
-    gaffect(strtoGEN(a3), (GEN) F[3]);
-    gaffect(strtoGEN(a4), (GEN) F[4]);
-    gaffect(strtoGEN(a6), (GEN) F[5]);
+    gaffect(gp_read_str(a1), (GEN) F[1]);
+    gaffect(gp_read_str(a2), (GEN) F[2]);
+    gaffect(gp_read_str(a3), (GEN) F[3]);
+    gaffect(gp_read_str(a4), (GEN) F[4]);
+    gaffect(gp_read_str(a6), (GEN) F[5]);
 
     E = ellinit(F, NULL, BIGDEFAULTPREC);
 
-    C=globalreduction(E);
+    C=ellglobalred(E);
 
     x=gtodouble((GEN) C[1]);
 
@@ -167,8 +167,8 @@ void data_E(char *a1, char *a2, char *a3
 
             p=n;
             gaffsg(p,y);
-            coeff[p] = Double(1.*llrint(gtodouble(apell(E,y))))/sqrt(Double(1.*p));
-            //coeff[p] = Double(1.*Long(gtodouble(apell(E,y))+.1))/sqrt(Double(1.*p));
+            coeff[p] = Double(1.*llrint(gtodouble(ellap(E,y))))/sqrt(Double(1.*p));
+            //coeff[p] = Double(1.*Long(gtodouble(ellap(E,y))+.1))/sqrt(Double(1.*p));
 
             if(gtolong(gmod((GEN) E[12],(GEN) y))==0) // if p|discriminant, i.e. bad reduction
             {
-------------- next part --------------
Author: Bill Allombert <ballombe at debian.org>

Index: lcalc-1.23+dfsg/src/Lcommandline.cc
===================================================================
--- lcalc-1.23+dfsg.orig/src/Lcommandline.cc
+++ lcalc-1.23+dfsg/src/Lcommandline.cc
@@ -473,7 +473,11 @@ int main (int argc, char *argv[])
 
 #ifdef INCLUDE_PARI
         if(do_elliptic_curve){
+#if PARI_VERSION_CODE >= PARI_VERSION(2,8,0)
+             paristack_resize((size_t)N_terms*16 + 1000000);
+#else
              pari_init_stack((size_t)N_terms*16 + 1000000, top-bot); // Allocate bigger PARI stack
+#endif
              if (my_verbose>0) cout << "Will precompute " << N_terms << " elliptic L-function dirichlet coefficients..." << endl;
              initialize_new_L(a1,a2,a3,a4,a6,N_terms); 
         }


More information about the debian-science-maintainers mailing list