source line to long

we porting our application from Sun-Solaris to Linux (64bit) using
the pgf90 compiler.
Unfortunately our macros-source-lines (and other) become to long for the new Compiler! (even with the -Mextend - Flag)

Is there a way to break a macro in more than one (precompiled-)line or to
allow more signs in a source-line?
Or is it possible to use another precompiler. E.g. fpp breaks source-lines that are to long using “&”.

Hi,

Do you have a small example of the macro that is causing this error? I wonder if this is a bug in which the macro expansion is going into an infinite loop. What happens when you compile with -Mfree for free form source?

-Mark

Using -Mfree doesn’t changes the compiler output.
Here is an small example:

Makro:
#define MSG_E02_006(X) MSG_BEREICH,“E02_006”,“Unerwartetes Erreichen des Dateiendes beim Lesen der Datei '”//trim(X)//"’ des thermischen Erzeugungssystems. Moeglicherweise ist ein Datenkapitel nicht mit ‘*’ abgeschlossen."

Sourceline:
" if (i_status < 0) call meldung(ERR_FATAL,MSG_E02_006(fname_thdat)) ! EndOfFile"

Precompilde Sourceline pgf90 […] -F source.F90:
" if (i_status < 0) call meldung(1, ‘einles_th’,“E02_006”,“Unerwartetes Erreichen des Dateiendes beim Lesen der Datei '”//trim(fname_thdat)//"’ des thermischen Erzeugungssystems. Moeglicherweise ist ein Datenkapitel nicht mit ‘*’ abgeschlossen.") ! EndOfFile"

lutz

Hi,

I was able to compile your example fine if I used -Mfree or used a .f90 file extension to indicate F90 (freeform) convention. What error message are you getting? Are you compiling with -Mpreprocess ?

-Mark

Hi,
sorry i forgot the leading whitespaces in the excample!
If the sourceline has more than 264 signs the error-message appears.
I solved the problem:

  1. using smaller macros and
  2. using the fpp-Precompiler (that breaks the lines at sign 132 with “&”)
    fpp -D"PGI" source.F90 > source.pr.F90
    pgf90 -C -c -Mextend -o source.pr.o source.pr.F90

lutz

[/quote]
2. using the fpp-Precompiler (that breaks the lines at sign 132 with “&”)
fpp -D"PGI" source.F90 > source.pr.F90
pgf90 -C -c -Mextend -o source.pr.o source.pr.F90
[/quote]

Hello,

I got the same problem, but “source line too long”,
because I have approximatly 1000 caracter on one line.
But I can’t make work the fortran preprocessor who cut the line.
I try pgf90 -Mcpp and/or pgf90 -Mpreprocess, but nothing work.
And fpp is not installed on the machine.
Do you have some idea ?

Thank by advance,
Gui.

Hi Gui,

As you probably know, the 132 character per line limit is a limitation of the Fortran language. However, having the preprocessor break long lines is a good solution so I’ll put a feature request in to see if we can add this to our preprocessor.

Unfortunately, I don’t know which “fpp” lutz used (there are many of them) and when I did a search, I didn’t see any that supported it. Does anyone else know which fpp supports line wrapping?

Thanks,
Mat