RE: Fortran Compiler Error CMBFAST
Billinghurst, David (CALCRTS) wrote: This is not really a cygwin problem. I guess you didn't see my post--if the compiler should be able to find an include file in the same directory as the source file (and/or the current directory, since they are the same in this case), then it is a cygwin problem (even if it's an upstream problem, the maintainer should report the GCC bug and eventually build a new cygwin version). The compiler can't find the file cmbfast.inc. Perhaps: - copy the file into the same directory as jlgen.F, or - point to it with the -I compiler directive The first doesn't work. The latter does, but the question is whether -I. should be required or not. 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/
RE: Fortran Compiler Error CMBFAST
On 27 June 2006 14:41, Williams, Gerald S (Jerry) wrote: Billinghurst, David (CALCRTS) wrote: This is not really a cygwin problem. I guess you didn't see my post--if the compiler should be able to find an include file in the same directory as the source file (and/or the current directory, since they are the same in this case), then it is a cygwin problem (even if it's an upstream problem, the maintainer should report the GCC bug and eventually build a new cygwin version). The compiler can't find the file cmbfast.inc. Perhaps: - copy the file into the same directory as jlgen.F, or - point to it with the -I compiler directive The first doesn't work. The latter does, but the question is whether -I. should be required or not. We *need* to see the actual command line. Is everyone in this thread aware of the effects of -I-, the recent (sometime in 3.x series) changes in the way it behaves? It needs to be pointed out that adding -I. doesn't help any if you aren't building in the source dir but a parallel object dir... cheers, DaveK -- Can't think of a witty .sigline today -- 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/
Re: Fortran Compiler Error CMBFAST
Yes I forgot to mention that the include file that the compiler could not find was in the working directory. Adding a -I./ to the flags has seemed to solve this. On 6/26/06, Williams, Gerald S (Jerry) [EMAIL PROTECTED] wrote: Brad Krane wrote: I'm trying to compile the scientific package CMBFAST-4.5.1 in the cygwin environment using g77. I get the following error... f77 -O2 -c -o jlgen.o jlgen.F jlgen.F: In program `jlgen': jlgen.F:14: include 'cmbfast.inc' ^ Unable to open INCLUDE file `cmbfast.inc' at (^) Tim Prince wrote: Normally, you would specify the path to search for include files with -I, if it is not in the current working directory. I looked at the library, and the referenced include file *is* in the same directory. The library even includes a configure script, so this isn't simple pilot error--it looks like there is a bug in the compiler. For now, you can work around the problem by adding -I. to the command lines, or more likely to the end of FFLAGS in the Makefile (after running ./configure). I don't use FORTRAN enough to say whether the behavior we are seeing is correct, though from the evidence I've seen I'd say it isn't. gsw -- Brad -- 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/
RE: Fortran Compiler Error CMBFAST
Dave Korn wrote: We *need* to see the actual command line. That was in the original post (sorry, I should have made sure it was included in the text when I CC'ed you...): f77 -O2 -c -o jlgen.o jlgen.F The command was being executed from the same directory as jlgen.F, which also contains the include file that it cannot find. Adding -I. to the command line fixes the problem. The OP didn't provide enough information about where the files resided, but I downloaded the CMBFAST package myself and verified that ./configure make results in the same error. I also verified that it builds if you manually compile with -I. (or add -I. to FFLAGS in the makefile). Is everyone in this thread aware of the effects of -I- [...] I assume that's not relevant since -I- is not used. It needs to be pointed out that adding -I. doesn't help any if you aren't building in the source dir but a parallel object dir... True. This was a workaround for this specific case. In general, you would want to use -I$(SRCDIR) or something along those lines, although technically I don't think you should need to do either. :-) -- I just recreated the problem with some minimal code, and got some more information in the process: Create a file foo.for that contains one line: include 'foo.inc' Create an empty file named foo.inc in the same directory. Copy foo.for to foo.f, foo.FOR, and foo.F and try to compile all four of them from that directory: $ f77 -c foo.for# runs OK $ f77 -c foo.f # runs OK $ f77 -c foo.FOR# runs OK $ f77 -c foo.F foo.F:1: include 'foo.inc' ^ Unable to open INCLUDE file `foo.inc' at (^) $ _ 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...). 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/
RE: Fortran Compiler Error CMBFAST
On Tue, 27 Jun 2006, Williams, Gerald S (Jerry) wrote: I just recreated the problem with some minimal code, and got some more information in the process: Create a file foo.for that contains one line: include 'foo.inc' Create an empty file named foo.inc in the same directory. Copy foo.for to foo.f, foo.FOR, and foo.F and try to compile all four of them from that directory: $ f77 -c foo.for# runs OK $ f77 -c foo.f # runs OK $ f77 -c foo.FOR# runs OK $ f77 -c foo.F foo.F:1: include 'foo.inc' ^ Unable to open INCLUDE file `foo.inc' at (^) $ _ 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. 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? Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte. But no -- you are no fool; you call yourself a fool, there's proof enough in that! -- Rostand, Cyrano de Bergerac -- 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/
Re: Fortran Compiler Error CMBFAST
Brad Krane wrote: I'm trying to compile the scientific package CMBFAST-4.5.1 in the cygwin environment using g77. I get the following error and I have no idea how to fix this having never used Fortran before. This should work without any problem as many other people have compiled this and never run up on a similar problem. I think that it is a compiler specific issue or an environment one. f77 -O2 -c -o jlgen.o jlgen.F jlgen.F: In program `jlgen': jlgen.F:14: include 'cmbfast.inc' ^ Unable to open INCLUDE file `cmbfast.inc' at (^) Normally, you would specify the path to search for include files with -I, if it is not in the current working directory. -- 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/
RE: Fortran Compiler Error CMBFAST
Brad Krane wrote: I'm trying to compile the scientific package CMBFAST-4.5.1 in the cygwin environment using g77. I get the following error... f77 -O2 -c -o jlgen.o jlgen.F jlgen.F: In program `jlgen': jlgen.F:14: include 'cmbfast.inc' ^ Unable to open INCLUDE file `cmbfast.inc' at (^) Tim Prince wrote: Normally, you would specify the path to search for include files with -I, if it is not in the current working directory. I looked at the library, and the referenced include file *is* in the same directory. The library even includes a configure script, so this isn't simple pilot error--it looks like there is a bug in the compiler. For now, you can work around the problem by adding -I. to the command lines, or more likely to the end of FFLAGS in the Makefile (after running ./configure). I don't use FORTRAN enough to say whether the behavior we are seeing is correct, though from the evidence I've seen I'd say it isn't. 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/
RE: Fortran Compiler Error CMBFAST
From: Brad Krane I'm trying to compile the scientific package CMBFAST-4.5.1 in the cygwin environment using g77. I get the following error and I have no idea how to fix this having never used Fortran before. This should work without any problem as many other people have compiled this and never run up on a similar problem. I think that it is a compiler specific issue or an environment one. f77 -O2 -c -o jlgen.o jlgen.F jlgen.F: In program `jlgen': jlgen.F:14: include 'cmbfast.inc' ^ Unable to open INCLUDE file `cmbfast.inc' at (^) jlgen.F:18: integer l(lmax),i,j,lmo ^ Invalid declaration of or reference to symbol `lmax' at (^) [initially seen at (^)] jlgen.F:18: integer l(lmax),i,j,lmo 1 jlgen.F:21: (continued): common /lvalues1/ l,l0,lmo 2 Invalid declaration of or reference to symbol `l' at (2) [initially seen at (1)] Brad, This is not really a cygwin problem. The compiler can't find the file cmbfast.inc. Perhaps: - copy the file into the same directory as jlgen.F, or - point to it with the -I compiler directive NOTICE This e-mail and any attachments are private and confidential and may contain privileged information. If you are not an authorised recipient, the copying or distribution of this e-mail and any attachments is prohibited and you must not read, print or act in reliance on this e-mail or attachments. This notice should not be removed. -- 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/