[Info-vax] Architecture specific code in VMS Fortran

Bob Koehler koehler at eisner.nospam.encompasserve.org
Mon Oct 3 09:59:01 EDT 2011


In article <43d9b116-52a4-4023-938f-07b80816a160 at i30g2000yqd.googlegroups.com>, Steven Schweda <sms.antinode at gmail.com> writes:
> 
>    Perhaps one could use CC /PREPROCESS_ONLY [/DEFINE] to
> preprocess Fortran code which contains C-preprocessor
> directives.  At a long-dead job, we wrote our own
> preprocessor which used "C$$" comment/directives to bracket
> conditional code:

   Yes, you can.  Before Compaq bought DEC, the compiler guys got all
   the native compilers working with the C preprocessor.  If you have
   a C compiler, you can put C preprocessing statements in code for
   any language, run it through the C compiler in pre-process only
   mode, and compile the result with the compiler for the target
   language.

   I actually used it for Ada in production code.  But that was on VAX
   with a DEC Ada compiler, I don't know about gnat.  (Lots of gnu
   compilers have this ability built in, and triggered by variations
   in the file extension).

   Another approach would be to use DCL or MMS so select and prepend
   a file containing the CDEC DEFINE for the architecture, something
   like:

   .IF VAX
       fortran vax.for+$(MMS$SOURCE) /object=$(MMS$TARGET)
   .ENDIF
   .IF ALPHA
       fortran alpha.for+$(MMS$SOURCE) /object=$(MMS$TARGET)
   .ENDIF



More information about the Info-vax mailing list