Robert Bradshaw wrote:
Em, I'm puzzled by this too. It builds fine with the Sun compiler

kir...@t2:[~] $ /opt/SUNWspro/bin/cc  simple_complex.c
kir...@t2:[~] $ ./a.out
CYTHON_CCOMPLEX 1

but not with gcc.

kir...@t2:[~] $ gcc -Wall simple_complex.c
simple_complex.c: In function '__pyx_t_double_complex_from_parts':
simple_complex.c:20: error: '_Complex_I' undeclared (first use in this function) simple_complex.c:20: error: (Each undeclared identifier is reported only once
simple_complex.c:20: error: for each function it appears in.)

I've tested on both t2 (SPARC processors, Solaris 10) and a Sun Ultra 27 (Intel Xeon, Open Solaris 06/2009)


In all cases, it fails with gcc but builds with the Sun compiler.

I'll report this as a gcc bug, as that would seem the most likely reason.

Of course, it works fine with gcc on a wide variety of other platforms, so I don't know what's up with the Solaris gcc.

Any ideas for a workaround?

- Robert



I have one idea for a possible workaround, though I suspect it might cause as many problems as it solves.

Sun produce a compiler which has a gcc like front end, but the Sun Studio back end. It's called Cool Tools - GCC for SunĀ® Systems

http://cooltools.sunsource.net/gcc/index.html

It's designed to give Sun Studio performance, while taking GNU options. I don't know if it is fussy like the Sun Studio compiler though. If so, it will reject a lot of the Sage code.

I could try installing that, but it would make Sage less attractive, as people would have to download and install more stuff. It is possible it will need root access to install too.

If this code was standalone, and did not link to other parts of Sage, then we could perhaps build it with the Sun compiler, though it would take some work to get the code in a state where it would build with the Sun compiler. But since this links with the GCC code, that is not very practical.

The Solaris header file /usr/include/complex.h looks fine to me.

It's now submitted as a gcc bug for Solaris 10.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42753

I will create a separate gcc bug for Open Solaris too.

It fails on every version of gcc, and every version of Solaris (SPARC and x86) I could find to test on.

There is a bug report of this against the C++ compiler g++ 4.0.0 and earlier on i686-pc-linux-gnu.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21057

but the submitter was told:

"Confirmed. However, this has really low priority: the C++ standard is not a superset of the C99 standard, so a number of things new to C99 are not part of C++, and this is one of them."


-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to