Skip to content

Commit

Permalink
Trac #15767: Upgrade PARI to 2.7.1
Browse files Browse the repository at this point in the history
'''Upstream''':
[http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-2.7.1.tar.gz]

'''Updated''' (changes have always been made directly in the source
tarball and the package will be removed anyway in #15808): [http://boxen
.math.washington.edu/home/jdemeyer/spkg/genus2reduction-20140211.tar.bz2
]

URL: http://trac.sagemath.org/15767
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Peter Bruin
  • Loading branch information
Release Manager authored and vbraun committed Aug 20, 2014
2 parents 79d9c2f + bf435f8 commit 017ceba
Show file tree
Hide file tree
Showing 88 changed files with 3,413 additions and 3,030 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/genus2reduction/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=genus2reduction-VERSION.tar.bz2
sha1=a29ae793b4c2d427ed5ffbecce4f77f5ba5c1e36
md5=550356571d56cb887cc6a7c035e941e5
cksum=649238856
sha1=df358e78da17ce74cd5b63f379e7f7f91c21f08e
md5=46bd298ef0699d7fb7763d08228a3ce1
cksum=2690437212
2 changes: 1 addition & 1 deletion build/pkgs/genus2reduction/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.p8
20140211
4 changes: 2 additions & 2 deletions build/pkgs/lcalc/SPKG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ http://code.google.com/p/l-calc/
to not redefine the double() cast, thats just fragile and will sooner or
later again fail inside some system headers.

* pari-2.4.4.patch:
Replace obsolete lgeti() by (long)cgeti().
* pari-2.7.patch:
Various changes to port to PARI 2.7.

* init_stack.patch:
Replace obsolete allocatemoremem() by a direct call to the private
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/lcalc/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.23.p12
1.23.p13
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@

//gaffsg(a1,(GEN) F[1]);
//gaffsg(a2,(GEN) F[2]);
diff -ru src/src/Lcommandline_elliptic.cc b/src/Lcommandline_elliptic.cc
--- src/src/Lcommandline_elliptic.cc 2014-02-10 10:17:11.004419528 +0100
+++ b/src/Lcommandline_elliptic.cc 2014-02-10 10:20:37.757715491 +0100
@@ -139,7 +139,7 @@
gaffect(strtoGEN(a4), (GEN) F[4]);
gaffect(strtoGEN(a6), (GEN) F[5]);

- E = initell(F,BIGDEFAULTPREC);
+ E = ellinit(F, NULL, BIGDEFAULTPREC);

C=globalreduction(E);

3 changes: 2 additions & 1 deletion build/pkgs/pari/SPKG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ GPL version 2+
* http://pari.math.u-bordeaux.fr/

== Dependencies ==
* MPIR (in place of GMP)
* Perl
* MPIR or GMP
* Readline
* GNU patch (shipped with Sage)

Expand Down
8 changes: 4 additions & 4 deletions build/pkgs/pari/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=pari-VERSION.tar.bz2
sha1=3f0838940fcf1cb7748979fe16e4b5cab0d19080
md5=4c54710f7e2d4de7b8781edb9d604c60
cksum=2949888924
tarball=pari-VERSION.tar.gz
sha1=7edec0dfefc5d0c47a7f1c2fb1016cfe313c1652
md5=cdf11f569140343449bda477bea19ddb
cksum=1676608517
2 changes: 1 addition & 1 deletion build/pkgs/pari/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.5b.p1
2.7.1.p0
22 changes: 11 additions & 11 deletions build/pkgs/pari/patches/GCC_PR49330.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
diff -ru src/src/language/init.c src.patched/src/language/init.c
--- a/src/language/init.c 2012-02-11 10:57:38.000000000 +0100
+++ b/src/language/init.c 2012-03-07 10:24:37.000000000 +0100
@@ -593,14 +593,16 @@
diff -ru src/src/language/init.c b/src/language/init.c
--- src/src/language/init.c 2014-02-01 16:29:48.955825926 +0100
+++ b/src/language/init.c 2014-02-01 16:31:24.612818588 +0100
@@ -612,14 +612,16 @@
pari_init_functions(void)
{
stack_init(&s_MODULES, sizeof(*MODULES),(void**)&MODULES);
- stack_pushp(&s_MODULES,functions_basic);
stack_init(&s_OLDMODULES, sizeof(*OLDMODULES),(void**)&OLDMODULES);
- stack_pushp(&s_OLDMODULES,oldfonctions);
pari_stack_init(&s_MODULES, sizeof(*MODULES),(void**)&MODULES);
- pari_stack_pushp(&s_MODULES,functions_basic);
pari_stack_init(&s_OLDMODULES, sizeof(*OLDMODULES),(void**)&OLDMODULES);
- pari_stack_pushp(&s_OLDMODULES,oldfonctions);
functions_hash = (entree**) pari_calloc(sizeof(entree*)*functions_tblsz);
pari_fill_hashtable(functions_hash,
new_fun_set? functions_basic: oldfonctions);
defaults_hash = (entree**) pari_calloc(sizeof(entree*)*functions_tblsz);
pari_add_defaults_module(functions_default);
+ /* Move this down to work around GCC bug
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49330 */
+ stack_pushp(&s_MODULES,functions_basic);
+ stack_pushp(&s_OLDMODULES,oldfonctions);
+ pari_stack_pushp(&s_MODULES,functions_basic);
+ pari_stack_pushp(&s_OLDMODULES,oldfonctions);
}

