[Developers] Re: [CactusMaint] info lines in post-processed source

Jonathan Thornburg jthorn at aei.mpg.de
Fri Jan 23 23:17:02 CST 2004


Hi, Mark,

> I've noticed that post-processed source code has lots of info lines
> that look like, e.g.,
> 
> # 28 "/u2/mamiller/Cactus_beta13/arrangements/...............
> 
> My intel compiler on my laptop and on beowulf clusters have no
> problem.  However, I fell off my chair from dizziness at all of the
> warnings flashing by from the f90 compiler on lemieux.  Worse, on the
> O2K here at JPL, the first Fortran file to get compiled dies
> due to what appears to be the compiler misinterpreting these
> supposidly "null" lines, e.g.,
[[...]]
> Any chance of cleaning this up?  Is a line starting with
> a "#" character supposed to be ignored by all compilers?  I would
> guess not since this is supposed to indicate a preprocessor directive.
> How does one tell the compiler that these are to be ignored?  Or am
> I way off base here?

These lines were a recent change to the Cactus preprocessor to mark
the original source line number, i.e. that example I quoted is telling
the Fortran compiler that this code originally came from line 28 in
the file /u2/mamiller/Cactus_beta13/arrangements/...............  .
The idea is that this way any compiler error messages will show the
original source file and line number, rather than those of the
temporary preprocessed file.

As to your problem...  I think there are actually two problems here:

1. For C and C++, I believe the correct syntax has the line starting
   with    #line    instead of    #    , i.e.
#line 28 "/u2/mamiller/Cactus_beta13/arrangements/..............."
   Assuming we get the syntax right (the syntax you showed above is
   a common extension that most compilers should also grok), everything
   should work -- the C and C++ language standards include #line so
   all compilers should accept them.
2. For Fortran, I think all bets are off -- I think the language standards
   (F77, F90, F2003) don't mention #line, so it's up to each individual
   compiler what to do.  It seems the intel compiler groks it, but the
   lemieux and origin compilers don't. :(  If we're lucky, changing
   the    #    to    #line    will persuade the other compilers to accept
   it.  (That's probably a faint hope. :)  Otherwise, it seems to me
   that we should add a Cactus configure option to specify whether or
   not #line should be generated in preprocessed Fortran code.

Erik, I've cc-ed you explicitly on this E-mail since my memory is that
you were the person who put #line in.  Could you try changing the  #
to   #line   and also add a configure option to (optionally) disable
it altogether for Fortran files?

ciao,

-- 
-- Jonathan Thornburg <jthorn at aei.mpg.de>      
   Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
   Golm, Germany, "Old Europe"     http://www.aei.mpg.de/~jthorn/home.html      
   "Washing one's hands of the conflict between the powerful and the
    powerless means to side with the powerful, not to be neutral."
                                      -- quote by Freire / poster by Oxfam




More information about the Developers mailing list