Skip to content

Commit

Permalink
Trac #32907: Update singular to 4.2.1p3
Browse files Browse the repository at this point in the history
From the  [[https://github.com/Singular/Singular/blob/spielwiese/doc/NEW
S.texi|release notes]]: update for using FLINT 2.8.x

The FLINT/Singular problem on ubuntu-trusty
will be fixed by this (already merged)
pull request to FLINT:

- flintlib/flint#1040

URL: https://trac.sagemath.org/32907
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe, Antonio Rojas
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Dec 23, 2021
2 parents c5af195 + 0856554 commit 2f51044
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 150 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/flint/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1
2.7.1.p0
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 54e5a36901bcbe5dedadcf3fc670eb00a7ab9193 Mon Sep 17 00:00:00 2001
From: Matthias Koeppe <[email protected]>
Date: Sun, 21 Nov 2021 11:33:59 -0800
Subject: [PATCH] flint.h: On GCC < 4.9, do not use _Thread_local

---
flint.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/flint.h b/flint.h
index 2cd15fb29..9d082f7f0 100644
--- a/flint.h
+++ b/flint.h
@@ -157,7 +157,10 @@ FLINT_DLL void flint_set_abort(FLINT_NORETURN void (*func)(void));
#define flint_bitcnt_t ulong

#if FLINT_USES_TLS
-#if __STDC_VERSION__ >= 201112L
+#if defined(__GNUC__) && __STDC_VERSION__ >= 201112L && __GNUC__ == 4 && __GNUC_MINOR__ < 9
+/* GCC 4.7, 4.8 with -std=gnu11 purport to support C11 via __STDC_VERSION__ but lack _Thread_local */
+#define FLINT_TLS_PREFIX __thread
+#elif __STDC_VERSION__ >= 201112L
#define FLINT_TLS_PREFIX _Thread_local
#elif defined(_MSC_VER)
#define FLINT_TLS_PREFIX __declspec(thread)
--
2.33.0

6 changes: 3 additions & 3 deletions build/pkgs/singular/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=singular-VERSION.tar.gz
sha1=75bdd61345b4a0517cd8dfd45d4a719104dc993a
md5=e26ea0bfa02b0f807faa830b043cd36e
cksum=468883881
sha1=f257a0ef23cedb2c8f9514bbc5f292ca3660a244
md5=8b9142f42cb73aede3940ef3c5f9586d
cksum=2019987428
upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-2-1/singular-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/singular/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.1.p0
4.2.1p3

This file was deleted.

10 changes: 2 additions & 8 deletions build/pkgs/singular/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,12 @@ config()

build_singular()
{
for subdir in omalloc gfanlib resources omalloc factory libpolys gfanlib IntegerProgramming; do
sdh_make -w -C $subdir
done
# Possible parallelization bugs in subdirectory Singular
sdh_make -j1
sdh_make
sdh_make_install
# Trac #32001/#32323: Singular does not install singular.idx
sdh_install doc/singular.idx "$SAGE_SHARE/singular/"

# Singular tarballs made using "make dist" (without --enable-doc-build) do not contain built documentation.
if [ ! -e doc/doc.tbz2 ]; then
(cd doc && make singular.hlp && sdh_install singular.hlp "$SAGE_SHARE/info/") || sdh_die "Building documentation failed"
(cd doc && make singular.info && sdh_install singular.info "$SAGE_SHARE/info/") || sdh_die "Building documentation failed"
fi
}

Expand Down
8 changes: 4 additions & 4 deletions src/sage/libs/singular/decl.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -748,21 +748,21 @@ cdef extern from "singular/Singular/libsingular.h":

# general number constructor

number *n_Init(int n, ring *r)
number *n_Init(int n, n_Procs_s *cf)

# general number destructor

void n_Delete(number **n, ring *r)
void n_Delete(number **n, n_Procs_s *cf)

# Copy this number
number *n_Copy(number *n, ring* r)
number *n_Copy(number *n, n_Procs_s *cf)

# Invert this number
int n_IsUnit(number *n, const n_Procs_s *cf)
number *n_Invers(number *n, const n_Procs_s *cf)

# Characteristic of coefficient domain
int n_GetChar(const ring* r)
int n_GetChar(const n_Procs_s *cf)

# rational number from int

Expand Down
6 changes: 3 additions & 3 deletions src/sage/libs/singular/polynomial.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ cdef int singular_polynomial_rmul(poly **ret, poly *p, RingElement n, ring *r):
rChangeCurrRing(r)
cdef number *_n = sa2si(n, r)
ret[0] = pp_Mult_nn(p, _n, r)
n_Delete(&_n, r)
n_Delete(&_n, r.cf)
return 0

cdef int singular_polynomial_call(poly **ret, poly *p, ring *r, list args, poly *(*get_element)(object)):
Expand Down Expand Up @@ -277,7 +277,7 @@ cdef int singular_polynomial_cmp(poly *p, poly *q, ring *r):
h = r.cf.cfSub(p_GetCoeff(p, r),p_GetCoeff(q, r),r.cf)
# compare coeffs
ret = -1+r.cf.cfIsZero(h,r.cf)+2*r.cf.cfGreaterZero(h, r.cf) # -1: <, 0:==, 1: >
n_Delete(&h, r)
n_Delete(&h, r.cf)
p = pNext(p)
q = pNext(q)

