octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: F77 vs. F90 in Octave


From: Daniel J Sebald
Subject: Re: F77 vs. F90 in Octave
Date: Mon, 24 Nov 2014 13:33:31 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 11/24/2014 11:52 AM, Rik wrote:
On 11/24/2014 09:36 AM, Daniel J Sebald wrote:
On 11/24/2014 11:02 AM, Rik wrote:
A quick check for F90 features shows that>   95% is written in F77.  The
exceptions are some files in blas-xtra and lapack-xtra written by Jaroslav
that seem to be in a mostly F77 syntax, but with a few F95 features.

Is the F95 code using a different compiler then?  Or maybe same compiler
but a compatibility flag?  How is it compiling if FC=$F77?

As far as I can see, we've simply been getting lucky.  The Fortran compiler
on most Linux systems is gfortran which can compile both F77 and F90 code.

It's fine if autoconf recognizes that gfortran is compatible with both, but we shouldn't have to force FC=$F77.

I'm rebuilding from scratch at the moment after having removed FC=$F77. I just noticed there is a related modification earlier than the make stage. Inside the bootstrap is the following:

bootstrap_epilogue ()
{
  ## G77 is obsolete, but it is still the first option in the autoconf
  ## Fortran macros.  We should avoid it, because mixing old versions of
  ## g77 with modern gcc and g++ causes trouble.  The following will
  ## make it harder (but not impossible) for users to make this mistake.
  ##
  ## FIXME -- we should really work to fix autoconf so that it prefers
  ## gfortran over g77 even when searching for a Fortran 77 compiler.

echo "replacing all occurrences of g77 with gfortran in configure script..."

  sed 's/g77/gfortran/g' configure > configure.t
  mv configure.t configure
  chmod 755 configure
}

Perhaps that workaround is out of date. How does one tell what order autoconf is using for compiler preference (I've grepped in the auto* scripts and can't find anything)? But more than that, isn't the AC_PROG_F77 macro supposed to control this?

http://www.hep.by/gnu/autoconf/Fortran-Compiler.html

That is, if we want gfortran to have precedence, then we would define (using the example at the above link)

          AC_PROG_F77([gfortran fl32 f77 fort77 xlf g77 f90 xlf90])

So, perhaps that is a better solution than using the stream editor to replace g77.

Anyway, compilation is complete without problems here. What I see in the Makefile is

F77 = gfortran
...
FC = @FC@

What does the FC = @FC@ mean?

Dan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]