On 06/10/10 01:30 PM, Sergey Bochkanov wrote:
Hello, David

You wrote 10 июня 2010 г., 15:25:03:

It  would  be great if you could check your code with the Sun Studio
compiler, which you can get for free for Linux or Solaris.

It  is  not  great, it is must-have. Building ALGLIB on every platform
where  SAGE builds and with every popular compiler is top priority for
me.

Sage  builds  on  Solaris  systems with SPARC processors. These will
never   have  SSE  instructions,  as  the  processor  is  completely
different  to  Intel/AMD.  You  can  check if the system has a sparc
processor by detecting if __sparc__ is defined.

I  have  no  experience  with  SPARC,  but  I've studied different CPU
architectures before starting this project. "Generic C" build with all
optimizations turned off should work on SPARC and other non x86 ISA's.

BTW, what compilers support this __sparc__ symbol?




Having checked again, __sparc is preferable. That is supported by gcc, g++, cc and CC (the Sun compilers)

kir...@t2:[~] $ cat test.c
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {
#ifdef __sparc
   printf("I'm a SPARC\n");
#endif
}

First on a Solaris 10 machine based on a Sun SPARC processor.

kir...@t2:[~] $ /opt/SUNWspro/bin/cc test.c
kir...@t2:[~] $ ./a.out
I'm a SPARC
kir...@t2:[~] $ /opt/SUNWspro/bin/CC test.c
kir...@t2:[~] $ ./a.out
I'm a SPARC
kir...@t2:[~] $ gcc test.c
kir...@t2:[~] $ ./a.out
I'm a SPARC
kir...@t2:[~] $ g++ test.c
kir...@t2:[~] $ ./a.out
I'm a SPARC

So both the Sun and GNU compilers support __sparc.

On another Solaris machine, but this time based on an Intel Xeon.

drkir...@hawk:~$ /opt/sunstudio12.1/bin/cc test.c
drkir...@hawk:~$ ./a.out
drkir...@hawk:~$ /opt/sunstudio12.1/bin/CC test.c
drkir...@hawk:~$ ./a.out
drkir...@hawk:~$ gcc test.c
drkir...@hawk:~$ ./a.out
drkir...@hawk:~$ g++ test.c
drkir...@hawk:~$ ./a.out
drkir...@hawk:~$ uname -a
SunOS hawk 5.11 snv_134 i86pc i386 i86pc

So I think __sparc will be ok on Solaris. It is defined on a SPARC system and it is not defined on an Intel system.

One can run Linux on a SPARC too, but that is very very rare. I'm not aware of any active development of any Linux distro for the SPARC processor.

I've also got machines running AIX, tru64, HP-UX and IRIX. None of the CPUs in those sorts of machines would support SSE. Clearly there are many system which will never support SSE, though Solaris SPARC is the most critical for Sage.

I doubt the Intel Itanium processors support SSE either, though I'm not 100% sure of that.

Dave

--
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