GCC is supported on a wide range of platforms, and it is the default compiler on Mac OS X. There are, however, some important differences between the version of GCC that ships with Mac OS X and that found on other Unix systems. One difference that experienced GCC users may notice, particularly if they have dealt with a lot of mathematical and scientific programming, is that the Xcode Tools do not include FORTRAN. However, the Fink distribution (http://fink. sourceforge .net) includes g77 , the GNU FORTRAN 77 compiler. Also, the Darwin archive includes the source code for g77 , which you can use to compile FORTRAN code.
As of this writing, Apple's cc compiler is based on GCC 3.3. However, GCC 3.1 and 2.95 are also available as /usr/bin/gcc2 , and /usr/bin/gcc3 , respectively. By default, invoking cc or gcc invokes GCC 3.3; both /usr/bin/cc and /usr/bin/gcc are symbolic links to /usr/bin/gcc3.3 . You can change the default GCC to GCC 2.95 or GCC 3.1 by running the command gcc_select 2 , or gcc_select 3 , respectively. Similarly, you can change it back to GCC 3.3 with gcc_select 3.3 . The gcc_select command (used with one of the options 2, 3, and 3.3) changes the symbolic links /usr/bin/cc and /usr/bin/gcc to point to the desired version of gcc. Since files in /usr/bin are changed by this command, you must execute it with sudo . You can see the current settings by running gcc_select with no arguments: $ gcc_select Current default compiler: gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
8.1.1 AltiVecThe Motorola AltiVec Velocity Engine is also supported for G4 processors by the Mac OS X GCC implementation. The compiler flag - faltivec must be specified to compile code engineered to use the Velocity Engine. Inclusion of this command-line option to cc defines the preprocessor symbol _ _VEC_ _ . |