I'd like to install a Fortran compiler on Leopard.
I've found that g77 that I have used is moving toward
gfortran. And some of the documentation says that
I'll need to install an Apple Developer Kit for it.
Should I only look at gfortran and not g77 now?
Is there a dmg available to install it on Leopard?
Which Apple Developer's Tools would I need to install
from the Mac OS Leopard disk to get a version to work?
I'm trying to avoid distributions that include gcc, as
gcc is already in Leopard and I'm concerned about
overwriting that version.
Any tips on selecting distribution, etc. are welcome.
I just want to compile and run some simple Fortran
programs I've written in the past. No parallel or
vector stuff required, although such a capable
compiler I guess wouldn't hurt.
Thanks, John
New to Mac OS, but not UNIX and friends.
David Wood - 10 Dec 2007 18:39 GMT
> Should I only look at gfortran and not g77 now?
If you're using the Intel architecture, g77 is no longer an option,
if I remember correctly. (Fortran 95 is nicely supported by g95,
available under fink.)
> Is there a dmg available to install it on Leopard?
Possibly, but you're safer building your own from source (see my
fink remarks below).
> Which Apple Developer's Tools would I need to install
> from the Mac OS Leopard disk to get a version to work?
I'd install the lot of XCode stuff (except for Web development).
> I'm trying to avoid distributions that include gcc, as
> gcc is already in Leopard and I'm concerned about
[quoted text clipped - 4 lines]
> vector stuff required, although such a capable
> compiler I guess wouldn't hurt.
I would *strongly* urge you to investigate, then install the
fink package management system--works very well, and stays
out of the way of system tools.

Signature
D. M. Wood
wood43@comcast.net
Dave Seaman - 10 Dec 2007 18:46 GMT
> I'd like to install a Fortran compiler on Leopard.
> I've found that g77 that I have used is moving toward
> gfortran. And some of the documentation says that
> I'll need to install an Apple Developer Kit for it.
You need to install Xcode. It's an optional install on your Leopard disk.
> Should I only look at gfortran and not g77 now?
Yes.
> Is there a dmg available to install it on Leopard?
Not exactly, but it's available from fink. <http://www.finkproject.org/>
After downloading and installing fink-0.27.8 for leopard, you can then do
sudo fink install gcc42
Another possibility is to use macports: <http://www.macports.org/>.
> Which Apple Developer's Tools would I need to install
> from the Mac OS Leopard disk to get a version to work?
Xcode.
> I'm trying to avoid distributions that include gcc, as
> gcc is already in Leopard and I'm concerned about
> overwriting that version.
It won't overwrite.
[orion:~] $ which gcc
/usr/bin/gcc
[orion:~] $ which gcc-4
/sw/bin/gcc-4
[orion:~] $ which gfortran
/sw/bin/gfortran
> Any tips on selecting distribution, etc. are welcome.
> I just want to compile and run some simple Fortran
> programs I've written in the past. No parallel or
> vector stuff required, although such a capable
> compiler I guess wouldn't hurt.
Leopard comes with openmpi, but only with support for C and C++. If you want
to write MPI programs in Fortran, you should do
sudo fink install openmpi

Signature
Dave Seaman
Oral Arguments in Mumia Abu-Jamal Case heard May 17
U.S. Court of Appeals, Third Circuit
<http://www.abu-jamal-news.com/>
Richard Maine - 10 Dec 2007 18:54 GMT
> I'd like to install a Fortran compiler on Leopard.
> I've found that g77 that I have used is moving toward
> gfortran. And some of the documentation says that
> I'll need to install an Apple Developer Kit for it.
You have to install that for just about any kind of programming work in
any language. It has some of the basic tools that you'll need.
> Should I only look at gfortran and not g77 now?
Or g95. Both gfortran and g95 are open source Fortran 95 compilers for
the Mac. I'd not install g77 today, but that's your choice.
There is also quite a selection of commercial compilers available, but
they cost money.
> Is there a dmg available to install it on Leopard?
There are OS X binaries for g95. See www.g95.org. They aren't packaged
as a dmg file. (But then, as you say you aren't new to Unix, a tgz
(gzipped tar) file ought to be something you've seen before.
It works fine on Leopard. There are annoying warning messages from the
assembler. That appears to be an issue with the underlying gcc stuff.
They are quite annoying (you'll get a lot of them with pretty much any
compilation), but not of any real consequence.
There appears to be a gfortran binary for OS X. though I haven't tried
it in quite a while and don't know whether it has Leopard issues or not.
See <http://gcc.gnu.org/wiki/GFortranBinaries>.
> Which Apple Developer's Tools would I need to install
> from the Mac OS Leopard disk to get a version to work?
It seems like Apple changes the name of the developer tools every few
years. :-( These days they are called XCode.

Signature
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
Jeffrey Jones - 11 Dec 2007 04:01 GMT
> I'd like to install a Fortran compiler on Leopard.
> I've found that g77 that I have used is moving toward
> gfortran. And some of the documentation says that
> I'll need to install an Apple Developer Kit for it.
Get gfortran here: <http://hpc.sourceforge.net/>.
It installs in /usr/local/ and won't overwrite anything from Xcode.
John - 12 Dec 2007 04:49 GMT
>> I'd like to install a Fortran compiler on Leopard.
>> I've found that g77 that I have used is moving toward
[quoted text clipped - 3 lines]
> Get gfortran here: <http://hpc.sourceforge.net/>.
> It installs in /usr/local/ and won't overwrite anything from Xcode.
Thanks! I now have gfortran working. Is there an environment
variable I can set to have the "make" command (with no makefile)
pick up gfortran rather than f77?
make hello.c finds cc (/usr/bin/cc linked to gcc)
make hello.f looks for f77, can't find it.
Or should I just create a link in /usr/bin to point f77 to
/usr/local/bin/gfortran?
Thanks, John
Dave Seaman - 12 Dec 2007 13:24 GMT
>>> I'd like to install a Fortran compiler on Leopard.
>>> I've found that g77 that I have used is moving toward
[quoted text clipped - 3 lines]
>> Get gfortran here: <http://hpc.sourceforge.net/>.
>> It installs in /usr/local/ and won't overwrite anything from Xcode.
> Thanks! I now have gfortran working. Is there an environment
> variable I can set to have the "make" command (with no makefile)
> pick up gfortran rather than f77?
> make hello.c finds cc (/usr/bin/cc linked to gcc)
> make hello.f looks for f77, can't find it.
> Or should I just create a link in /usr/bin to point f77 to
> /usr/local/bin/gfortran?
> Thanks, John
The default compilers used by make are specified by
FC Fortran Compiler
CC C Compiler
CXX C++ Compiler

Signature
Dave Seaman
Oral Arguments in Mumia Abu-Jamal Case heard May 17
U.S. Court of Appeals, Third Circuit
<http://www.abu-jamal-news.com/>