sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.09k stars 392 forks source link

Upgrade to Singular-4.x.x #17254

Closed jdemeyer closed 7 years ago

jdemeyer commented 9 years ago

Lots of stuff has changed in Singular 4. This is a big update.

Build system completely changed, and a lot of internal stuff.

Original upstream tarball at www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/4-0-3/: singular-4.0.3p3 dot tar dot gz

Modified tarball made with spkg-src at:

This corresponds to commit a070b84d whose message tells 4.0.3p3 and on which this branch was based:

You can also make your own tarball based on this commit or another one with

env SINGULAR_GIT_COMMIT=a070b84d ./sage --sh build/pkgs/singular/spkg-src
./sage --package fix-checksum singular

This script is loosely based on the make_tar.sh script from upstream.

Depends on #17635

CC: @jpflori @burcin @sagetrac-jakobkroeker @kiwifb @malb @mkoeppe @vbraun @nthiery @bhutz @miguelmarco @sagetrac-gjorgenson

Component: packages: standard

Author: Jakob Kroeker, Jean-Pierre Flori, Jeroen Demeyer, John Perry, François Bissey, Leif Leonhardy, Dima Pasechnik

Branch: f1a0dcc

Reviewer: François Bissey, Jeroen Demeyer, Ben Hutz, Leif Leonhardy, Dima Pasechnik, Travis Scrimshaw

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

jdemeyer commented 9 years ago

Branch: u/jdemeyer/ticket/17254

jdemeyer commented 9 years ago

Commit: 2fcaeb5

jdemeyer commented 9 years ago

Description changed:

--- 
+++ 
@@ -1 +1 @@
-
+**Lots** of stuff has changed in Singular 4. The attached branch is far from working.
jpflori commented 9 years ago
comment:2

Yeah, the update is non trivial, that's a reason to get #17184 (and so #16882) inbetween.

jdemeyer commented 9 years ago
comment:3

Replying to @jpflori:

Yeah, the update is non trivial

I wonder if we even have a Sage developer who is familiar enough with Singular to do this (for the record: not me, I know nothing about Singular).

that's a reason to get #17184 (and so #16882) inbetween.

Of course, I'm not arguing with that.

jpflori commented 9 years ago
comment:4

Replying to @jdemeyer:

Replying to @jpflori:

Yeah, the update is non trivial

I wonder if we even have a Sage developer who is familiar enough with Singular to do this (for the record: not me, I know nothing about Singular).

Maybe Burcin would do... IIRC the update was proposed as a GSoC project.

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago
comment:6

Q: where to get the singular tarball for this commit? I get a failure at

Trying to download http://www.sagemath.org/packages/upstream/singular/singular-4.0.1p1.tar.bz2

2.

Update to Singular 4.0.1

Maybe Burcin would do...

Could the update to 4.0.1. be done by at least two or three persons to spread the knownledge about Singular internals?

jpflori commented 9 years ago
comment:7

You have to put a tarball repackaged by the spkg-src script in the upstream folder directly. Once the ticket is merged, the tarball will be put on the official mirror and could be downloaded automatically but not at the moment.

I've put a repackaged tarball at:

jpflori commented 9 years ago
comment:8

