Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

/fpp /macro=no from IDE?

jugoslavdujic2
Beginner
1,409 Views
One of CVF FAQs (sort of) was that the Fortran Preprocessor, fpp did not do macro substitution by default, and that /m switch should be added to the compiler's command line to achieve that.

Now, I'm converting a large project from CVF to IVF, and I'm getting the reverse problem: we have a bunch (~20) of 2-letter preprocessor defines submitted through /D: compiler switches... and a number of variables in the code which accidentally have the same names as those defines. Apparently, in IVF, /fpp does do macro substitution by default, which is quite undesired in our case, as it produces syntactically invalid code... but I dont' see an obvious way to switch it off Sad smiley [:(]. fpp /help does say that /macro=no does the trick... but I don't see how I can enter it through Project properties in IDE (and specifying a custom build step for ~300 source files would be a major pain).

For now, I resolved the problem by renaming the offending variables in the code and/or switching fpp off for some files (that didnt'need preprocessing anyway). I could possibly make another workaround by specifying /DAB=AB (rather than /DAB) on the compiler's command line, but there's still something to be desired...


0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,409 Views
The trick you're missing is that /macro=no has to be specified as an option to FPP, not to ifort. You do it like this:

/fpp:"/macro=no"

In the IDE, you'll have to add this under "Additional Options" rather than use the "Preprocess Files" property.
0 Kudos
jugoslavdujic2
Beginner
1,409 Views
Ah, thanks. It does make sense, but it would make even more sense if it were mentioned somewhere in the compiler documentation. Smiley with tongue out [:-P] (I mean, just as a general note, like "To pass additional options to fpp, list them after a colon, enclosed in quotes, for example...")
0 Kudos
Steven_L_Intel1
Employee
1,409 Views
I agree - but I note that the ONLY place /macro is mentioned is the command-line help for FPP! I will pass this on to our documentation folks - it really should be documented properly.
0 Kudos
Reply