Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singular 3-1-1-4.p6 fails to build with gcc 4.6.0. #11084

Closed
sagetrac-drkirkby mannequin opened this issue Mar 29, 2011 · 60 comments
Closed

Singular 3-1-1-4.p6 fails to build with gcc 4.6.0. #11084

sagetrac-drkirkby mannequin opened this issue Mar 29, 2011 · 60 comments

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Mar 29, 2011

After trying to build Sage with gcc 4.6.0 on OpenSolaris, I find it fails when building Singular, despite Singular (and all of Sage) builds with gcc-4.5.0. The same issue occurs on various other systems.

In file included from ../kernel/ring.h:13:0,
                 from ../kernel/ideals.h:11,
                 from ipshell.h:12,
                 from tesths.cc:20:
../kernel/polys-impl.h:177:0: warning: "pPolyAssumeReturn" redefined [enabled by default]
../kernel/polys-impl.h:176:0: note: this is the location of the previous definition
mpsr_Tok.cc: In function 'void mpsr_ttGen()':
mpsr_Tok.cc:551:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
Undefined			first referenced
 symbol  			    in file
uniFactorizer(CanonicalForm const&, Variable const&, bool const&) /export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/local/lib/libsingcf.a(facFqFactorize.o)
ld: fatal: symbol referencing errors. No output written to gentable1
collect2: ld returned 1 exit status
make[4]: *** [iparith.inc] Error 1
Undefined			first referenced
 symbol  			    in file
uniFactorizer(CanonicalForm const&, Variable const&, bool const&) /export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/local/lib/libsingcf.a(facFqFactorize.o)
ld: fatal: symbol referencing errors. No output written to gentable2
collect2: ld returned 1 exit status
make[4]: *** [mpsr_Tok.inc] Error 1
make[4]: Target `install' not remade because of errors.
make[4]: Leaving directory `/export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/spkg/build/singular-3-1-1-4.p4/src/Singular'
make[3]: *** [install] Error 1
make[3]: Leaving directory `/export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/spkg/build/singular-3-1-1-4.p4/src'
make[2]: *** [/export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/local/bin/Singular-3-1-1] Error 2
make[2]: Leaving directory `/export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/spkg/build/singular-3-1-1-4.p4/src'
Unable to build Singular.

real	3m22.783s
user	6m14.242s
sys	0m22.671s
sage: An error occurred while installing singular-3-1-1-4.p4

A full log is attached.

A revised package, which reduces the optimisation level, which at least allows this to build on OpenSolaris may be found at

New spkg, based on #9497: http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-3-1-1-4.p8.spkg

This needs further testing on other platforms.

Other problems related to gcc 4.6.0 can be found on #11216

Upstream: None of the above - read trac for reasoning.

Component: build

Author: David Kirkby, Jeroen Demeyer

Reviewer: Alexander Dreyer, Jeroen Demeyer

Merged: sage-4.7.rc0

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

@sagetrac-drkirkby sagetrac-drkirkby mannequin added this to the sage-4.7 milestone Mar 29, 2011
@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Mar 29, 2011

Attachment: singular-3-1-1-4.p4.log

Failed build of Singular 3-1-1-4.p4 as part of Sage 4.7.alpha2 on a Sun Ultra 27 running OpenSolaris 06/2009

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Mar 29, 2011

comment:1

I've set the component to "solaris" as that is the only confirmed system on which this fails to build. Can someone change the component to "build" if this fails on Linux or OS X.

Dave

@vbraun
Copy link
Member

vbraun commented Mar 30, 2011

comment:2

Also fails on Fedora 15 alpha which uses gcc-4.6

@burcin
Copy link

burcin commented Mar 31, 2011

Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. Little or no feedback.

@burcin
Copy link

burcin commented Mar 31, 2011

comment:3

I just posted this to the libsingular-devel list:

http://groups.google.com/group/libsingular-devel/browse_thread/thread/508c352214392315

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Mar 31, 2011

comment:4

Maybe a demangling issue?
See my comment here:
http://groups.google.com/group/libsingular-devel/browse_thread/thread/508c352214392315?hl=en
My best,
Alexander

@vbraun
Copy link
Member

vbraun commented Mar 31, 2011

comment:5

On a related note, our goal should probably be to update Singular to the newest upstream. IIRC I was able to build the latest upstream with gcc-4.6, but only the standalone singular. I was unable to build libsingular, though.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 7, 2011

