[Top][All Lists]

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

Re: Fortran projects

From: Ralf Wildenhues
Subject: Re: Fortran projects
Date: Sat, 15 Nov 2008 11:25:15 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Alberto,

quoting a bit out of order:

* Alberto Luaces wrote on Fri, Nov 14, 2008 at 06:01:31PM CET:
> 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).

That would mean we admit defeat and recreate the dependency gathering
algorithm which the compiler knows about already.  Sigh.

Are module dependencies at least simple to parse from Fortran files?
And here I mean, a *whole lot easier* that #include header dependencies?
Because, in C and C++, the latter are quite ugly to parse without an
actual preprocessor (look at why tools like 'makedepend' are not so
widely used).

And even if we precreate the module dependency graph, I still see no
reason to also do that for the header file dependency graph.  Or do
Fortran compilers not provide dependency output for those either?
(Even so, in that case we could probably still leverage 'makedepend'

> 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.

FWIW, I wouldn't mind not allowing parallel first-time builds.  That
would suck, right, but it would allow for the developer to just list
source files in the right order in *_SOURCES.

> 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

This looks wrong, independently of any proposal.  I assume 'source.f90'
is a user-written file.  In that case it should never depend upon any
other files, in the 'make' prerequisites sense.  I think what you mean
is that the object file, and/or the module description file (if any)
generated from source.f90, depends upon the stuff on the right hand side
of the ':'.  Right?

> 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).


reply via email to

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