Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

f90 modules and makefile dependencies

4 views
Skip to first unread message

len makin

unread,
Jun 24, 1996, 3:00:00 AM6/24/96
to

Just beginning to use Cray f90 (2.0) and a problem of understanding the
compile link process has arisen. The compiler and link/loader can both
seemingly create links to USEd MODULEs (source or object form). If we
were using (f77) SUBROUTINES it would be simple to specify what depends
on what in the makefile, and have a routine recompiled if its source has
changed. With f90 and modules the compiler can pick up a previously
compiled module (Cray -p modulename option) without this happening.
We don't have a makedepend that works with f90 modules. And as one of my
users puts it:
" If module and program are in separate files,
the compiled version of the program (e.g prog.o) that USEs a
module (contained in, say, mod.o), "knows" that it was created
with file mod.o, so that if mod.o exists, no matter what you
specify in subsequent compilation (e.g. f90 -p modx.o prog.o),
the original, mod.o module is used. This isn't too much of a
problem, except that you can fool yourself that the changed
module (modx.o) works OK (or still doesn't)!
The real problem is if mod.o doesn't exist, or isn't compiled.
UNICOS f90 then looks through ./*.o ./*.a and possibly
any library directories for compiled versions of any module
by the same name (INTERFACE gives only limited protection).
THERE ARE NO WARNING MESSAGES ABOUT THIS!!! - So you can't
be sure you've picked up the right module, without wading
through a loader listing.
Related to this last problem is, if the module is in the same source
file, following on from the program, the compilation will fail."
My own approach so far has been to work out dependencies manually
and place the files in the appropriate order e.g.
.... modul.f90 -p modul.o modul2.f90 -p modul2.o prog.f90 sub.f90

but I would be happier if someone could suggest a more useful/general
approach to the dependency problem for modules. TIA.
Cheers,
Len
Len....@dit.csiro.au | Manager, User Support |
CSIRO Division of Information Technology | CSIRO Supercomputing Facility|
723 Swanston Street, Carlton | Tel: +61 3 9282 2622 |
VIC 3053, Australia | Fax: +61 3 9282 2600 |

John Bray

unread,
Jun 24, 1996, 3:00:00 AM6/24/96
to

I can sympathise with your problems with Cray F90 modules. Have
a look at my paper http://www.nag.co.uk/0/other/ff96/pap_bray.html
to see how we overcame similar problems.

Our solution was to write our own simple parses as an equivalent to
makedepend, and ensure we had explicit rules for all compilation and
a close relation in our CM system between module name and filename.

John

--
John Bray, Room 337, Numerical Weather Prediction, UK Met Office
Work: jrb...@meto.gov.uk, 01344-854035, http://fr0400/~frjb
Home: jb...@cix.compulink.co.uk, http://www.compulink.co.uk/~vicarage/

swalia

unread,
Jun 30, 1996, 3:00:00 AM6/30/96
to
0 new messages