sagemath/sage

Update singular to 4.2.1p3

mkoeppe opened this issue · 60 comments

From the 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:

CC: @dimpase @orlitzky @kiwifb @antonio-rojas @slel

Component: packages: standard

Keywords: upgrade, Singular

Author: Matthias Koeppe, Antonio Rojas

Branch: 0856554

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/32907

Author: Matthias Koeppe

Commit: 4cf59d3

New commits:

4cf59d3build/pkgs/singular: Update to 4.2.1p2

Changed commit from 4cf59d3 to 5b2d003

Branch pushed to git repo; I updated commit sha1. New commits:

5b2d003build/pkgs/singular: Remove patch
comment:4

Build ends with Error: source file/directory doc/singular.idx does not exist

Branch pushed to git repo; I updated commit sha1. New commits:

26a7332build/pkgs/singular/spkg-install.in: Remove workaround for singular.idx, it is now in doc.tbz2

Changed commit from 5b2d003 to 26a7332

comment:7

Passing -j1 to "make" should no longer be necessary.

Changed commit from 26a7332 to bb1f741

Branch pushed to git repo; I updated commit sha1. New commits:

bb1f741build/pkgs/singular/spkg-install.in: Remove workaround for make paralellization bugs

Description changed:

--- 
+++ 
@@ -1 +1,2 @@
+From the  [release notes](https://github.com/Singular/Singular/blob/spielwiese/doc/NEWS.texi): update for using FLINT 2.8.x
 
comment:12

This gives errors in the sagelib build:

  [sagelib-9.5.beta7]   build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:33693:18: note: in expansion of macro ‘p_SetCoeff0’
  [sagelib-9.5.beta7]              (void)(p_SetCoeff0(__pyx_v_temp, n_Copy(p_GetCoeff(__pyx_v_p, __pyx_v_r), __pyx_v_r), __pyx_v_r));
  [sagelib-9.5.beta7]                     ^
  [sagelib-9.5.beta7]   build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp: In function ‘PyObject* __pyx_pf_4sage_5rings_10polynomial_28multi_polynomial_libsingular_23MPolynomial_libsingular_104factor(__pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular*, PyObject*)’:
  [sagelib-9.5.beta7]   build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:34874:40: error: cannot convert ‘ip_sring*’ to ‘coeffs {aka n_Procs_s*}’ for argument ‘1’ to ‘int n_GetChar(coeffs)’
  [sagelib-9.5.beta7]      __pyx_t_7 = ((n_GetChar(__pyx_v__ring) > 0x20000000) != 0);
  [sagelib-9.5.beta7]                                           ^

Changed author from Matthias Koeppe to Matthias Koeppe, ...

Changed commit from bb1f741 to 720d10e

Branch pushed to git repo; I updated commit sha1. New commits:

720d10eUpdate tests for singular 4.2.1p2
comment:18

Builds now, also with older singular (at least as far back as 4.2.0p1). I've also tried to keep tests compatible with older singular, except for the example in rings/polynomial/hilbert.pyx, which failed before and works now. Should we care about it?

Changed author from Matthias Koeppe, ... to Matthias Koeppe, Antonio Rojas

Changed commit from 720d10e to cca353b

New commits:

cca353bsrc/sage/rings/polynomial/hilbert.pyx: Fix doctest markup
comment:21

ubuntu-trusty-minimal (https://github.com/mkoeppe/sage/runs/4274462334?check_suite_focus=true) and ubuntu-trusty-standard:

  [sagemath_doc_html-none]       from sage.symbolic.all   import *
  [sagemath_doc_html-none]     File "/sage/local/var/lib/sage/venv-python3.9.7/lib/python3.9/site-packages/sage/symbolic/all.py", line 8, in <module>
  [sagemath_doc_html-none]       import sage.symbolic.expression  # initialize pynac before .ring
  [sagemath_doc_html-none]   ImportError: /sage/local/var/lib/sage/venv-python3.9.7/lib/python3.9/site-packages/sage/symbolic/expression.cpython-39-x86_64-linux-gnu.so: undefined symbol: fmpq_poly_inv_series_newton
  [sagemath_doc_html-none]   Error: './sage --docbuild --all-documents' failed
comment:23

Replying to @mkoeppe:

ubuntu-trusty-minimal (https://github.com/mkoeppe/sage/runs/4274462334?check_suite_focus=true) and ubuntu-trusty-standard:

how can one see the singular spkg logs?

comment:24

The log artifacts are now available at https://github.com/mkoeppe/sage/actions/runs/1485019210 (I had to cancel the workflow for that)

comment:25

Still can't figure out where spkg logs are. Anyways, I insalled the docker image locally and this is the actual issue:

configure:24015: gcc -std=gnu11 -o conftest -I/home/sage/local/include/ -I/home/sage/local/include -I/home/sage/local/include -g -O2  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -funroll-loops  -Wl,-rpath-link,/home/sage/local/lib -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -Wl,-rpath-link,/home/sage/local/lib -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -funroll-loops conftest.c -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -lflint -lmpfr -lgmp -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -lgmp -lpthread  -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -lgmp -lm  >&5
In file included from /home/sage/local/include/flint/nmod_vec.h:29:0,
                 from /home/sage/local/include/flint/fmpz.h:31,
                 from conftest.c:34:
/home/sage/local/include/flint/ulong_extras.h:119:1: error: unknown type name '_Thread_local'
 extern FLINT_TLS_PREFIX ulong * _flint_primes[FLINT_BITS];
 ^

Perhaps a too old gcc?

comment:26

Besides singular not using flint on trusty, this error shows that there's also an issue in sagelib: symbolic.expression uses flint functions (probably via GiNaC) and yet it only links to flint via SINGULAR_LIBRARIES (and therefore it underlinks if singular is built without flint). It should be linking to flint directly.

comment:27

Replying to @antonio-rojas:

Besides singular not using flint on trusty, this error shows that there's also an issue in sagelib: symbolic.expression uses flint functions (probably via GiNaC) and yet it only links to flint via SINGULAR_LIBRARIES (and therefore it underlinks if singular is built without flint). It should be linking to flint directly.

Opened #32919 for this

comment:28

Replying to @antonio-rojas:

configure:24015: gcc -std=gnu11 -o conftest -I/home/sage/local/include/ -I/home/sage/local/include -I/home/sage/local/include -g -O2  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -funroll-loops  -Wl,-rpath-link,/home/sage/local/lib -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -Wl,-rpath-link,/home/sage/local/lib -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -funroll-loops conftest.c -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -lflint -lmpfr -lgmp -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -lgmp -lpthread  -L/home/sage/local/lib -Wl,-rpath,/home/sage/local/lib -lgmp -lm  >&5
In file included from /home/sage/local/include/flint/nmod_vec.h:29:0,
                 from /home/sage/local/include/flint/fmpz.h:31,
                 from conftest.c:34:
/home/sage/local/include/flint/ulong_extras.h:119:1: error: unknown type name '_Thread_local'
 extern FLINT_TLS_PREFIX ulong * _flint_primes[FLINT_BITS];
 ^

Perhaps a too old gcc?

Yes, it looks like we are running into an old problem,
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203066, "don't use -std=gnu11 with gcc < 4.9

comment:29

It looks like this is showing up now simply because the new singular tarball has been generated with a newer version of autoconf.

Before:

Configuring singular-4.2.1.p0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed

After:

Configuring singular-4.2.1p2
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... -std=gnu11

Changed commit from cca353b to 8c6c949

Branch pushed to git repo; I updated commit sha1. New commits:

8c6c949build/pkgs/flint/: Add patch for threads with GCC < 4.9
comment:31

With this patch for flint, Singular finds it, as tested with tox -e docker-ubuntu-trusty-standard -- singular.

Description changed:

--- 
+++ 
@@ -1,2 +1,6 @@
 From the  [release notes](https://github.com/Singular/Singular/blob/spielwiese/doc/NEWS.texi): update for using FLINT 2.8.x
 
+
+PR for fixing the flint/singular problem on ubuntu-trusty:
+https://github.com/wbhart/flint2/pull/1040
+

Branch pushed to git repo; I updated commit sha1. New commits:

eea6328build/pkgs/singular/spkg-install.in: singular.hlp -> singular.info

Changed commit from 8c6c949 to eea6328

Description changed:

--- 
+++ 
@@ -2,5 +2,5 @@
 
 
 PR for fixing the flint/singular problem on ubuntu-trusty:
-https://github.com/wbhart/flint2/pull/1040
+https://github.com/wbhart/flint2/pull/1040 (merged)
 
slel commented
comment:37

If it helps I could try this ticket out
on a few machines (Cygwin, Linux, macOS).

For now I can only offer trivial comments
(feel free to disregard them).

I would wrap this long output line:

         sage: J.hilbert_numerator(algorithm='singular')
-        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
+        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

or maybe even rewrite that doctest as:

-        sage: J.hilbert_numerator(algorithm='singular')
+        sage: p = J.hilbert_numerator(algorithm='singular')
+        sage: p.list()
+        [1, 0, -330, 5060, -39270, 183744, -468930, -172260, 7837830,
+         -42299400, 146679390, -382391100, 786893250, -1294246800,
+         1673936550, -1580830020, 752776200, 752776200, 1806623746,
+         -471656596, -8403314, -403422496, 1372406746, 1847488500,
+         -987193350, 445188744, -168384150, 52832780, -13522410,
+         2753520, -429374, 48180, -3465, 120]

whose output I personally find easier to parse visually.

Another wrapping suggestion:

-        [x + y + 57119*z + 4, y^2 + 3*y + 17220, y*z + ..., 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]

Some pep8 whitespace suggestions (the last two occur several times):

-            n_Delete(&n,r.cf)
+            n_Delete(&n, r.cf)
-                p_SetCoeff(newptemp,n_Copy(p_GetCoeff(p,r),r.cf),r)
+                p_SetCoeff(newptemp, n_Copy(p_GetCoeff(p, r), r.cf), r)
-            p_SetCoeff(p, n_Init(1,_ring.cf), _ring)
+            p_SetCoeff(p, n_Init(1, _ring.cf), _ring)
slel commented

Changed keywords from none to upgrade, Singular

slel commented

Description changed:

--- 
+++ 
@@ -1,6 +1,8 @@
 From the  [release notes](https://github.com/Singular/Singular/blob/spielwiese/doc/NEWS.texi): 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:
 
-PR for fixing the flint/singular problem on ubuntu-trusty:
-https://github.com/wbhart/flint2/pull/1040 (merged)
+- https://github.com/wbhart/flint2/pull/1040
 
comment:38

Cygwin testing would be valuable

comment:39

Also please feel free to push these edits to the ticket

comment:40

Setting to blocker because system singular is already being picked up by our spkg-configure

comment:41

Let's get this in please

comment:42

4.2.1p3 is out including the commit needed for #32959

comment:43

yes, seems like a nice update to get: https://github.com/Singular/Singular/releases/tag/Release-4-2-1p3

Branch pushed to git repo; I updated commit sha1. New commits:

a137b7eMerge tag '9.5.beta8' into t/32907/update_singular_to_4_2_1p2
0856554build/pkgs/singular: Update to 4.2.1p3

Changed commit from eea6328 to 0856554

comment:46

Tests on GH Actions look fine.

comment:47

lgtm

Changed reviewer from https://github.com/mkoeppe/sage/actions/runs/1595134485 to Dima Pasechnik

comment:48

Thanks!

comment:50

update to 4.3.0 is dealt with on #33160

Changed commit from 0856554 to none