*BSD News Article 92504


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!serv.hinet.net!news-peer.nctu.edu.tw!news.nctu.edu.tw!spring.edu.tw!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!ais.net!uunet!in1.uu.net!140.142.64.3!news.u.washington.edu!root
From: kargl@troutmask.apl.washington.edu (Steven G. Kargl)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Fortran on FreeBSD
Date: 1 Apr 1997 18:38:25 GMT
Organization: University of Washington
Lines: 73
Message-ID: <5hrkn1$sib@nntp1.u.washington.edu>
References: <5hrd3n$58n@lace.colorado.edu>
NNTP-Posting-Host: troutmask.apl.washington.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:38207

In article <5hrd3n$58n@lace.colorado.edu>,
	fcrary@rintintin.Colorado.EDU (Frank Crary) writes:
> Does anyone know where I can find a good fortran compiler for FreBSD
> (v. 2.1.5 if that matters)? g77 seems to object to some variable
> declarations and uses of the save command. Using f2c to convert
> to c isn't as useful to me, since it would require rewriting the make
> files,

I don't understand your statement about rewriting the Makefiles.  There
is a wrapper called f77 that encapsulates the calls to f2c and gcc to
compile fortran.

%f77 -o name -O name.f

is equivalent to

%f2c name.f
%gcc -o name -O name.c -lf2c -lm


To answer your first question, there is no native FreeBSD Fortran compiler
other than f2c+gcc or g77.  I would suggest you check your version of
g77, and if it is older than 0.5.20 you should upgrade.  There are a few
commericially available Fortran compilers for linux that might work
under the linux emulation, but you might have to upgrade your version
of FreeBSD.

> and even so, I'm hitting the known bug reported in the man
> page:
> Untypable EXTERNAL functions are declared int.
> (That is, one of the routines calls a function from a library which
> returns logical, but since it isn't declared as logical in the
> routine, f2c assumes that it's an int, and gives an error when
> the function is used in an if statement...)

You know the function, and the location(s) from where the function is called.
It seems fairly easy to fix.

> So I'm wondering if there are any fortran compilers around, other
> than those in the 2.1.5 distribution.
> 
> (Please don't give me grief about asking for a "good fortran compiler":
> I know that's a contradiction, and I wish the code were in c. But
> I'm trying to install a package someone else wrote, and I don't feel
> like rewriting 2.6 meg of code in c.)

I don't understand this statement.  One should use the best tool
to solve the problem.  For straight number crunching, Fortran is
probably the best choice.  If this 2.6 meg of code contains computations
using complex number, Fortran is perhaps a more nature choice of
language than C.  Of course, if C supported a complex data type
I would abandon Fortran.

> 
>                                                      Frank Crary
>                                                      CU Boulder
> 
> PS: There is a minor bug in the 2.1.5 distribution of g77. It 
> uses something called "f771", which the 2.1.5 installation software
> puts in /usr/local/libexec. g77 can't find it there, and the easiest
> solution I've found is to put a symbolic link in /usr/local/bin.
>                                                       FJC

PS:  If you have a version of g77 from 0.5.16 through 0.5.19, you have
other problems to worry about than the location of f771.  To install
g77-0.5.20, you will need to install gcc-2.7.2.2.  This might not
be too easy on a 2.1.5 system

-- 
Steve

finger kargl@troutmask.apl.washington.edu
http://troutmask.apl.washington.edu/~kargl/sgk.html