ifc and cpp

ifc and cpp

hi everyone,

i try to port a small omp code which is working on sun to redhat pc.

i got many funny error message as follows:
>>
C$test.f
Error 14 at (1:test.f) : invalid label field
>>

it seems ifc calls cpp to preprocess the file. but the cpp in my linux machine is gnu gcc-2.96.

anyone knows how to work around this error?

thanks

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

No, ifc doesn't employ cpp, or invoke a gnu pre-processor. It has its own fpp which performs OpenMP translation. If you wish to use gnu pre-processing, you would use a Makefile or maybe a perl script, and the gnu pre-processor is run like
gcc -E -traditional -x c input > output.f
or
g77 -E input.F>output.f
If you set up your own pre-processing step, you must make the output acceptable as OpenMP syntax for ifc.

If you are looking for a pre-processor which works differently from gnu or Intel's, you must install it yourself. I'm not familiar enough with the fpp for which Sun made the source public, to know whether it does anything special with lines such as you quote.

You've posted several messages without saying what you want from these lines. You could try to find patterns for the -D option which will turn it into what you want, either with gnu pre-processing or with ifc's own fpp. Consider that the other pre-processors may also see $ as a special character. Possibly, an option such as -DC$=Cdollar might work.

If you wanted a pre-processor which conforms with Fortran committee standards (apparently you don't) there is Dan Nagle's COCO.

sorry i did not make my question very clear.

my question is that, when i try to compile a program with "C$" in comment lines with "-openmp -fpp2" options. i got the above error message.

and i tried your "-DC$=Ddollar", but it seems does not work.

get it fixed. thanks

Leave a Comment

Please sign in to add a comment. Not a member? Join today