Hi Spencer,
Here are the options from the compile command:
f90 -n32 -mips4 -r10000 -g -cpp -Wl,-woff,84 -Wl,-woff,85 -Wl,-woff,134
-DF90_VERSION="MIPSpro Compilers: Version 7.4" -DDEBUG -DOSVERSION=6.5
The version of cpp being used is in /usr/freeware/bin,
so it may be from the SGI freeware site. I can ask our
systems people.
There is no macro-expand option in the compile line, it's never
been necessary before. I have written lots of code using
the same C pre-processor file (#include "c_include.h") and
they have all worked fine.
It's only when I put some of the subroutine body in an
F90 include file (include "f90_include.inc") that it
refused to recognize the C macros. When I moved the
text of "f90_include.inc" back into the subroutine, things
worked fine again.
See the two examples below. The only difference between
these two codes is whether the subroutine body (that contains references
to the C macros) is in an include file or copied-and-pasted into the
subroutine body. It's not just
the macro references that didn't work, it's also references
to variables defined in the "c_include.h" that didn't resolve.
Is this expected behaviour from the compilers? Based on
my simple-minded understanding, it would seem like NotWorks
should work just as well, but it isn't.
Subroutine NotWorks( ... ) ! will not compile
! Variable definitions
#include "c_include.h"
include "f90_include.inc" (includes references to macros)
return
end subroutine NotWorks
Subroutine Works( ... ) ! this compiles and runs ok
! Variable definitions
#include "c_include.h"
copy and paste from "f90_include.inc"
return
end subroutine Works
Catherine
[log in to unmask] wrote:
> Hi Catherine,
>
> I think Gergio is correct about the ordering of pre-process and
> compile steps. Tom may also be correct about the filename length, but
> it seems less likely.
>
> Exactly what options are you using on your pre-process and/or compile
> commands? Are you using the '-macro-expand' flag?
>
> And also, are you using the default Fortran pre-processor or
> specifically invoking another?
>
> Spencer
>
> --
>
> --
> -------------------------------- ______
> Spencer Swift ([log in to unmask]) / ___/\
> Silicon Graphics, Inc. /___ /\/______
> NASA Goddard Space Flight Center /_____/ // ___/\
> 1500 Crittenden Lane \_____\// / /\/______
> Mountain View CA 94043-1351 /_____/ //_ __/\
> \_____\/_\/ /__\/
> WK: (214) 823-6157 /_____/\
> FAX (214) 823-6157 \_____\/
> --------------------------------
--
-------------------------------------------------------------------------
Catherine Moroney phone : (818) 393-3392
Jet Propulsion Laboratory fax : (818) 393-3134
MailStop 168-414 email : [log in to unmask]
4800 Oak Grove Drive
Pasadena, CA 91109-8099
|