Platform Compiler ANSI POSIX
DECstation cc (Mips C) Yes Yes
gcc Yes Yes
RISC/6000 cc (IBM C) No Yes
c89, xlc Yes Yes
Sun gcc Yes Yes
suncc Yes No
SGI cc Yes Yes
gcc Yes Yes
Linux gcc Yes Yes
NetBSD gcc Yes Yes
These compilers span the range from traditional Kernighan and Ritchie C
to strict ANSI C.
add cygnus(or "add gnu" if you are running Linux or NetBSD and don't have gcc installed locally) and then compile as usual, but use the command gcc in place of the command cc. So instead of typing:
cc -c myfile.cyou would type:
gcc -c myfile.cIf you use a makefile, you could put CC=gcc into your Makefile.
On the RISC/6000 the compiler is called xlc and is from IBM. The three compilers on this platform are actually the same compiler invoked with different switches. If invoked as cc, it will accept code that is not strict ANSI, as well as ANSI source. The other two invocations are much stricter and are often difficult to use.
On the Suns, Sunsoft has provided a compiler which is called suncc on Athena to avoid confusion with cc. To use first type:
add sunsoftand then compile as you would with cc, or gcc, which is also available, and is the recommended compiler on the Suns.
The native Silicon Graphics C compiler "cc", is the best compiler to use for the SGI workstations. It is custom-tailored for the SGI's.
By default, "cc" behaves as if the option "-xansi" were set on the command line. Other available options include:
-cckr traditional K&R C
-ansi ANSI/ISO C
-xansi ANSI/ISO C with same defines as -cckr
-ansiposix ANSI/ISO C and POSIX compliance
The highest level of optimization is specified with the "-O3" flag. You
may also want to use the "-mips2" option, which generates code using the
MIPS 2 instruction set (MIPS 1 plus R4000-specific extensions). For
more information about the MIPS 2 instruction set, and the
/usr/lib/mips2 libraries, see the "mips2 (5)" manual page:
athena% man 5 mips2
see the answer:
22* SGI Answers 7 What COMPILERs are on the SGIfor more information.
last updated: 3/16/96