(I'm not sure the checksums will the same as what Jeroen branch expect, run ./sage -sh sage-fix-pkg-checksums after you have downloaded the tarball to fix this.)

jpflori commented 9 years ago
comment:9

And I'd be happy to work on the upgrade and learn more about Singular's internals, but please also review the "easy" #17184 (where I've already learnt some stuff) firsT.

jdemeyer commented 9 years ago

Description changed:

--- 
+++ 
@@ -1 +1,3 @@
 **Lots** of stuff has changed in Singular 4. The attached branch is far from working.
+
+Repackaged upstream tarball: [http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-4.0.1p1.tar.bz2](http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-4.0.1p1.tar.bz2)
ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago
comment:11

Singular 4.0.1. compiles now in sage but sage does not yet - I just pushed a branch 'u/jakobkroeker/ticket/17254'. You have to correct the 'singular-4.0.1p1.tar.bz2' tarball to get it work ( the 'm4' folder is missing).

For the moment I removed some patches; we probably will have to adjust them later on. For example there is meanwhile no such thing like 'lomalloc_ndebug' so if we want to disable some debug functionality or output for omalloc we have to do that by passing appropriate flags to omalloc/configure, e,g '--enable-optimizationflags --disable-debug --without-debug' ?

Also I disabled the currently broken '--enable-debugoutput' configure flag for the standalone 'factory' and informed Oleksander Motsak about the issue.

Could someone of you take care of the sage compile errors and figure out what is going wrong and/or ask for help in the Singular forum? I can't do that easily, because within the Singular-team I'm out-of-favor because I constantly criticise their software and thus I will likely get little or no support.

Jakob

jdemeyer commented 9 years ago

Changed branch from u/jdemeyer/ticket/17254 to u/jakobkroeker/ticket/17254

jdemeyer commented 9 years ago

New commits:

4c0bba3 singular 4.0.1 builds now, but sage does not due to changes in libsingular?
jdemeyer commented 9 years ago

Changed commit from 2fcaeb5 to 4c0bba3

jdemeyer commented 9 years ago

Changed commit from 4c0bba3 to 2fcaeb5

jdemeyer commented 9 years ago

Changed branch from u/jakobkroeker/ticket/17254 to u/jdemeyer/ticket/17254

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago
comment:14

first hint: for example the interface of 'naIsZero' seems changed from

BOOLEAN naIsZero(number a)

to

BOOLEAN naIsZero(number a, const coeffs cf)

Persons who might have an idea about the changes:

Oleksandr Motsak Mohamed Barakat Martin Lee Hans Schönemann

see contact details at http://www.mathematik.uni-kl.de/agag/mitglieder/

jdemeyer commented 9 years ago
comment:16

Replying to @jpflori:

I've put a repackaged tarball at:

That's an older version than the one that I put in the ticket description, any reason...?

jdemeyer commented 9 years ago
comment:17

Replying to @sagetrac-jakobkroeker:

You have to correct the 'singular-4.0.1p1.tar.bz2' tarball to get it work ( the 'm4' folder is missing).

My tarball compiled fine, so what is the problem?

jdemeyer commented 9 years ago
comment:18

You should never run ./autogen.sh, that is supposed to be run at packaging-time, not build-time.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 2fcaeb5 to 80a6b05

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

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

79c079fUpgrade to Singular-4-0-1
4c0bba3 singular 4.0.1 builds now, but sage does not due to changes in libsingular?
80a6b05Merge commit '4c0bba3' into ticket/17254
ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago
comment:20

My tarball compiled fine, so what is the problem?

Confirm; cannot reproduce the issue. So likely I didn't use the recent tarball, or I screwed something up.

You should never run ./autogen.sh, that is supposed to be run at packaging-time, not build-time.

I'm guilty ;-)

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago
comment:21

singulars spkg-install:

the '--enable-debugoutput' configure flag for standalone factory needs now in additon '--enable-streamio --without-Singular'

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago
comment:22

After a little more tweaking and temporarily disabling the extension fields/rings, I was able to build some parts of sage with Singular 4.0.1 on a 'fc18 system' and then.. sage crashes at start! That happens because I didn't update ring creation right - I only recently discovered examples at './libpolys/tests/rings_test.h'. And some sage packages create common rings at loading time.

remaining riddles:

See branch u/jakobkroeker/ticket/17254 and some notes at https://github.com/jakobkroeker/jk_test_sage/issues/13

If a build get stuck before errors described above, then maybe a 'make distclean' is necessary. And of course, the Singular tarball http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-4.0.1p1.tar.bz2 is required.

Any help appreciated.


New commits:

79c079fUpgrade to Singular-4-0-1
2fcaeb5Update Singular to 4.0.1
4c0bba3 singular 4.0.1 builds now, but sage does not due to changes in libsingular?
80a6b05Merge commit '4c0bba3' into ticket/17254
2ae243amessy fixes
ff2a9dcrequired changes for singular to build sage; should be fixed upstream
3b7877ehacking sage to build with Singular 4.0.1. needs more love for extension coefficient fields and a refactoring
f178dfcfixing nr2mMapZp call
ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

Changed commit from 80a6b05 to f178dfc

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

Changed branch from u/jdemeyer/ticket/17254 to u/jakobkroeker/ticket/17254

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8ba17d8messy fixes
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from f178dfc to 8ba17d8

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 8ba17d8 to c2a21bd

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

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

2ae243amessy fixes
ff2a9dcrequired changes for singular to build sage; should be fixed upstream
3b7877ehacking sage to build with Singular 4.0.1. needs more love for extension coefficient fields and a refactoring
f178dfcfixing nr2mMapZp call
8e82387Merge branch 'u/jakobkroeker/jakobkroeker.ticket.17254' of git://trac.sagemath.org/sage into jakobkroeker.ticket.17254
c2a21bdfixed some ring creation
ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

Changed commit from c2a21bd to none

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

Changed branch from u/jakobkroeker/ticket/17254 to trac/u/jakobkroeker/ticket.17254.squashed

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

New commits:

6384b9bUpgrade to Singular 4.0.1: incomplete, messy patch(first aproach)
ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

Commit: 6384b9b

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

Changed branch from trac/u/jakobkroeker/ticket.17254.squashed to u/jakobkroeker/ticket.17254.squashed

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago

Description changed:

--- 
+++ 
@@ -1,3 +1,3 @@
-**Lots** of stuff has changed in Singular 4. The attached branch is far from working.
+**Lots** of stuff has changed in Singular 4. But now the attached branch is almost working.

 Repackaged upstream tarball: [http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-4.0.1p1.tar.bz2](http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-4.0.1p1.tar.bz2)
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

221c5d6Upgrade to Singular 4.0.1: incomplete, messy patch(first aproach)
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 6384b9b to 221c5d6

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 221c5d6 to 1e84789

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

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

1e84789one more renaming from libsingular to libSingular
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

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

3a512cdimproved error handling messages when loading Singular
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 1e84789 to 3a512cd

6bfcfeed-779b-4b16-82e6-63808dde0af0 commented 8 years ago
comment:31

What is the status of this ticket? I see the branch is off 6.5.rc0, which is quite old already...

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 8 years ago
comment:32

What is the status of this ticket? I see the branch is off 6.5.rc0, which is quite old already...

I'm busy and can't work on the ticket currently and expect to have time for the ticket at end of June, not earlier...

with the state as is, sage should build and start (using the Singular tarball from above), but extension fields and transcendental fields are not functional yet and also a cython Singular-interface cleanup has to be done.

johnperry-math commented 8 years ago
comment:33

Replying to @sagetrac-jakobkroeker:

I'm busy and can't work on the ticket currently and expect to have time for the ticket at end of June, not earlier...

with the state as is, sage should build and start (using the Singular tarball from above), but extension fields and transcendental fields are not functional yet and also a cython Singular-interface cleanup has to be done.

I'm at SD64.25 and am willing to work on this, but I'll need some hand-holding since I haven't worked on a package like this before. Do you have any suggestions for ways to test extension and transcendental fields?

johnperry-math commented 8 years ago
comment:34

I just applied this to 6.4.1 and encountered the message,

fatal error: Singular/libsingular.h: No such file or directory

while compiling

build/cythonized/sage/algebras/letterplace/free_algebra_element_letterplace.cpp

Any ideas what causes this?

kiwifb commented 8 years ago
comment:35

I haven't looked yet at the new singular 4.0.x but the first port of call would be to check if the header is indeed installed in $SAGE_LOCAL/include.

johnperry-math commented 8 years ago
comment:36

Replying to @kiwifb:

I haven't looked yet at the new singular 4.0.x but the first port of call would be to check if the header is indeed installed in $SAGE_LOCAL/include.

Shortly after, that installation of Sage fell completely apart (not sure why) so now I'm working on Sage-6.7.

On 6.7, git identifies some issues with merging in singular.pyx and ring.pyx, but they're fairly clear to fix, so I did. (Unless they weren't easy.) Things went much further this time, until I encountered this error:

****************************************************
### Singular spkg-install: choose_patches ###
### Singular spkg-install: apply_patches ###
Applying /Applications/sage-6.7/local/var/tmp/sage/build/singular-4.0.1p1.p0/patches/stricmp.patch
can't find file to patch at input line 7
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|stricmp is being deprecated in Cygwin.
|One should use strcasecmp.
|See https://cygwin.com/ml/cygwin/2014-10/msg00359.html
|diff -druN src/latest/Singular/run.c src/latest/Singular/run.c
|--- latest/Singular/run.c  2014-11-19 14:06:05.000000000 +0100
|+++ latest/Singular/run.c  2015-01-16 09:32:45.771298300 +0100
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
Error applying '/Applications/sage-6.7/local/var/tmp/sage/build/singular-4.0.1p1.p0/patches/stricmp.patch'
Error building Singular (error in apply_patches).

Here's what the file in question suggests:

stricmp is being deprecated in Cygwin.
One should use strcasecmp.
See https://cygwin.com/ml/cygwin/2014-10/msg00359.html
diff -druN src/latest/Singular/run.c src/latest/Singular/run.c
--- latest/Singular/run.c       2014-11-19 14:06:05.000000000 +0100
+++ latest/Singular/run.c       2015-01-16 09:32:45.771298300 +0100
@@ -45,6 +45,7 @@
  #include <sys/stat.h>
  #include <sys/cygwin.h>
  #include <sys/unistd.h>
+ #define stricmp strcasecmp
 //WinMainCRTStartup() { mainCRTStartup(); }
 #else
  #include <direct.h>

Indeed, I do not find run.c in local/var/tmp/sage/build/singular-4.0.1p1.p0/src/latest/Singular/, which I am guessing is where this is supposed to be; instead, I find only run.h.

In my local distribution of Singular, I find a run.c. If I copy it over & try to make, I get the same complaint, & it looks as if the file is actually deleted. Suggestions?