From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 20549 invoked from network); 23 Sep 1999 16:18:23 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 23 Sep 1999 16:18:23 -0000 Received: from judy.ic.ac.uk (judy.ic.ac.uk [155.198.5.28]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id MAA04980 for ; Thu, 23 Sep 1999 12:18:23 -0400 Received: from juliet.ic.ac.uk ([155.198.5.4]) by judy.ic.ac.uk with esmtp (Exim 2.12 #1) id 11UBZc-0000tE-00 for axp-list@redhat.com; Thu, 23 Sep 1999 17:18:20 +0100 Received: from venous.bg.ic.ac.uk ([155.198.83.11] helo=mail.bg.ic.ac.uk) by juliet.ic.ac.uk with esmtp (Exim 2.12 #1) id 11UBZU-000165-00 for axp-list@redhat.com; Thu, 23 Sep 1999 17:18:12 +0100 Received: from pneumon ([155.198.83.66]) by mail.bg.ic.ac.uk with smtp (Exim 2.12 #1) id 11UCYi-0001Q0-00 for axp-list@redhat.com; Thu, 23 Sep 1999 18:21:28 +0100 From: Angus Leeming Reply-To: Angus Leeming Organization: Imperial College To: axp-list@redhat.com Subject: Compaq's fort compiler and .mod files Date: Thu, 23 Sep 1999 16:56:42 +0100 X-Mailer: KMail [version 1.0.21] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <99092317174200.09780@pneumon> Content-Transfer-Encoding: 8bit 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 Department of Biological and Medical Systems Imperial College LONDON SW7 2BX Tel. 0171 594 5186 Fax. 0171 584 6897