Sujet : Re: in gfortran, is it faster compile times with *.mod files ?
De : tkoenig (at) *nospam* netcologne.de (Thomas Koenig)
Groupes : comp.lang.fortranDate : 14. Nov 2024, 07:48:47
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vh46gf$2mgb8$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : slrn/1.0.3 (Linux)
Lynn McGuire <
lynnmcguire5@gmail.com> schrieb:
On 11/12/2024 2:59 PM, Thomas Koenig wrote:
Hm... maybe another point. If you want to find discrepancies in
argument lists, you could concatenate all your Fortran source files
into one (which will be large, I presume) and then run "gfortran
-fsyntax-only" on it. You could then get error messages like
$ cat mismatch.f
subroutine foo(a)
real a
end
subroutine bar
call foo(42)
end
$ gfortran -fsyntax-only mismatch.f
mismatch.f:6:72:
6 | call foo(42)
| 1
Error: Type mismatch in argument 'a' at (1); passed INTEGER(4) to REAL(4)
which you could then investigate.
>
Yeah, I really do not want to do that as it will be only a special run.
I want the errors to show up during each compile so that the programmer
will fix them right then and there.
Then modules are your best choice, I think.
On the other hand, -fsyntax-only is very fast because it does not
do code generation at all. It might be worth a try to see how
long it takes on your whole codebase, and if it can be integrated
into your normal compilation process.
And we had a user run into an unbalanced argument call to a subroutine
on Monday. One of us had changed a subroutine argument list and fixed 8
out of the 9 calls. No telling how many of those land mines are sitting
in our software.
You will find out with -fsyntax-only. Another possibility is -flto, but
then the final "linking" step will take a very long time. Might speed
up things in the resulting executable, though.