[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fortran projects (was: Compilation order)
From: |
Alberto Luaces |
Subject: |
Re: Fortran projects (was: Compilation order) |
Date: |
Fri, 14 Nov 2008 18:01:31 +0100 |
User-agent: |
KMail/1.9.9 |
Hi Ralf,
El Martes 07 Octubre 2008ES 22:34:49 Ralf Wildenhues escribió:
> There are two projects for Automake lurking here:
[snip]
during these weeks I have been thinking a bit about those two problems (header
and module dependencies). I have read the links you provided, specially the
one describing the evolution of dependency tracking in Automake.
I'd go for the first approach, the calculation of dependencies ahead of time.
I would do that because unlike C or C++, in Fortran one can't compile the
sources in any order when dealing with modules (that's the problem I had when
making parallel compilations). If one selected the "dependencies as a side
effect of the compilation" method, he would have to order the list of sources
beforehand; otherwise the first build could fail. Later recompilations would
have success until the dependency graph would change: then we would have
again a first time "fragile" build.
The few compilers I could test couldn't help much on this task. I could
install gfortran, g95 and the linux intel compiler. Neither gfortran nor
Intel can generate dependency rules yet. g95 is able to do so, but if a
source file depends on a module, its .mod file has to be present beforehand,
so that implicitly imposes the requisite of a first time ordered build. I'm
under the impression that those tools are better aimed to provide some help
in order to leverage the recompilation tasks, specially when modifying module
source files. They are able to detect if the interface has been modified, and
if it is not the case, they avoid touching the existent .mod file and cancel
the subsequent compilation of all the sources that depend on it.
I think the first capability one could ask for is to be able to throw the
sources into Makefile.am in any possible order and have a successful build.
The header inclusion problem could be solved in the same way.
My proposal is to write a script that visited the sources in order to know
a) What modules does every source file provide (first pass).
b) What modules and include files a source file depends on, returning the
dependency graph (second pass).
My first approach would be to write the Makefile rules only in terms of source
files, that is:
source.f90: file_providing_required_module.f90 included_file.h
If I can get this working, we could later improve the rules adding the module
information provided by every compiler
source.f90: required_module$(MOD_EXT) included_file.h
That is, starting from an working system towards an efficient system inspired
from the links you gave in 2).
Thoughts?
Alberto
- Re: Fortran projects (was: Compilation order),
Alberto Luaces <=