- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was just curious if there would happen to be a command line option for intel 9.0 on linux that instructs the compiler to treat all cDEC$ directives as comments? I searched the man page and manual and didn't see anything that looked promising, but just thought I'd inquire in case there is some hidden option or method for doing this.
We use some of these directives on Windows to control mixed language issues related to calls to C routines compiled with VC++, but need to force the compiler not to use them when on linux and linking against gcc-built objects.
Thanks in advance,
Chris
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not aware of such an option but you could try enabling the preprocessor FPP and then declare a preprocessor macro DECdollar as either cDEC$ or ccDEC$ depending on requirements.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are correct. I should have run a test first. It is interesting though that if I run FPP to parse the file I do get a valid cDEC$ ... and at column 1 (although the !DEC$ does get stripped as ! can be used to comment macros).
I personaly use preprocess file and #ifdef _WIN32 or some similar conditions.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the .html readme for .025
Choice of Comment Style in fpp-Preprocessed SourceThe /allow:[no]fpp_comments switch has been introduced in order to allow the user to control how the fpp preprocessor treats Fortran end-of-line comments in preprocessor directive lines. Consider for example the following source line:
#define MAX_ELEMENTS 100 ! Maximum number of elements
How is the preprocessor supposed to treat the text "! Maximum number of elements"? Is it treated as a Fortran comment and therefore ignored, or is it part of the value for the MAX_ELEMENTS definition? Given that the functionality of fpp is essentially that of the C preprocessor cpp, and on many platforms, a cpp itself is used to provide Fortran preprocessing, to cpp, this would just be text that is part of the value being defined..
The Intel Fortran Compiler default, specified by /allow:fpp_comments, is to recognize Fortran-style end-of-line comments on preprocessor lines. Therefore, by default, the line above would define MAX_ELEMENTS to be simply "100". If /allow:nofpp_comments is specified, then Fortran end-of-line comment conventions are not used and "!" has no special meaning. An example of where you may want to use /allow:nofpp_comments is to have a Fortran directive as a define value, for example:
#define dline(routname) !dec$ attributes alias:"__routname":: routname
Please note that there is not widespread agreement among Fortran vendors for this behavior.
If you are using the Visual Studio IDE, you must enter this switch manually under Command Line in the Fortran project property page.

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