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

Compaq's fort compiler and .mod files



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



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