Expand Down Expand Up @@ -348,7 +348,7 @@ cdef int singular_polynomial_div_coeff(poly** ret, poly *p, poly *q, ring *r) ex
cdef number *n = p_GetCoeff(q, r)
n = r.cf.cfInvers(n,r.cf)
ret[0] = pp_Mult_nn(p, n, r)
n_Delete(&n, r)
n_Delete(&n, r.cf)
sig_off()
return 0

Expand Down
4 changes: 2 additions & 2 deletions src/sage/libs/singular/singular.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ cdef number *sa2si(Element elem, ring * _ring):
"""
cdef int i = 0
if isinstance(elem._parent, FiniteField_prime_modn):
return n_Init(int(elem),_ring)
return n_Init(int(elem),_ring.cf)

elif isinstance(elem._parent, RationalField):
return sa2si_QQ(elem, _ring)
Expand All @@ -1420,7 +1420,7 @@ cdef number *sa2si(Element elem, ring * _ring):
return sa2si_NF(elem, _ring)
elif isinstance(elem._parent, IntegerModRing_generic):
if _ring.cf.type == n_unknown:
return n_Init(int(elem),_ring)
return n_Init(int(elem),_ring.cf)
return sa2si_ZZmod(elem, _ring)
elif isinstance(elem._parent, FractionField_generic) and isinstance(elem._parent.base(), (MPolynomialRing_libsingular, PolynomialRing_field)):
if isinstance(elem._parent.base().base_ring(), RationalField):
Expand Down
4 changes: 2 additions & 2 deletions src/sage/modular/modform_hecketriangle/abstract_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,8 @@ def F_basis_pol(self, m, order_1=ZZ(0)):
sage: MF.F_basis_pol(2)
x^13*y*d^2 - 2*x^8*y^3*d^2 + x^3*y^5*d^2
sage: MF.F_basis_pol(1)
(-81*x^13*y*d + 62*x^8*y^3*d + 19*x^3*y^5*d)/(-100)
sage: MF.F_basis_pol(1) * 100
81*x^13*y*d - 62*x^8*y^3*d - 19*x^3*y^5*d
sage: MF.F_basis_pol(0)
(141913*x^13*y + 168974*x^8*y^3 + 9113*x^3*y^5)/320000
Expand Down
4 changes: 2 additions & 2 deletions src/sage/modular/modform_hecketriangle/readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@
General Eisenstein series in some arithmetic cases::
sage: ModularFormsRing(n=4).EisensteinSeries(k=8)
(-25*f_rho^4 - 9*f_i^2)/(-34)
sage: ModularFormsRing(n=4).EisensteinSeries(k=8) * 34
25*f_rho^4 + 9*f_i^2
sage: ModularForms(n=3, k=12).EisensteinSeries()
1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + O(q^5)
sage: ModularForms(n=6, k=12).EisensteinSeries()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ def asymptotics(self, p, alpha, N, asy_var=None, numerical=0,
(1, [(x*y + x + y - 1, 2)])
sage: alpha = [4, 3]
sage: decomp = F.asymptotic_decomposition(alpha); decomp
(0, []) + (-2*r*(1/x + 1) - 1/2/x - 1/2, [(x*y + x + y - 1, 1)])
(0, []) + (... - 1/2, [(x*y + x + y - 1, 1)])
sage: F1 = decomp[1]
sage: p = {y: 1/3, x: 1/2}
sage: asy = F1.asymptotics(p, alpha, 2, verbose=True)
Expand Down
7 changes: 2 additions & 5 deletions src/sage/rings/polynomial/hilbert.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,10 @@ def hilbert_poincare_series(I, grading=None):
sage: hilbert_poincare_series(J).denominator().factor()
(t - 1)^14
This example exceeds the current capabilities of Singular::
This example exceeded the capabilities of Singular before version 4.2.1p2::
sage: J.hilbert_numerator(algorithm='singular')
Traceback (most recent call last):
...
RuntimeError: error in Singular function call 'hilb':
int overflow in hilb 1
120*t^33 - 3465*t^32 + 48180*t^31 - 429374*t^30 + 2753520*t^29 - 13522410*t^28 + 52832780*t^27 - 168384150*t^26 + 445188744*t^25 - 987193350*t^24 + 1847488500*t^23 + 1372406746*t^22 - 403422496*t^21 - 8403314*t^20 - 471656596*t^19 + 1806623746*t^18 + 752776200*t^17 + 752776200*t^16 - 1580830020*t^15 + 1673936550*t^14 - 1294246800*t^13 + 786893250*t^12 - 382391100*t^11 + 146679390*t^10 - 42299400*t^9 + 7837830*t^8 - 172260*t^7 - 468930*t^6 + 183744*t^5 - 39270*t^4 + 5060*t^3 - 330*t^2 + 1
"""
cdef Polynomial_integer_dense_flint HP
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/multi_polynomial_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
which is not 1. ::
sage: I.groebner_basis()
[x + y + 57119*z + 4, y^2 + 3*y + 17220, y*z + y + 26532, 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878]
[x + y + 57119*z + 4, y^2 + 3*y + 17220, y*z + ..., 2*y + 158864, z^2 + 17223, 2*z + 41856, 164878]
Now for each prime `p` dividing this integer 164878, the Groebner
basis of I modulo `p` will be non-trivial and will thus give a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def interred_libsingular(I):
n = r.cf.cfInvers(n,r.cf)
result.m[j] = pp_Mult_nn(p, n, r)
p_Delete(&p,r)
n_Delete(&n,r)
n_Delete(&n,r.cf)

id_Delete(&i,r)

Expand Down
Loading

0 comments on commit 2f51044

Please sign in to comment.