- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
. 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...
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 [:(]](/isn/Community/en-US/emoticons/emotion-9.gif)
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...
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
/fpp:"/macro=no"
In the IDE, you'll have to add this under "Additional Options" rather than use the "Preprocess Files" property.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, thanks. It does make sense, but it would make even more sense if it were mentioned somewhere in the compiler documentation.
(I mean, just as a general note, like "To pass additional options to fpp, list them after a colon, enclosed in quotes, for example...")
![Smiley with tongue out [:-P]](/isn/Community/en-US/emoticons/emotion-4.gif)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page