octave-maintainers
[Top][All Lists]
Advanced

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

Re: Default F77 is g77


From: Daniel J Sebald
Subject: Re: Default F77 is g77
Date: Mon, 24 Nov 2014 16:50:19 -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 04:27 PM, Rik wrote:
On 11/24/2014 02:00 PM, John W. Eaton wrote:
 On 11/24/2014 04:54 PM, Rik wrote:

> Interestingly, this is the entire list of known compilers so we could
> simply put this list in as the preference to AC_PROG_F77 with gfortran at
> the start like so:
>
> AC_PROG_F77([gfortran g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
xlf90 f90
> pgf90 pghpf epcf90 g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95
lf95 ftn])
>
> I did this and it now picks up gfortran even with g77 symlinked in
/usr/bin.

 I don't like this solution for the reasons that Mike Miller already
stated.

 Also, leaving g77 in the list has the problem of screwing things up if
a system happens to have an old copy of g77 installed but no gfortran.
As far as I know, there are no versions of g77 that will work with
modern versions of gcc and g++.  Since we rely on linking Fortran and
C++ code together, we must have a consistent set of compilers and g77
will never work properly for us.  So we might as well simply avoid it by
replacing instances of g77 in the configure script with gfortran.  That
solution seems to be working for us, so I don't see a reason to change it.


I understand not fixing what isn't broken, but there is also
futureproofing.  Using sed on the generated configure feels like a
fragile solution that may break as things change in the future.  I think
putting in the full list of compilers is also a hack, just slightly less
fragile, as I don't see many new Fortran compilers being written.

Another alternative I like is to error out with a message about the
problems with g77 if it is selected, rather than substituting gfortran
without the user's permission.  In pseudocode,

AC_PROG_F77
if "$F77" = g77; then
   AC_MSG_ERROR([Detected Fortran compiler g77 which does not produce
objects that can be linked with BLAS and LAPACK libraries.  Choose a
different compiler by setting the environment variable F77 and
re-running configure.]
fi

--Rik

I was going to suggest another variation on the theme would be to replace "g77" by "" in the bootstrap file. That way, the precedence is maintained. On my system, "gfortran" still ends up being chosen after AC goes through all the rest and finding none of them.

You do have a point, that sed is required. But it's required in so many other places as well.

I understand "g77" doesn't work, but if one of the reasons for replacing "g77" with "gfortran" is so that "gfortran" is at the front of the list and we really primarily only want to use "gfortran", then maybe

AC_PROG_F77([gfortran coupleothers])

works. The advantage of doing that is then "g77" and "gfortran" can both be present while the user doesn't have to specify F77 environment variable.

Dan



reply via email to

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