Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Feb 1997 13:15:11 -0500
From:      Tod Luginbuhl <tod@science-guy.npt.nuwc.navy.mil>
To:        changho nam <chnam@hanul.hangkong.ac.kr>
Cc:        questions@freebsd.org
Subject:   Re: fortran compiler 
Message-ID:  <199702131815.NAA13663@science-guy.npt.nuwc.navy.mil>
In-Reply-To: Your message of "Wed, 12 Feb 1997 12:17:06 %2B0900." <l03010d00af27526f1223@[134.75.55.227]> 

next in thread | previous in thread | raw e-mail | index | archive | help
changho nam writes:
 > Have anyone used a fortran compiler on FreeBSD ?
 > Could you help me how to use a fortran compiler ?

Wes Peters writes:
>The GNU Fortran-77 compiler, g77, should configure and run on FreeBSD.
>It should work with up-to-date versions of the gdb debugger as well.
>The g77 distribution is essentially an add-on to gcc; you first extract
>and configure gcc, then extract and add g77, then build the g77
>compiler.  It's really not all that difficult.  Look on your favorite
>gnu mirror; I usually go to ftp.cdrom.com:/pub/gnu these days.

g77 is available in the ports section.

Christoph Kukulie writes:
>use f77 (the compiler driver).  
>
>file: f.f
>
>       program main
>       write(*,*) 'hello world'
>       end                                
>
>f77 -o f f.f
>
>f77 -c f.f   produces  f.o
>
>f77 -o f f.o a.o b.o
>
>builds the executable out of several .o files.
>
>Learn to use make.
>
>
>For more information of the f77 compiler switches study the f2c man page.
>

f77 is a shell that uses f2c to translate fortran to c, and then uses
cc to compile.

Now for some comments... if you want to use g77, I recommend you take
the time to download from prep.ai.mit.edu (FSF site) or a mirror site
the DOC file from the g77 distribution.  Hopefully you won't have to
grab the entire thing.  The DOC file describes what g77 implements and
does not implement. This is very important if you plan to do anything
in fortran that is an extension to fortran 77.

for f2c (i.e. /usr/bin/f77), go to netlib.com and grab the f2c
documentation (f2c.ps) and read it.  It describes what f2c implements
and does not implement.  Again, this is very important if you want to
use any extensions to fortran 77.

I have a big program I wrote that uses STRUCTURE and RECORD (data
structures) --- data structures of this form are not supported by f2c
or g77.  At some point in the future they will appear in g77.  f2c
supports POINTER statements, but g77 does not.  g77 will at some point
in the future.  I am currently trying to get Absoft's fortran compiler
for Linux (commercial) to run under FreeBSD's Linux emulator for these
reasons.  May be I'm crazy...but I haven't had time to finish by C port
of my program.

Anyway, I hope this helps.

Tod

--------------------------------------------------------------------------

Tod Luginbuhl                             email:  t.e.luginbuhl@ieee.org
Code 2121
Naval Undersea Warfare Center             Telephone: (401) 841-7505 x38241
1176 Howell Street                        FAX:       (401) 841-7453
Newport, Rhode Island
USA

"Don't argue with drunks and fanatics!" -- Sun Wolf (Barabra Hambly)

--------------------------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702131815.NAA13663>