Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Compaq's fort compiler and .mod files
@ 1999-09-23 15:56 Angus Leeming
  0 siblings, 0 replies; only message in thread
From: Angus Leeming @ 1999-09-23 15:56 UTC (permalink / raw)
  To: axp-list

Hi!

I've a problem with efficient compilation of fortran90 code containing modules
when using Compaq's fortran compiler running on AlphaLinux. This problem 
doesn't occur under OSF/1. I wonder if anybody else has experienced something 
similar?

In more detail:

I have a bunch of files that I compile through a makefile. All generated files
are placed in a subdirectory. The makefile's file dependency info is of the form

$(SUBDIR)/file1.o : 
$(SUBDIR)/file2.o : 
$(SUBDIR)/file3.o : $(SUBDIR)/file1.mod $(SUBDIR)/file2.mod

$(SUBDIR)/file1.mod : $(SUBDIR)/file1.o
$(SUBDIR)/file2.mod : $(SUBDIR)/file2.o
$(SUBDIR)/file3.mod : $(SUBDIR)/file3.o

So file3.f90 get re-compiled only if the .mod files for files file1.f90 or
file2.f90 change.

So far all's well.

When a file containing modules is compiled, the .mod file is automatically
placed in the parent directory by the compiler. I then use a shell-script to
move this file into the sub-directory, BUT ONLY IF IT DIFFERS FROM THE ONE
ALREADY THERE. As I understand it the .mod file is the equivalent of a .h file
in C, so it should change only if I alter the interfaces. Is this correct?

Anyway, the point is, this strategy works fine under OSF/1, because the .mod
files are identical unless I change the interface. Under AlphaLinux, however,
it fails, beacuase the files are always different

diff file1.mod OBJECT_FILES/.
Binary files file1.mod and OBJECT_FILES/file1.mod differ

In consequence, changing a piece of code at the top of the dependency list
results in everything being recompiled. What a pain!

What gives? Is my understanding incorrect, or should the .mod files be the
same? If so, is this a bug?

Any input would be appreciated.
Many thanks,
Angus

--
ANGUS LEEMING <a.leeming@ic.ac.uk>
Department of Biological and Medical Systems
Imperial College
LONDON SW7 2BX

Tel. 0171 594 5186
Fax. 0171 584 6897


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-09-23 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-23 15:56 Compaq's fort compiler and .mod files Angus Leeming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox