Skip to content

Commit

Permalink
Trac #29445: Reject broken system PARI 2.11.3 and re-enable PARI libr…
Browse files Browse the repository at this point in the history
…ary test in spkg-configure

There are several failing doctests depending on the PARI version of the
system, e.g.

{{{
File "src/sage/rings/number_field/number_field_ideal.py", line 1829, in
sage.rings.number_field.number_field_ideal.NumberFieldFractionalIdeal.fa
ctor
Failed example:
    fact = F.factor(2); fact
Expected:
    (Fractional ideal (2*a^2 + 1))^2 * (Fractional ideal (-2*a^2))
Got:
    (Fractional ideal (-2*a^2 - 1))^2 * (Fractional ideal (2*a^2))
}}}

see e.g.

[https://github.com/mkoeppe/sage/runs/542655863]

This is the case because debian bullseye uses pari 2.11.3 (instead of
pari 2.11.3). Many instances seem to fail, just because the choice of
generators has changed. However, there is at least one thing really
strange when upgrading to pari 2.11.3:

{{{
sage: y = var('y')
sage: pK = pari.bnfinit(y^3+3)
sage: pK.bnfisunit(pK.bnfunit()[0])
[1, Mod(1, 2)]~
}}}

URL: https://trac.sagemath.org/29445
Reported by: gh-kliem
Ticket author(s): Jonathan Kliem, Matthias Koeppe
Reviewer(s): Matthias Koeppe, Jonathan Kliem
  • Loading branch information
Release Manager committed Apr 6, 2020
2 parents 5dff583 + c4a0a22 commit f3631bb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions build/pkgs/pari/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ SAGE_SPKG_CONFIGURE([pari], [
sage_spkg_install_pari=yes
else
AC_MSG_RESULT([no])
AC_MSG_CHECKING([installing PARI/GP packages? ])
AC_PATH_PROG([GP], [gp])
if test x$GP = x; then dnl GP test
AC_MSG_NOTICE([gp is not found])
Expand Down Expand Up @@ -74,10 +73,20 @@ SAGE_SPKG_CONFIGURE([pari], [
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.])
sage_spkg_install_pari=yes
fi
AC_MSG_CHECKING([whether bnfisunit bug of pari 2.11.3 is fixed])
bug_check=$(echo "bnf = bnfinit(y^4-y-1); bnfisunit(bnf,-y^3+2*y^2-1)" | $GP -qf 2>> config.log)
expected="[[0, 2, Mod(0, 2)]]~"
if test x"$bug_check" = x"$expected"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no; cannot use system pari/GP with known bug])
AC_MSG_NOTICE([Upgrade your system package and reconfigure.])
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.])
sage_spkg_install_pari=yes
fi
fi dnl end GP test
if test x$sage_spkg_install_pari = x; then dnl main PARI test
AC_MSG_RESULT([no])
if test x$sage_spkg_install_pari = xno; then dnl main PARI test
AC_CHECK_HEADER([pari/pari.h], [], [sage_spkg_install_pari=yes])
dnl matpermanent appears in pari 2.11
AC_SEARCH_LIBS([matpermanent], [pari], [
Expand Down Expand Up @@ -124,9 +133,7 @@ SAGE_SPKG_CONFIGURE([pari], [
], [], [], [
if test x$sage_spkg_install_pari = xyes; then
AC_SUBST(SAGE_PARI_PREFIX, ['$SAGE_LOCAL'])
AC_MSG_RESULT([using Sage's pari SPKG])
else
AC_SUBST(SAGE_PARI_PREFIX, [''])
AC_MSG_RESULT([using pari/gp from the system])
fi
])

0 comments on commit f3631bb

Please sign in to comment.