Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Angus Leeming <a.leeming@ic.ac.uk>
To: axp-list@redhat.com
Subject: Compaq's fort compiler and .mod files
Date: Thu, 23 Sep 1999 16:56:42 +0100	[thread overview]
Message-ID: <99092317174200.09780@pneumon> (raw)

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


                 reply	other threads:[~1999-09-23 16:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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