Opened 10 years ago

Closed 10 years ago

#352 closed bug (fixed)

gftables/9: Impossible to create a certain ring in block order on Solaris

Reported by: Simon King Owned by: somebody
Priority: major Milestone: 3-1-4 and higher
Component: dontKnow Version: 3-1-1
Keywords: Cc:

Description

I had built Sage on a Solaris machine, and I found the following bug in the Singular version that came with Sage.

For completeness, I show the output of singular --version:

$ ./sage -singular --version
   ? cannot open `help.cnf`
Singular for SunOS-5 version 3-1-1 (3114-2011080223)  Aug  2 2011 23:47:38
with
        factory(@(#) factoryVersion = 3.1.1),libfac(3.1.1,Feb 2010),
        GMP(4.2),NTL(5.5.2),32bit,static readline,Plural,DBM,
        dynamic modules,OM_NDEBUG,random=1312397091
        CC= gcc -O2 -g -fPIC -pipe -DNDEBUG -DOM_NDEBUG -DSunOS_5 -DHAVE_CONFIG_H,
        CXX= g++ -O2 -g -fPIC -pipe -DNDEBUG -DOM_NDEBUG -DSunOS_5 -DHAVE_CONFIG_H (4.5.1)
argv[0]   :     Singular-3-1-1
SearchPath:     /home/simonking/SAGE/sage-4.7.1.rc1mark/local/share/singular:/home/simonking/SAGE/sage-4.7.1.rc1mark/local/LIB
Singular  :     /home/simonking/SAGE/sage-4.7.1.rc1mark/local/bin/Singular
BinDir    :     /home/simonking/SAGE/sage-4.7.1.rc1mark/local/bin
RootDir   :     /home/simonking/SAGE/sage-4.7.1.rc1mark/local
DefaultDir:     /home/simonking/SAGE/sage-4.7.1.rc1mark/local
InfoFile  :
IdxFile   :
HtmlDir   :
ManualUrl :     http://www.singular.uni-kl.de/Manual/3-1-1
ExDir     :
Path      :     /home/simonking/SAGE/sage-4.7.1.rc1mark/local/bin:/home/simonking/SAGE/sage-4.7.1.rc1mark:/usr/local/gcc-4.5.1/sparc-SunOS-ultrasparc3-sun-as-ld/bin:/usr/local/bin/sparc-SunOS-ultrasparc3:/usr/bin:/usr/ccs/bin
EmacsDir  :
Available HelpBrowsers: dummy, emacs,
Current HelpBrowser: dummy
                     SINGULAR                             /  Development
 A Computer Algebra System for Polynomial Computations   /   version 3-1-1
                                                       0<
     by: G.-M. Greuel, G. Pfister, H. Schoenemann        \   Feb 2010
FB Mathematik der Universitaet, D-67653 Kaiserslautern    \
> ring r1 = (9,x),(a,b,c,d,e,f),(M((1,2,3,0)),wp(2,3),lp);
   ? cannot open `gftables/9`
   ? cannot make ring
   ? error occurred in or before STDIN line 1: `ring r1 = (9,x),(a,b,c,d,e,f),(M((1,2,3,0)),wp(2,3),lp);`
   ? expected ring-expression. type 'help ring;'
>

It is not clear to me if the problem is on the end of Sage or Singular. Also, I don't know the component.

Attachments (1)

singular-trac_352-install_gftables_one_by_one.patch (481 bytes) - added by not.really@… 10 years ago.
Patch against Singular 3-1-1-4; installs each GF table separately.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 10 years ago by Oleksandr

Dear Simon,

What happens there on ring r1 = (4,x),(a,b,c,d,e,f),(dp);?

Besides, do you have '/home/simonking/SAGE/sage-4.7.1.rc1mark/local/share/singular/gftables/' with powers of primes: 4, 8, 9, ...

O.

comment:2 Changed 10 years ago by hannes

The directory gftables is missing or at the wrong place: according to your singular path above, it should be at /home/simonking/SAGE/sage-4.7.1.rc1mark/local/share/singular/gftables or at /home/simonking/SAGE/sage-4.7.1.rc1mark/local/LIB/gftables

comment:3 in reply to:  2 ; Changed 10 years ago by Simon King

Replying to hannes:

The directory gftables is missing or at the wrong place: according to your singular path above, it should be at /home/simonking/SAGE/sage-4.7.1.rc1mark/local/share/singular/gftables or at /home/simonking/SAGE/sage-4.7.1.rc1mark/local/LIB/gftables

Hi Hannes, hi Oleksander,

the example over GF(4) shows a similar error: cannot find gftables/4.

There is a directory gftables in one of the places Hannes expected it, but it does not seem to contain what Singular is looking for:

bash-3.00$ ls /home/simonking/SAGE/sage-4.7.1.rc1mark/local/share/singular/gftables
10201
bash-3.00$ ls /home/simonking/SAGE/sage-4.7.1.rc1mark/local/LIB/gftables
/home/simonking/SAGE/sage-4.7.1.rc1mark/local/LIB/gftables: No such file or directory

So, I guess one now needs to find out why the files are not there.

Are the files created when Singular is built? Or are they created when one first requests a ring over a finite non-prime field?

comment:4 Changed 10 years ago by Simon King

Another bit of information: Sage defines environment variables SINGULAR_EXECUTABLE and SINGULARPATH.

sage: [(s,v) for s,v in os.environ.iteritems() if 'SINGULAR' in s]
[('SINGULAR_EXECUTABLE', '/home/simonking/SAGE/sage-4.7.1.rc1mark/local/bin/Singular'), ('SINGULARPATH', '/home/simonking/SAGE/sage-4.7.1.rc1mark/local/share/singular')]

At least on the computer in my office (some Linux), Singular is indeed using SINGULARPATH for storing the finite field tables.

Question: Is SINGULARPATH an "official" Singular environment variable, or is that a Sage-special obtained by patching Singular?

comment:5 in reply to:  3 ; Changed 10 years ago by Simon King

Replying to SimonKing:

bash-3.00$ ls /home/simonking/SAGE/sage-4.7.1.rc1mark/local/share/singular/gftables 10201

What I really find odd: There is a table only for the ring of order 10201. I'd expect that either all are there, or none. But why exactly one?

Do you have access to a Solaris machine? Does Singular build fine on it?

comment:6 in reply to:  5 ; Changed 10 years ago by Simon King

Replying to SimonKing:

Do you have access to a Solaris machine? Does Singular build fine on it?

I really think it would be important to find out first whether it is a Sage problem or whether it also occurs with "pure" Singular.

comment:7 in reply to:  6 Changed 10 years ago by Simon King

Version: 3-1-33-1-1

Replying to SimonKing:

I really think it would be important to find out first whether it is a Sage problem or whether it also occurs with "pure" Singular.

... respectively whether it still occurs with a more recent Singular version.

I just noticed that one can indicate the version for which the problem occurs. Sage contains 3-1-1.

Anyway. Can you build a working Singular on Solaris?

comment:8 Changed 10 years ago by Simon King

The following indicates that the problem is on Sage's end:

sage: singular.eval('ring r1 = (9,x),(a,b,c,d,e,f),(M((1,2,3,0)),wp(2,3),lp)')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)

/home/simonking/SAGE/sage-4.7.1.rc1mark/<ipython console> in <module>()

/home/simonking/SAGE/sage-4.7.1.rc1mark/local/lib/python2.6/site-packages/sage/interfaces/singular.pyc in eval(self, x, allow_semicolon, strip, **kwds)
    548
    549         if s.find("error") != -1 or s.find("Segment fault") != -1:
--> 550             raise RuntimeError, 'Singular error:\n%s'%s
    551
    552         if get_verbose() > 0:

RuntimeError: Singular error:
   ? cannot open `gftables/9`
   ? cannot make ring
   ? error occurred in or before STDIN line 39: `ring r1 = (9,x),(a,b,c,d,e,f),(M((1,2,3,0)),wp(2,3),lp);`
   ? expected ring-expression. type 'help ring;'
sage: R.<a,b,c,d,e,f> = GF(9,'x')[]
sage: singular(R)
//   characteristic : 3
//   1 parameter    : x
//   minpoly        : (x^2-x-1)
//   number of vars : 6
//        block   1 : ordering dp
//                  : names    a b c d e f
//        block   2 : ordering C
sage: singular.eval('ring r1 = (9,x),(a,b,c,d,e,f),(M((1,2,3,0)),wp(2,3),lp)')
'ring r1 = (9,x),(a,b,c,d,e,f),(M((1,2,3,0)),wp(2,3),lp);'

In other words: When Sage tries to convert a polynomial ring over a finite field (which relies on libsingular) into Singular, then the missing table is created and can be used later on.

comment:9 Changed 10 years ago by hannes

Singular can be build on Solaris machines (we tried: sparc 32bit, sparc 64-bit, ix86 64-bit). The problem is an error in the way how sage installs singular: Singular contains the required tables in .../Singular/LIB/gtables. Maybe only the first( 10201) of all these tables are copied to the correct place. Simply get the other files from Singular-xxx-share.tar.gz or from the sources.

To the other questions:

  • yes SINGULARPATH indicated the place for Singular-LIBS and gftables, and SINGULAR_EXECUTABLE the path to the binary.
  • gftables are used in Singular for quite a while, so version 3-1-1 or 3-3- does not matter here

comment:10 Changed 10 years ago by Simon King

Hi Hannes,

it really seems the problem is due to Sage, not Singular. See this trac ticket.

When a ring is constructed in Sage via libsingular, then the missing table is automatically created. But if the same ring is directly constructed in Singular, then the missing table is not automatically created.

But I guess it should already be created when Singular is built, right?

comment:11 Changed 10 years ago by hannes

No, gftables are parts of the sources and will be copied during installation, but usually not computed (the program for that, a part of factory, will not be build during a standard compilation and installation).

comment:12 in reply to:  11 Changed 10 years ago by Simon King

Replying to hannes:

No, gftables are parts of the sources and will be copied during installation, but usually not computed (the program for that, a part of factory, will not be build during a standard compilation and installation).

Really?? Then I have two questions to ask on the Sage trac: 1. Why are the files not copied on Solaris? 2. How are the files created when libsingular requests them?

comment:13 Changed 10 years ago by not.really@…

The problem that just one file (the first in lexicographical order) gets installed is definitely a Singular problem, because it's in fact one of the install-sh scripts shipped with Singular that was used on the affected Solaris machines which is apparently unable to install more than one file at once.

So you should either update these scripts, or -- IMHO better -- use something like

for f in gftables/*; do ${INSTALL} -c ... "$f"; done

See also trac.sagemath.org/sage_trac/ticket/11645#comment:8 .

Cheers,

Leif

(Had to remove the http... from the sage-trac link since the comment is otherwise rejected as spam ;-) .)

Changed 10 years ago by not.really@…

Patch against Singular 3-1-1-4; installs each GF table separately.

comment:14 Changed 10 years ago by Simon King

Is there a way to mark this ticket as "needs review"? Leif has uploaded a patch.

comment:15 Changed 10 years ago by not.really@…

Replying to not.really@…:

So you should either update these scripts, or -- IMHO better -- use something like

for f in gftables/*; do ${INSTALL} -c ... "$f"; done

FWIW, I've attached a patch to Singular/Makefile.in that fixes this issue (the broken installation of gftables) by installing them one-by-one.

(The patch is against 3-1-1-4; probably this is already fixed in newer releases which I haven't checked.)

-leif

comment:16 Changed 10 years ago by hannes

Resolution: fixed
Status: newclosed

Okay, it is a bug in this make target ( install-libsingular) which Singular does not use. Fixed anyway with rev. 14360

Note: See TracTickets for help on using tickets.