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

Compiler Directive Conversion from Unix FORTRAN

randystonesifer
Beginner
766 Views
I am compiling fortran from a unix system on my Windows pc using CVF 6.6c.
The code makes extensive use of complier directives. Is there a conversion utility that will change the directives to CVF compatible format? I do not have access to a unix system to test the meaning of the less obvious cases.
Specific issues:
What effect does the ! have in the following?
#if ! defined(sym1)
#endif
Is this:
#if !defined(sym1)&&!defined(sym2)
#endif
equivalent to?:
cDEC$ IF (DEFINED(sym1) .and. DEFINED(sym2))
cDEC$ ENDIF
Is this:
#if defined(sym1) || defined(sym2)
#endif
equivalent to?:
cDEC$ IF (DEFINED(sym1) .or. DEFINED(sym2))
cDEC$ ENDIF
Is this:
#ifndef sym1
#endif
equivalent to?:
cDEC$ IF (.not. DEFINED(sym1))
cDEC$ ENDIF
Thanks for any help,
Randy Stonesifer
0 Kudos
4 Replies
TimP
Honored Contributor III
766 Views
I've never known anyone to want to convert cpp directives to DEC$ format. Did you look up the /fpp and /preprocess-only options in your Visual Studio help? We fought for months to get this CVF capability back into ifort 8.1.
If you want to test pre-processing on the command line, independent of CVF or ifort, use
gcc -traditional -x c -E file.F
Presumably, the /fpp option is named for the open source fpp pre-processor. In corner cases, you might find that producing different results from CVF /fpp or the gcc pre-processing, but the syntax you have shown looks like typical usage, even on Windows.
0 Kudos
Steven_L_Intel1
Employee
766 Views
I would suggest simply enabling the fpp option with /fpp or on the Preprocessor options dialog.
0 Kudos
randystonesifer
Beginner
766 Views
Tim & Steve,
Thanks for pointing out the /fpp compiler option.
It definitely was easier than converting tocDEC$.:smileywink:
What would I have needed to do if I was using ifort 8.1?
Thanks again,
Randy
0 Kudos
Steven_L_Intel1
Employee
766 Views
No difference, except in how you get to the "property page" for the Preprocessor options.
0 Kudos
Reply