comment:6

Replying to @vbraun:

On a related note, our goal should probably be to update Singular to the newest upstream. IIRC I was able to build the latest upstream with gcc-4.6, but only the standalone singular. I was unable to build libsingular, though.

We should really try to get this solved before the 24th May 2011, since Fedora 15 is released then, and Sage will fail to build on a fairly popular linux distribution.

http://fedoraproject.org/wiki/Releases/15/Schedule

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Apr 7, 2011

comment:7

I reported that upstream:
http://www.singular.uni-kl.de:8002/trac/ticket/332

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 7, 2011

comment:8

Replying to @alexanderdreyer:

I reported that upstream:
http://www.singular.uni-kl.de:8002/trac/ticket/332

Thank you.

Burcin has already reported it on the mailing list, but there has been no response from any developers. Having it submitted to the bug database, as you have done, can only be a good thing.

I've updated this to 'critical' as I think it's a pretty important bug to solve. Not that the priories seem to mean very much - e.g. #9739 has been opened for 8 months and has been a blocker for 5 months.

Dave

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 8, 2011

comment:9

I've reported on the singular list that the latest version still fails with gcc 4.6.0. I later tried to post this:


With gcc 4.5.0 the same version builds ok on the same computer, so it does appear to be an issue with gcc 4.6.0.

I would suggest it would be worth trying to build this with Sun Studio (which is a free download)

http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html

on a Linux system. The Sun (Oracle) compiler is much stricter than the GNU compilers, so will show up problems that current versions of GCC may not. It goes without saying this will not build with Sun Studio. (I tried this on a Solaris system, but you should get the same on a Linux machine).

Dave


but it was rejected as it was thought to be spam. I guess it contains a link, but I don't think it's too much like spam.

Dave

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Apr 8, 2011

comment:10

In principle not a bad idea, but due to some implementation tricks making Singular to compile von Solaris studio would be a full port.

As I pointed out on libSingular-devel, there is a demangling issue for some C++ function names on gcc 4.6. (Maybe tied to optimization options.)

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 8, 2011

comment:11

Replying to @alexanderdreyer:

In principle not a bad idea, but due to some implementation tricks making Singular to compile von Solaris studio would be a full port.

It suspect it would only need to be converted to standard C and/and C++.

As I pointed out on libSingular-devel, there is a demangling issue for some C++ function names on gcc 4.6. (Maybe tied to optimization options.)

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Apr 8, 2011

comment:12

It suspect it would only need to be converted to standard C and/and C++.

Indeed, but this is ot done overnight.

And: it won't fix this bug here. The lines of source code, that cause trouble are standard, this problem seems to accur during the compiler's optimization.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 8, 2011

comment:13

Replying to @alexanderdreyer:

It suspect it would only need to be converted to standard C and/and C++.

Indeed, but this is ot done overnight.

True.

And: it won't fix this bug here. The lines of source code, that cause trouble are standard, this problem seems to accur during the compiler's optimization.

IIRC, Singular uses -O3, which is a bit risky. Perhaps the optimiation level can be dropped to -O2, which is much safer. If I'm mistaken, and it is -O2, then I don't have any suggestions.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 19, 2011

comment:34

Replying to @jdemeyer:

David, would you agree with the compromise to weaken your wording about the -O3 issue? I.e. replace "Please do not push the optimisation to -O3. This has caused too many problems." by something along the lines of "Currently, building Singular with -O3 fails using gcc 4.6.0. Therefore, we compile using -O2."

I will make it less strong, but I feel it needs to be a bit stronger than just mention gcc 4.6.0.

How about

The original Singular source code builds part of Singular with -O2 and part with -O3. On several occasions Sage has forced the optimisation of the complete package to -O3, but this has caused various problems (tickets x, y, and x) either with specific compilers or on specific platforms. If you feel tempted to increase the optimiation to -O3, ask on the Singular mailing (whatever@wherever.org) list for advice and discuss in on sage-devel first. Also note that -O3 can be slower than -O2 in some instances.

Does that seem reasonable?

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 19, 2011

comment:35

Replying to @jdemeyer:

Are we really supposed to overwrite CFLAGS instead of appending CLFAGS when SAGE64 is set?

No, that is an error, though it is a separate issue to the subject of the ticket. But it is easy to fix.

Dave

@jdemeyer
Copy link

