octave-maintainers
[Top][All Lists]
Advanced

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

Re: FC vs. F77 in Makefiles


From: Rik
Subject: Re: FC vs. F77 in Makefiles
Date: Mon, 24 Nov 2014 08:31:26 -0800

On 11/24/2014 07:57 AM, John W. Eaton wrote:
> On 11/23/2014 09:24 PM, Rik wrote:
>> All,
>>
>> I'm cleaning up configure.ac a bit and I came across this:
>>
>> FC=$F77
>> AC_SUBST(FC)
>>
>> which makes FC an alias for F77 in Makefiles.  However, all of the Makefile
>> rules I see use $F77.  Is there something I'm missing or can we delete this
>> as cruft?
>>
>> Just to test, I commented out the two lines in configure.ac and re-built
>> Octave and there were no issues.
>
> There are a number of places where FC appears, so you'll need to fix
> those if you eliminate the substitution.

I could only find 3 independent instances in the Mercurial tree.

Aliasing FC to $F77
configure.ac:707:FC=$F77
configure.ac:708:AC_SUBST(FC)

Adding the alias into the Makefiles
build-aux/common.mk:94:FC = @FC@
build-aux/common.mk:557:  -e "s|%OCTAVE_CONF_FC%|\"${FC}\"|" \

In README.MacOS
etc/README.MacOS:157:  export FC="/usr/bin/gfortran"
etc/README.MacOS:178:  export FC="/usr/bin/gfortran"
etc/README.MacOS:394:  export FC=/opt/local/bin/gfortran-mp-4.4

My test of commenting out the configure.ac would have taken care of the
first two.  I don't know anything about compiling on MacOS.  Could someone
on a Mac platform comment out lines 707, 708 of configure.ac and then run
the entire build cycle to see if it is successful:
./bootstrap
./configure
make

>
> Maybe it would be best to use FC consistently instead of F77, including
> using the AC_PROG_FC macro instead of F77?  I'm not sure of the
> implications though.

AC_PROG_F77 tries to find a compiler that is Fortran 77 compliant, while
AC_PROG_FC tries to find the most modern Fortran compiler available
(Fortran 95, Fortran 90).  I think if the code base that we have is written
to be compliant with Fortran 77 then we are correct in using AC_PROG_F77.

>
> So another option is to leave things alone as they seem to be working.

I'm motivated to get this right because the Autoconf tools are so baffling
to most people that everyone shrinks from having to modify anything in
them.  This, in turn, allows a lot of cruft to build up which then makes
the files even more difficult to understand and modify--a positive feedback
loop leading to a negative outcome.

--Rik



reply via email to

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