Ticket #14539: pari-2.5.4.p0.diff

File pari-2.5.4.p0.diff, 13.9 KB (added by jdemeyer, 6 years ago)
  • SPKG.txt

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1367855048 -7200
    # Node ID f8c9ddb081c960cf3c63d0b346dec72437547de5
    # Parent  728506361a456665c4db91c09f10d8a7f0700022
    Trac #14539: upgrade to version 2.5.4.
    Improve documentation of patches.
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    6969
    7070== Changelog ==
    7171
     72=== pari-2.5.4.p0 (Jeroen Demeyer, 13 May 2013) ===
     73 * Trac #14539: upgrade to version 2.5.4.
     74 * Improve documentation of patches.
     75
    7276=== pari-2.5.3.p3 (Jeroen Demeyer, 31 January 2013) ===
    7377 * Trac #13054: polred.patch: fix polred() bug.
    7478 * Trac #6743: remove Cygwin-specific hacks from spkg-install.
  • patches/README.txt

    diff --git a/patches/README.txt b/patches/README.txt
    a b  
    33======================================================================
    44
    55Patches to configuration files:
    6 * get_ld.patch: cwitty: Disable -rpath.
    7 * get_tests.patch: John Cremona: Disable testing of ellglobalred in
     6* get_ld.patch (Carl Witty): Disable -rpath.
     7* get_tests.patch (John Cremona): Disable testing of ellglobalred in
    88  "make test-all" in spkg-check, since it requires the elldata database
    99  which we do not include since it is about 18MB.
    10 * get_config_options.patch: leif: Catch invalid arguments to "--graphic"
    11   (and treat such as an error) since otherwise strange compilation errors
    12   might occur (cf. #9722, too).
    13 * get_fltk.patch: leif: Explicitly link against libstdc++ when using FLTK
    14   (for plotting) to support Fedora 13, and do an extra check for the FLTK
    15   include dir (cf. #9722).
    16 * get_X11.patch: leif: Also search */lib64/* for X11 libraries (since on
    17   some systems this is really a separate directory, i.e. neither a
    18   symbolic link to */lib/* nor the target of a symbolic link */lib/*; cf.
    19   #9722, too).
    20 * get_dlcflags.patch: jdemeyer: Add -fno-common to DLCFLAGS on Darwin.
    21   Fixed upstream, but only for PowerPC. Since this doesn't break anything
    22   and only improves performance, add the flag unconditionally.
    23 * install_doc_no_make.patch: jdemeyer: Do not *build* the documentation
    24   when doing install-doc or install-docpdf.  We must not build the
    25   documentation because that requires tex.  On the other hand, to have ?
    26   and ?? work within gp, we must install the .tex files (but not .dvi
    27   files).  So simply not doing install-doc doesn't work.
    28 * perl_path.patch: jdemeyer: change first line of all perl scripts
    29   to "#!/usr/bin/env perl" (#10559).
    30 * cygwin_dll_a.patch: jpflori: copy libpari.dll.a on Cygwin (#13333).
    31 * KERNELCFLAGS.patch: when SAGE_DEBUG=yes, compile kernel files with
    32   -O1 instead of -funroll-loops; -O0 gives a segmentation fault on some
    33   OS X systems when doing factor(10356613*10694706299664611221)
    34   (#13921).
     10* get_config_options.patch (Leif Leonhardy): Catch invalid arguments to
     11  "--graphic" (and treat such as an error) since otherwise strange
     12  compilation errors might occur (cf. #9722, too).
     13* get_fltk.patch (Leif Leonhardy): Explicitly link against libstdc++
     14  when using FLTK (for plotting) to support Fedora 13, and do an extra
     15  check for the FLTK include dir (cf. #9722).
     16* get_X11.patch (Leif Leonhardy): Also search */lib64/* for X11
     17  libraries (since on some systems this is really a separate directory,
     18  i.e. neither a symbolic link to */lib/* nor the target of a symbolic
     19  link */lib/*; cf. #9722, too).
     20* get_dlcflags.patch (Jeroen Demeyer): Add -fno-common to DLCFLAGS on
     21  Darwin. Submitted upstream, but upstream only applied it for PowerPC.
     22  Since this doesn't break anything and only improves performance, add
     23  the flag unconditionally.
     24* install_doc_no_make.patch (Jeroen Demeyer): Do not *build* the
     25  documentation when doing install-doc or install-docpdf.  We must not
     26  build the documentation because that requires tex.  On the other hand,
     27  to have ? and ?? work within gp, we must install the .tex files (but
     28  not .dvi files).  So simply not doing install-doc doesn't work.
     29* perl_path.patch (Jeroen Demeyer): change first line of all perl
     30  scripts to "#!/usr/bin/env perl" (#10559).
     31* cygwin_dll_a.patch (Jean-Pierre Flori): copy libpari.dll.a on Cygwin
     32  (see #13333).
     33* KERNELCFLAGS.patch (Jeroen Demeyer): when SAGE_DEBUG=yes, compile
     34  kernel files with -O1 instead of -funroll-loops; -O0 gives a
     35  segmentation fault on some OS X systems when doing
     36  factor(10356613*10694706299664611221)
     37  See #13921, also reported upstream:
     38  - http://pari.math.u-bordeaux.fr/archives/pari-dev-1301/msg00000.html
    3539
    3640C files:
    37 * src/kernel/gmp/mp.c:
     41* src/kernel/gmp/mp.c (Leif Leonhardy):
    3842  Do not override GMP's memory functions.
    3943  In addition, let PARI use "GMP internals" (access members of GMP
    4044  structures directly) *conditionally*. (We *don't* disable that by
     
    4246  *and* MPIR. To disable the use, add "-DPARI_DONT_USE_GMP_INTERNALS"
    4347  to CFLAGS. This is a trivial patch to mp.c only; see also the comment
    4448  there.):
    45 * GCC_PR49330.patch: in pari_init_functions(), reorder code to work
    46   around a GCC bug concerning pointer arithmetic:
     49* GCC_PR49330.patch (Jeroen Demeyer): in pari_init_functions(), reorder
     50  code to work around a GCC bug concerning pointer arithmetic:
    4751  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49330
    4852  This bug manifests itself as a Bus Error on OS X 10.4 PPC with
    49   gcc-4.6.3.
    50 * trac_13902_determinant.patch: patch backported from upstream git
    51   repository based on commits
     53  gcc-4.6.3. Discussed with upstream:
     54  - http://pari.math.u-bordeaux.fr/archives/pari-dev-1203/msg00001.html
     55  - http://pari.math.u-bordeaux.fr/archives/pari-dev-1202/msg00006.html
     56* trac_13902_determinant.patch (Jeroen Demeyer): patch backported from
     57  upstream git repository based on commits
    5258  - 28ea998bc661f5bbde18b6d6b0f50111a10ae16c
    5359  - 249432f7088bfa114ed5cd3a5d64ef51ee968e35
    54 * galoisanalysis_p4.patch: fix segmentation fault under Electric Fence.
    55 * polred.patch: Fix polred(), add polredbest() based on upstream commits
     60* polred.patch (Jeroen Demeyer): Fix polred(), add polredbest()
     61  backported from upstream commits
    5662  - 2d00a24fbb1ffe8eba35b9a04763e36eef8a5f7b
    5763  - a3596c56f9439144a0dbed4c47bd6ff9485e3fc8
    5864  - 1a00ca416de4daebccaab2be1a4b8a061a9f2fde
  • deleted file patches/galoisanalysis_p4.patch

    diff --git a/patches/galoisanalysis_p4.patch b/patches/galoisanalysis_p4.patch
    deleted file mode 100644
    + -  
    1 commit e87d56e7d48081c0f137af4838f887300e6ba344
    2 Author: Jeroen Demeyer <jdemeyer@cage.ugent.be>
    3 Date:   Wed Jan 2 14:35:24 2013 +0100
    4 
    5     galoisanalysis: only copy O[4] if n >= 4
    6 
    7 diff --git a/src/basemath/galconj.c b/src/basemath/galconj.c
    8 index ed1fdfb..8a2f071 100644
    9 --- a/src/basemath/galconj.c
    10 +++ b/src/basemath/galconj.c
    11 @@ -1288,7 +1288,7 @@ galoisanalysis(GEN T, struct galois_analysis *ga, long calcul_l)
    12    ga->deg = deg;
    13    ga->ord = order;
    14    ga->l  = O[1];
    15 -  ga->p4 = O[4];
    16 +  ga->p4 = (n >= 4 ? O[4] : 0);
    17    if (DEBUGLEVEL >= 4)
    18      err_printf("GaloisAnalysis:p=%ld l=%ld group=%ld deg=%ld ord=%ld\n",
    19                 plift, O[1], group, deg, order);
  • patches/perl_path.patch

    diff --git a/patches/perl_path.patch b/patches/perl_path.patch
    a b  
    1 Index: misc/tex2mail.in
    2 ===================================================================
    3 --- a/misc/tex2mail.in    (revision 12811)
    4 +++ b/misc/tex2mail.in    (working copy)
    5 @@ -1,4 +1,4 @@
    6 -#!@perl@
    7 +#!/usr/bin/env perl
    8 
    9  # $Id$
    10  #
    11 Index: doc/gphelp.in
    12 ===================================================================
    13 --- a/doc/gphelp.in       (revision 12811)
    14 +++ b/doc/gphelp.in       (working copy)
     1diff -ru src/doc/gphelp.in b/doc/gphelp.in
     2--- src/doc/gphelp.in   2013-05-06 16:01:56.000000000 +0200
     3+++ b/doc/gphelp.in     2013-05-06 16:41:15.522405496 +0200
    154@@ -1,4 +1,4 @@
    165-#!@perl@
    176+#!/usr/bin/env perl
    187 #
    198 # $Id$
    209 #
     10diff -ru src/misc/tex2mail.in b/misc/tex2mail.in
     11--- src/misc/tex2mail.in        2013-05-06 16:01:47.000000000 +0200
     12+++ b/misc/tex2mail.in  2013-05-06 16:41:43.523232305 +0200
     13@@ -1,4 +1,4 @@
     14-#!@perl@
     15+#!/usr/bin/env perl
     16 # Original version by Ilya Zakharevich. Minor updates by the PARI group
     17 # Features:
     18 #      % at the end of a line followed by \n\n is recognized as end of
  • patches/polred.patch

    diff --git a/patches/polred.patch b/patches/polred.patch
    a b  
    1 diff -ruN src/src/basemath/base1.c b/src/basemath/base1.c
    2 --- src/src/basemath/base1.c    2012-10-05 10:18:20.000000000 +0200
    3 +++ b/src/basemath/base1.c      2013-01-31 14:49:05.537512504 +0100
     1diff -ru src/src/basemath/base1.c b/src/basemath/base1.c
     2--- src/src/basemath/base1.c    2013-05-06 16:01:56.000000000 +0200
     3+++ b/src/basemath/base1.c      2013-05-06 16:49:09.042406927 +0200
    44@@ -1675,40 +1675,42 @@
    55 ZX_is_better(GEN y, GEN x, GEN *dx)
    66 {
     
    207207   nffp_t F;
    208208   CG_data d;
    209209 
    210 @@ -2058,23 +2136,41 @@
     210@@ -2058,27 +2136,41 @@
    211211   *pro = F.ro;
    212212   d.ZKembed = F.M;
    213213 
     
    227227+    ai = gel(T->bas,i);
    228228     ch = get_polmin_w(&d, i);
    229229-    /* if accuracy too low, compute algebraically */
    230 -    if (!ch) ch = ZXQ_charpoly(ai, x, v);
    231 -    if (ZX_canon_neg(ch) && orig) ai = RgX_neg(ai);
    232 -    if (nfred && degpol(ch) == l-1) return mkvec2(ch, ai);
    233 -    if (DEBUGLEVEL>3) err_printf("polred: generator %Ps\n", ch);
    234 -    if (T->lead != gen_1 && orig) ai = RgX_unscale(ai, ginv(T->lead));
    235 -    gel(y,i) = ch;
    236 -    gel(b,i) = ai;
    237 -  }
     230-    if (!ch)
    238231+    update(&ai, &ch, T, orig);
    239232+    gel(y,k) = ch;
    240233+    gel(b,k) = ai; k++;
     
    243236+  maxi = minss(n, 3);
    244237+  for (i = 1; i <= maxi; i++)
    245238+    for (j = i+1; j <= n; j++)
    246 +    {
     239     {
     240-      ch = ZXQ_charpoly(ai, x, v);
     241-      (void)ZX_gcd_all(ch, ZX_deriv(ch), &ch);
    247242+      GEN ch, ai;
    248243+      ai = gadd(gel(T->bas,i), gel(T->bas,j));
    249244+      ch = get_polmin_add2(&d, i, j);
     
    256251+      update(&ai, &ch, T, orig);
    257252+      gel(y,k) = ch;
    258253+      gel(b,k) = ai; k++;
    259 +    }
     254     }
     255-    if (ZX_canon_neg(ch) && orig) ai = RgX_neg(ai);
     256-    if (nfred && degpol(ch) == l-1) return mkvec2(ch, ai);
     257-    if (DEBUGLEVEL>3) err_printf("polred: generator %Ps\n", ch);
     258-    if (T->lead != gen_1 && orig) ai = RgX_unscale(ai, ginv(T->lead));
     259-    gel(y,i) = ch;
     260-    gel(b,i) = ai;
     261-  }
    260262+  setlg(y, k);
    261263+  setlg(b, k); filter(y, b, n);
    262264   if (!orig) return gen_sort_uniq(y, (void*)cmpii, &gen_cmp_RgX);
    263265   (void)sort_factor_pol(mkmat2(y, b), cmpii);
    264266   settyp(y, t_COL); return mkmat2(b, y);
    265 @@ -2085,10 +2181,58 @@
     267@@ -2089,10 +2181,58 @@
    266268 {
    267269   pari_sp av = avma;
    268270   GEN ro;
     
    322324 /* FIXME: backward compatibility */
    323325 GEN
    324326 polred0(GEN x, long flag, GEN fa)
    325 @@ -2269,22 +2413,6 @@
     327@@ -2273,22 +2413,6 @@
    326328   return bound;
    327329 }
    328330 
     
    345347 /* z "small" minimal polynomial of Mod(a,x), deg z = deg x */
    346348 static GEN
    347349 store(GEN x, GEN z, GEN a, nfbasic_t *T, long flag, GEN u)
    348 @@ -2351,7 +2479,7 @@
     350@@ -2355,7 +2479,7 @@
    349351   GEN y, a, u;
    350352   nfbasic_t T;
    351353 
     
    354356   x = T.x; vx = varn(x);
    355357 
    356358   if (degpol(x) == 1)
    357 diff -ruN src/src/functions/number_fields/polredabs b/src/functions/number_fields/polredabs
    358 --- src/src/functions/number_fields/polredabs   2012-09-25 23:10:47.000000000 +0200
    359 +++ b/src/functions/number_fields/polredabs     2013-01-31 14:49:05.547513332 +0100
     359diff -ru src/src/functions/number_fields/polredabs b/src/functions/number_fields/polredabs
     360--- src/src/functions/number_fields/polredabs   2013-05-06 16:01:57.000000000 +0200
     361+++ b/src/functions/number_fields/polredabs     2013-05-06 16:47:04.542393431 +0200
    360362@@ -17,8 +17,8 @@
    361363  \misctitle{Warning} This routine uses an exponential-time algorithm to
    362364  enumerate all potential generators, and may be exceedingly slow when the
     
    420422 GEN     smallpolred(GEN x);
    421423 GEN     smallpolred2(GEN x);
    422424 GEN     tschirnhaus(GEN x);
    423 diff -ruN src/src/test/32/compat b/src/test/32/compat
    424 --- src/src/test/32/compat      2012-09-25 23:10:47.000000000 +0200
    425 +++ b/src/test/32/compat        2013-01-31 14:49:15.307512816 +0100
     425diff -ru src/src/test/32/compat b/src/test/32/compat
     426--- src/src/test/32/compat      2013-05-06 16:01:57.000000000 +0200
     427+++ b/src/test/32/compat        2013-05-06 16:47:04.542393431 +0200
    426428@@ -787,13 +787,9 @@
    427429 ? factoreddiscf(p,fa)
    428430 136866601
     
    510512 ? print("Total time spent: ",gettime);
    511513-Total time spent: 236
    512514+Total time spent: 140
    513 diff -ruN src/src/test/32/nfields b/src/test/32/nfields
    514 --- src/src/test/32/nfields     2012-09-25 23:10:47.000000000 +0200
    515 +++ b/src/test/32/nfields       2013-01-31 14:49:15.317513357 +0100
     515diff -ru src/src/test/32/nfields b/src/test/32/nfields
     516--- src/src/test/32/nfields     2013-05-06 16:01:57.000000000 +0200
     517+++ b/src/test/32/nfields       2013-05-06 16:47:04.542393431 +0200
    516518@@ -926,45 +926,50 @@
    517519 ? polgalois(x^6-3*x^2-1)
    518520 [12, 1, 1, "A_4(6) = [2^2]3"]
     
    585587 ? print("Total time spent: ",gettime);
    586588-Total time spent: 116
    587589+Total time spent: 76
    588 diff -ruN src/src/test/64/compat b/src/test/64/compat
    589 --- src/src/test/64/compat      2012-09-25 23:10:47.000000000 +0200
    590 +++ b/src/test/64/compat        2013-01-31 14:49:05.557525771 +0100
     590diff -ru src/src/test/64/compat b/src/test/64/compat
     591--- src/src/test/64/compat      2013-05-06 16:01:58.000000000 +0200
     592+++ b/src/test/64/compat        2013-05-06 16:47:04.542393431 +0200
    591593@@ -789,13 +789,9 @@
    592594 ? factoreddiscf(p,fa)
    593595 136866601
     
    675677 ? print("Total time spent: ",gettime);
    676678-Total time spent: 152
    677679+Total time spent: 180
    678 diff -ruN src/src/test/64/nfields b/src/test/64/nfields
    679 --- src/src/test/64/nfields     2012-09-25 23:10:47.000000000 +0200
    680 +++ b/src/test/64/nfields       2013-01-31 14:49:05.557525771 +0100
     680diff -ru src/src/test/64/nfields b/src/test/64/nfields
     681--- src/src/test/64/nfields     2013-05-06 16:01:58.000000000 +0200
     682+++ b/src/test/64/nfields       2013-05-06 16:47:04.542393431 +0200
    681683@@ -928,45 +928,50 @@
    682684 ? polgalois(x^6-3*x^2-1)
    683685 [12, 1, 1, "A_4(6) = [2^2]3"]
  • spkg-src

    diff --git a/spkg-src b/spkg-src
    a b  
    6464
    6565
    6666# Use the specified git version
    67 git checkout pari-2.5.3
     67git checkout pari-2.5.4
    6868
    6969
    7070# make pari (must run bison, etc...) but disable optimization to speed