void
12 changes: 6 additions & 6 deletions build/pkgs/pari/patches/KERNELCFLAGS.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff -ru src/config/get_cc b/config/get_cc
--- src/config/get_cc 2012-09-25 23:10:46.000000000 +0200
+++ b/config/get_cc 2013-01-07 16:02:46.607514084 +0100
@@ -122,7 +122,11 @@
case "$__gnuc__" in
2.95.[3-9]*|[3-9].*) OPTFLAGS="$OPTFLAGS -fno-strict-aliasing";;
esac
--- src/config/get_cc 2014-02-01 21:41:54.534348273 +0100
+++ b/config/get_cc 2014-02-01 21:42:50.850930971 +0100
@@ -94,7 +94,11 @@
OPTFLAGS="$OPTFLAGS -fno-strict-aliasing"
fi
rm -f $exe $exe$exe_suff
- KERNELCFLAGS=-funroll-loops
+ if [ "$SAGE_DEBUG" = yes ]; then
+ KERNELCFLAGS=-O1
Expand Down
35 changes: 2 additions & 33 deletions build/pkgs/pari/patches/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,17 @@ Current patches to PARI in Sage:

Patches to configuration files:
* get_ld.patch (Carl Witty): Disable -rpath.
* get_tests.patch (John Cremona): Disable testing of ellglobalred in
"make test-all" in spkg-check, since it requires the elldata database
which we do not include since it is about 18MB.
* get_config_options.patch (Leif Leonhardy): Catch invalid arguments to
"--graphic" (and treat such as an error) since otherwise strange
compilation errors might occur (cf. #9722, too).
* get_fltk.patch (Leif Leonhardy): Explicitly link against libstdc++
when using FLTK (for plotting) to support Fedora 13, and do an extra
check for the FLTK include dir (cf. #9722).
* get_X11.patch (Leif Leonhardy): Also search */lib64/* for X11
libraries (since on some systems this is really a separate directory,
i.e. neither a symbolic link to */lib/* nor the target of a symbolic
link */lib/*; cf. #9722, too).
* get_fltk.patch (Leif Leonhardy): do an extra check for the FLTK
include dir (cf. #9722).
* get_dlcflags.patch (Jeroen Demeyer): Add -fno-common to DLCFLAGS on
Darwin. Submitted upstream, but upstream only applied it for PowerPC.
Since this doesn't break anything and only improves performance, add
the flag unconditionally.
* install_doc_no_make.patch (Jeroen Demeyer): Do not *build* the
documentation when doing install-doc or install-docpdf. We must not
build the documentation because that requires tex. On the other hand,
to have ? and ?? work within gp, we must install the .tex files (but
not .dvi files). So simply not doing install-doc doesn't work.
* perl_path.patch (Jeroen Demeyer): change first line of all perl
scripts to "#!/usr/bin/env perl" (#10559).
* cygwin_dll_a.patch (Jean-Pierre Flori): copy libpari.dll.a on Cygwin
(see #13333).
* KERNELCFLAGS.patch (Jeroen Demeyer): when SAGE_DEBUG=yes, compile
kernel files with -O1 instead of -funroll-loops; -O0 gives a
segmentation fault on some OS X systems when doing
Expand All @@ -45,22 +30,6 @@ C files:
gcc-4.6.3. Discussed with upstream:
- http://pari.math.u-bordeaux.fr/archives/pari-dev-1203/msg00001.html
- http://pari.math.u-bordeaux.fr/archives/pari-dev-1202/msg00006.html
* trac_13902_determinant.patch (Jeroen Demeyer): patch backported from
upstream git repository based on commits
- 28ea998bc661f5bbde18b6d6b0f50111a10ae16c
- 249432f7088bfa114ed5cd3a5d64ef51ee968e35
* polred.patch (Jeroen Demeyer): Fix polred(), add polredbest()
backported from upstream commits
- 2d00a24fbb1ffe8eba35b9a04763e36eef8a5f7b
- a3596c56f9439144a0dbed4c47bd6ff9485e3fc8
- 1a00ca416de4daebccaab2be1a4b8a061a9f2fde
- ad550d9bbfee8113087407c3262bffc27a020c98
* q_eint1.patch (Jeroen Demeyer): Fix precision of eint1(), backported
from upstream commits
- b894e0171112493bb4945a6a0e4af039b54a1d1f
- 54eb37055167dbd8d4856b1bd698cf7018db561b
and completely backport new algorithm for mpveceint1(). The prefix
q_ in the patch filename is to ensure it comes after polred.patch.
* det_garbage.patch (Jeroen Demeyer, #15654): When computing a
determinant(), only collect garbage once per outer loop iteration.
Better increase PARI stack size instead of collecting garbage too
Expand Down
25 changes: 0 additions & 25 deletions build/pkgs/pari/patches/cygwin_dll_a.patch

This file was deleted.

28 changes: 13 additions & 15 deletions build/pkgs/pari/patches/det_garbage.patch
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
Binary files src/Olinux-x86_64/alglin1.o and b/Olinux-x86_64/alglin1.o differ
Only in src/Olinux-x86_64: libpari-gmp.so.2.5.5
diff -ru src/src/basemath/alglin1.c b/src/basemath/alglin1.c
--- src/src/basemath/alglin1.c 2014-01-09 15:43:35.847263581 +0100
+++ b/src/basemath/alglin1.c 2014-01-09 15:55:47.903649326 +0100
@@ -2412,6 +2412,7 @@
--- src/src/basemath/alglin1.c 2014-01-29 18:00:27.000000000 +0100
+++ b/src/basemath/alglin1.c 2014-02-09 01:54:37.676725196 +0100
@@ -247,6 +247,7 @@
a = RgM_shallowcopy(a);
for (i=1; i<nbco; i++)
{
+ int garbage = 0; /* Only gerepile() once per loop iteration */
for(k=i; k<=nbco; k++)
{
gcoeff(a,k,i) = modii(gcoeff(a,k,i), p);
@@ -2435,7 +2436,7 @@
gcoeff(a,k,i) = ff->red(E,gcoeff(a,k,i));
@@ -271,7 +272,7 @@
for (j=i+1; j<=nbco; j++)
{
gcoeff(a,j,k) = Fp_sub(gcoeff(a,j,k), Fp_mul(m,gcoeff(a,j,i),p),p);
gcoeff(a,j,k) = ff->add(E, gcoeff(a,j,k), ff->mul(E,m,gcoeff(a,j,i)));
- if (low_stack(lim, stack_lim(av,1)))
+ if (low_stack(lim, stack_lim(av,1)) && (garbage++ == 0))
{
if(DEBUGMEM>1) pari_warn(warnmem,"det. col = %ld",i);
gerepileall(av,2, &a,&x);
@@ -2994,6 +2995,7 @@
gerepileall(av,4, &a,&x,&q,&m);
@@ -3721,6 +3722,7 @@
a = RgM_shallowcopy(a);
for (i=1; i<nbco; i++)
{
+ int garbage = 0; /* Only gerepile() once per loop iteration */
k = pivot(a, data, i, NULL);
if (k > nbco) return gerepilecopy(av, gcoeff(a,i,i));
if (k != i)
@@ -3013,7 +3015,7 @@
@@ -3740,7 +3742,7 @@
for (j=i+1; j<=nbco; j++)
{
gcoeff(a,j,k) = gsub(gcoeff(a,j,k), gmul(m,gcoeff(a,j,i)));
- if (low_stack(lim, stack_lim(av,1)))
+ if (low_stack(lim, stack_lim(av,1)) && (garbage++ == 0))
- if (low_stack(lim, stack_lim(av,3)))
+ if (low_stack(lim, stack_lim(av,3)) && (garbage++ == 0))
{
if(DEBUGMEM>1) pari_warn(warnmem,"det. col = %ld",i);
gerepileall(av,2, &a,&x);
@@ -3063,6 +3065,7 @@
@@ -3791,6 +3793,7 @@
{
GEN ci, ck, m;
int diveuc = (gequal1(pprec)==0);
+ int garbage = 0; /* Only gerepile() once per loop iteration */

p = gcoeff(a,i,i);
if (gequal0(p))
@@ -3099,7 +3102,7 @@
@@ -3827,7 +3830,7 @@
GEN p1 = gsub(gmul(p,gel(ck,j)), gmul(m,gel(ci,j)));
if (diveuc) p1 = mydiv(p1,pprec);
gel(ck,j) = gerepileupto(av2, p1);
Expand Down
52 changes: 0 additions & 52 deletions build/pkgs/pari/patches/get_X11.patch

This file was deleted.

14 changes: 7 additions & 7 deletions build/pkgs/pari/patches/get_config_options.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
+ -graphic|--graphic)
+ shift; which_graphic_lib="$1"
+ case "$which_graphic_lib" in
+ auto|none|X11|qt|Qt|fltk|win32) ;;
+ auto|none|X11|qt|Qt|fltk|ps|win32) ;;
+ *) echo "*** Unrecognized graphic lib \"$which_graphic_lib.\"" >&2
+ error=true;;
+ esac;;
--graphic=*|--graphi=*|--graph=*|--grap=*|--gra=*|--gr=*|--g=*)
- which_graphic_lib=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
+ which_graphic_lib=`echo "$1" | sed -e 's/[-a-z]*=//'`
+ case "$which_graphic_lib" in
+ auto|none|X11|qt|Qt|fltk|win32) ;;
+ auto|none|X11|qt|Qt|fltk|ps|win32) ;;
+ *) echo "*** Unrecognized graphic lib \"$which_graphic_lib.\"" >&2
+ error=true;;
+ esac;;

--without-readline|--with-readline=no) without_readline=yes ;;
--with-readline) with_readline=yes ;;
@@ -126,7 +137,7 @@
@@ -139,7 +139,7 @@
Build Options:
--host=<arch-osname> target achitecture
--kernel=<kern> kernel used
- --graphic=<gr> graphic library used (none X11 Qt fltk win32)
+ --graphic=<gr> graphic library used (none X11 qt Qt fltk win32 auto)
--time=<fun> timing function to use (getrusage times ftime)
- --graphic=<gr> graphic library used (none, X11, Qt, fltk, ps, win32)
+ --graphic=<gr> graphic library used (none, X11, Qt, fltk, ps, win32, auto)
--time=<fun> timing function to use (getrusage, clock_gettime,
times, ftime)
--builddir=<dir> directory where the object files will be created
--tune tune the binary for compiling host (slow)
27 changes: 8 additions & 19 deletions build/pkgs/pari/patches/get_fltk.patch
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
--- a/config/get_fltk 2010-11-04 14:51:50.910510930 +0100
+++ b/config/get_fltk 2010-11-04 14:59:12.158786073 +0100
@@ -10,18 +10,24 @@
fi
;;
*) if test ! -d "$with_fltk"; then
- echo "### FLTK directory '$with_fltk' not found"
+ echo "### Specified FLTK directory '$with_fltk' not found"
else
FLTKDIR=$with_fltk
diff -ru src/config/get_fltk b/config/get_fltk
--- src/config/get_fltk 2014-02-01 16:36:02.492702307 +0100
+++ b/config/get_fltk 2014-02-01 16:43:22.183289684 +0100
@@ -16,8 +16,15 @@
fi;;
esac
if test -n "$FLTKDIR"; then
- echo "Using FLTK library, FLTKDIR = $FLTKDIR"
+ if test -d "$FLTKDIR/include/FL"; then
+ echo "Using FLTK library, FLTKDIR = \"$FLTKDIR\""
echo "Using FLTK library, FLTKDIR = $FLTKDIR"
FLTK_LIBS="`fltk-config --ldflags` -lstdc++"
+ else
+ echo "### Found the FLTK library, but not the necessary headers."
+ echo "### Building without FLTK support."
+ FLTKDIR=""
+ FLTK_LIBS=""
+ fi
else
echo "### FLTK not found. Building without FLTK support"
fi
case "$osname" in
cygwin) FLTK_LIBS="-lgdi32 -lole32 -luuid -lwsock32 -lsupc++" ;;
darwin) FLTK_LIBS="-framework Carbon -lsupc++" ;;
- *) FLTK_LIBS="$X11_LIBS" ;;
+ *) FLTK_LIBS="$X11_LIBS -lstdc++" ;;
esac
FLTK_LIBS=
Loading

0 comments on commit 017ceba

Please sign in to comment.