Compiling files with Preprocessor commands with DVF 5.0

From: Dirty Harry (dirty.harry_at_juno.com)
Date: 06/21/04


Date: 21 Jun 2004 08:01:31 -0700

First a little background information:

I am attempting to compile a code that has been primarily developed on
several Unix platforms for the past decade. It's pretty much
basic/standard fortran 77 with a few .F (as opposed to .f) files which
contain C preprocessor directives (#if, #elif, #endif, #include etc.)
to open/read/write binary files differently to achieve a straight
binary output with no extra record markers. On the Unix platforms,
these files are first passed through the C preprocessor automatically
with certain -D provided on the command line.

I am now attempting to compile this under Windows and have done so
using Cygwin and Mingw32 with gcc/g77 but have experienced some
performance problems when compared to a Linux version on the same
machine. So I am attempting to compile with Digital Visual Fortran
5.0 (with Developer Studio 97) on Windows. (Yes, I believe this is a
rather old version, but that is what our office currently has.)
Everything compiles fine except for the files which have the
preprocessing directives.

I have tried setting some of the -D's I use on Unix under the
Predefined Preprocessor Variables under Project -> Settings but get
Bad preprocessor line warnings. Looking under Help, it suggests that
one can use # preprocessor commands. However, there are also !
preprocessor directives. Is the same preprocessor used for both. I
want to stay with the # ones since it works under the Unix platforms
and the whole idea is to have a single source base.

I have been able to use 'fpp' directly in a command prompt and
everything works fine. (I used fpp to generate the appropiate file
which I then added to the DVF Project.) When the compiler is invoked
from Developer Studio, does it not run it through fpp first? does
anyone know what settings I need to make in Developer studio so that
the preprocessor is called and understands the # directives.



Relevant Pages

  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... glen herrmannsfeldt wrote: ... The optimizer also considered %include a preprocessor statement but provided the include compile time option as an alternative to the macro option for the situation in which %include was the only preprocessor statement used. ...
    (comp.lang.pl1)
  • Re: Why C++ is so widespread (and Pascal is no fun)
    ... further on before it can resolve a construct. ... As a result, there is a lot more "stacked" during compile, waiting to be resolved. ... I always thought that preprocessor is the only issue that makes the C/C++ build process so slow. ... float F2 ...
    (borland.public.delphi.non-technical)
  • Re: Using obscure languages professionally?
    ... It's funny you mention Scheme, ... preprocessor for C that allowed inline Tcl code to be evaluated at compile ... I don't know how badly it would effect the portability. ...
    (comp.programming)
  • Re: simple algorithm for finding primes
    ... > to compile it. ... probably for the preprocessor, that would cause a message to ... print out a message at assembly time, ... expansions can print error messages. ...
    (comp.lang.c)
  • Re: a question about compiling C source codes
    ... The a.out file executes fine, ... chmod go-rwx program2.c ... The way you compile C code into object files to be linked into ... executables is fairly consistent among all Unix platforms, ...
    (comp.unix.solaris)

Loading