installing C compiler on Mac
I do not have a Macintosh but I am developing a Bioinformatics
computer program which also runs on Mac. My computer program is mixed
Java, C/C++ and Fortran because many free tools are embedded.
The program parts that are not in Java are compiled on the client
computer. The compilation process is launched automatically by the
main application which is in Java1.4.
C/C++ and Fortran are installed on all modern UNIX so that no
additional installation is necessary for the user.
The user has only to specify the compiler commands and options.
By default f77, gcc or g++ is assumed.
MS-Windows supports only Q-BASIC and the application has to install
Cygwin for MS-Windows.
I was surprised, that the compilers are not installed by default on a
Macintosh and the Mac user needs to install the compilers! I thought
that Mac-OSX is a complete BSD UNIX.
At least BASH and PERL and Pymol seem to be present.
My question to the forum: I need simple installation instructions or a
Web link for the users of my program. It should not be
too technical because the program is used by people who are not
necessarily computer specialists.
What compilers would you recommend.
Is gcc optimized for the RISC processor inside Macintosh or are ther better compilers available?



Compilers on OS X
Yes, OS X does not have a compiler installed by default. They are installed as part of the Apple developer tools which are freely available from Apple (http://developer.apple.com/tools/xcode/index.html). You can also install various GNU development tools using FINK (fink.sf.net). OS X is a complete UNIX, and not having compilers installed by default doesn't change that. The majority of OS X users don't even know what a compiler is, much less require the use of one. Therefore Apple has done the smart thing by eliminating unnecessary disk contents from the default installation. The Apple developer tools are very easy to obtain and install so providing users with a link to the xcode tools download is sufficient. The compilers installed by Apple's installation package (gcc, etc) are very well optimized for both PowerPC and x86 processors.
Many thanks. I read in the
Many thanks.
I read in the Xcode Web page that it is an IDE. The user
of my application does not necessarily need an IDE, the crude
back-ends are only needed by my program. But I did not find how to
skip the IDE. Hopefully, the IDE part is not very large.
Could one convince the people who decide what comes into the default
Mac installation that a compiler is an essential tool which must be
present in any Macintosh?
You mentioned a strong argument for including the compilers: Most
Macintosh users even do not know what a compiler is and do not want to
be bothered with installation of compilers if an application needs
one. A compiler is only a couple of Megabytes and there HDs in
Macintosh is quite large.
Here is what I want to tell the user in an information box.
Is it good ?
"A Compiler takes a computer program given as source text in a certain computer language and"+
"produces an executable program for a particular computer type (here Macintosh OS-X)."+
"Therefore compilers are essential tools for computer users who use Bioinformatics UNIX software."+
"If you do not have C/C++ and Fortran compilers installed yet you could install either Xcode or fink."+
"Compilers are launched using a specific terminal commands."+
"Only if these commands differ from the standard cc, c++ and f77 "+
"you must specify the command names in STRAP. "+
"You can simply find out which compiler commands are valid using the Macintosh terminal window:"+
"Typing cc for \"compile C-program\" or c++ for \"compile C++ program\" or f77 for \"compile Fortran program\""+
"into the terminal shell must yield a message like gcc: no input files."+
"The GNU versions may have the commands gcc and g++ instead of cc and c++ instead.",
)ChSwing.pan(Web.b("http://fink.sourceforge.net/"), Web.b("http://developer.apple.com/tools/xcode/"))
Note though that the
Note though that the developers tools are required to use fink.
Also the developers tools include c and c++ compilers but no fortran. Fink can install g77 (for a f77 compiler) and both g95 and gfortran (fortran 95 compilers).
xcode + g77 or gfortran
The users of your code should first install Apple developer tools which are freely available from Apple, this includes the GCC compilers. Most freely available source code requires Mac users to install the developer tools and this is straight forward. I think there is a way not to install xCode but I don't think you should worry about this.
Fortran compilers are not supplied by the Apple developer tools. People can install Fortran complier from the Fink project or MacPorts but I think the safest way is to install the compilers available at http://hpc.sourceforge.net. There is also an installer available from Macresearch which packages this distribution plus some plugins for xCode.