comment:36

Replying to @sagetrac-drkirkby:

Replying to @jdemeyer:

Are we really supposed to overwrite CFLAGS instead of appending CLFAGS when SAGE64 is set?

No, that is an error, though it is a separate issue to the subject of the ticket. But it is easy to fix.

In that case, please review my spkg http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-3-1-1-4.p8.spkg.

@jdemeyer
Copy link

comment:37

Replying to @sagetrac-drkirkby:

Replying to @jdemeyer:

David, would you agree with the compromise to weaken your wording about the -O3 issue? I.e. replace "Please do not push the optimisation to -O3. This has caused too many problems." by something along the lines of "Currently, building Singular with -O3 fails using gcc 4.6.0. Therefore, we compile using -O2."

I will make it less strong, but I feel it needs to be a bit stronger than just mention gcc 4.6.0.

How about

The original Singular source code builds part of Singular with -O2 and part with -O3. On several occasions Sage has forced the optimisation of the complete package to -O3, but this has caused various problems (tickets x, y, and x) either with specific compilers or on specific platforms. If you feel tempted to increase the optimiation to -O3, ask on the Singular mailing (whatever@wherever.org) list for advice and discuss in on sage-devel first. Also note that -O3 can be slower than -O2 in some instances.

Does that seem reasonable?

It's not unreasonable, but a lot of fuzz about nothing. What do you think of the following comment from my spkg:

# By default, parts of Singular are compiled with -O2 and parts
# with -O3.  If we do set any CFLAGS, this always overrides the
# default CFLAGS set by upstream.  In order to be compatible, we
# set the optimization to -O2.

I think it's most important to explain why we use -O2. Since there is a good reason to use -O2, of course one should not randomly increase the -O level.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 19, 2011

comment:38

Replying to @jdemeyer:

I think it's most important to explain why we use -O2. Since there is a good reason to use -O2, of course one should not randomly increase the -O level.

But my point is that this package does appear to have had the optimisation randomly increased several times, which for Singular is a particularly bad idea, as it has caused numerous problems. Your wording gives no hint of the dangers. We are not being compatible for the sake of it - we are doing so as it is dangerous to do otherwise.

Dave

@jdemeyer
Copy link

comment:39

How about adding a phrase like this:

# By default, parts of Singular are compiled with -O2 and parts
# with -O3.  If we do set any CFLAGS, this always overrides the
# default CFLAGS set by upstream.  In order to be compatible, we
# set the optimization to -O2.  Increasing the optimization level
# to -O3 has caused various problems in the past either with
# specific compilers or on specific platforms.

@jdemeyer
Copy link

comment:40

New package, use -O2 optimization level also for ia64 systems (testing on iras shows that this now works): http://boxen.math.washington.edu/home/jdemeyer/spkg/singular-3-1-1-4.p8.spkg

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 20, 2011

comment:41

That looks ok to me.

Could this not go into 4.7? It seems to me we have fixes for all the gcc 4.6.0 issues. If Sage will build on some platforms with gcc 4.6.0, we have a lot more chance of finding any remaining issues on other platforms.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 20, 2011

Changed reviewer from AlexanderDreyer to AlexanderDreyer, Jeroen Demeyer

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Apr 20, 2011

Changed author from David Kirkby to David Kirkby, Jeroen Demeyer

@jdemeyer
Copy link

comment:43

Replying to @sagetrac-drkirkby:

Could this not go into 4.7?

I'm willing to try...

@jdemeyer jdemeyer modified the milestones: sage-4.7.1, sage-4.7 Apr 20, 2011
@jdemeyer
Copy link

Merged: sage-4.7.rc0

@jdemeyer
Copy link

Changed reviewer from AlexanderDreyer, Jeroen Demeyer to Alexander Dreyer, Jeroen Demeyer

@jdemeyer
Copy link

Changed work issues from Testing on Linux, OS X, Solaris 10 (both x86 and SPARC) with gcc 4.6.0 to none

@jdemeyer
Copy link

comment:45

I have also closed #6240 because of this ticket.

@sagetrac-drkirkby

This comment has been minimized.

@jdemeyer
Copy link

Diff for the singular spkg, for reviewing only

@jdemeyer
Copy link

comment:47

Attachment: singular-3-1-1-4.p6-p8.diff.gz

Please see #11278 for a blocker follow-up, any ideas more than welcome...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants