[comp.lang.fortran] How to use -I for INCLUDE in f77

mcdowell@xanth.msfc.nasa.gov (Jonathan McDowell) (04/18/91)

oliveria@caen.engin.umich.edu (ROQUE DONIZETE DE OLIVEIRA) writes:

>spam% f77 -c -I/users/oliveria j.F
>j.f:
>(00001)       INCLUDE 'nodes.cbl'
>**** Error #64 on Line 1: cannot open file
>The man page on f77 [...] says the -I option changes the search path for
> #include files. Isn't this #include refering to the INCLUDE f77 statement ?

No. It is referring to a completely different, non Fortran, preprocessor 
statement. At least in the Sun f77 compiler, there seems to be no way to 
change the search path for the Fortran INCLUDE statement in f77; 
I find this one of the most frustrating aspects of the compiler 
(and there's quite some competition). You have to put in the explicit
full path of the file in the code, which means it can't be portable
to systems using other filesystem structures.

- Jonathan McDowell