delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/28/09:20:39

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: Fortran Compiler Error CMBFAST
Date: Wed, 28 Jun 2006 09:20:12 -0400
Message-ID: <4C89134832705D4D85A6CD2EBF38AE0F54984A@PAUMAILU03.ags.agere.com>
In-Reply-To: <Pine.GSO.4.63.0606271847110.14435@access1.cims.nyu.edu>
From: "Williams, Gerald S \(Jerry\)" <gsw AT agere DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k5SDKYSV022344

Igor Peshansky wrote:
> Doesn't foo.F represent a FORTRAN file that needs to be preprocessed
> by the C preprocessor?  Changing foo.F to contain
> 
> #include "foo.inc"
> 
> makes it work for me.

That is no doubt the difference. As I said, I don't use
FORTRAN enough to know what others would expect, though
this difference is spelled out in the info file--files
with .F/.FPP/.fpp extensions are preprocessed using the
C preprocessor.

It's still not clear that G77 is doing the right thing,
though. Even though CPP is used, include directives are
still processed. The problem is that the preprocessed
output files are in a temp directory, so it's looking
in the wrong place (creating foo.inc in that directory
allows it to succeed, confirming this). G77 on my Linux
box does the same thing of course, but somehow it finds
the include file anyway.

>> So it seems that the rules by which the preprocessor
>> looks in the current directory and/or the directory
>> containing the source file does not apply to files
>> named *.F for some reason. It's possible that this
>> was intentional, although I don't get this behavior
>> on my Linux box (which granted is using GCC version
>> 3.2.3, so it could have changed since then...).
> 
> Does running f77 with '-v' help?

Yes it does. Cygwin's version is preprocessing using
cc1, whereas my RedHat Linux box running GCC 3.2.3 is
using tradcpp0, so something is different in the way
preprocessing is done. I'm still not entirely clear on
what's different, since both are preprocessing to a
temp directory, but something is different.

Since I'm not a big FORTRAN user, I can't comment on
whether the current behavior is acceptable or not, so
I'm going to pass the buck for now. But this is a bug,
either in GCC/G77 (at least the Cygwin port of it) or
in CMBFAST (which expects the other behaviour in its
build process).

gsw

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019