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

!DEC$ compiler directives

ferrad
New User
941 Views
I am having a bit of bother getting a bit of code to compile both in DVF6.0 and IVF9.0. I am doing this by specifying a preprocessor symbol INTEL9 when compiling under IVF9.0. The code is as follows:
!DEC$ IF DEFINED (INTEL9)
include 'fgraph.fd'
include 'global.inc'
!DEC$ ELSE
include 'global.inc'
include 'fgraph.fd'
!DEC$ ENDIF
It may look strange but I have to do this as we have an IMPLICIT NONE statement in global.inc. In DVF, fgraph.fd contained code, so had to be placed after the IMPLICIT NONE, ie. after the global.inc include. However in IVF, fgraph.fd contains a USE statement, which has to be placed before the IMPLICIT NONE statement, so I have to switch them around.
However the DVF compiler doesn't seem to understand the !DEC$ compiler stuff. If I remove it, it compiles just fine, however with it in, it spews out error messages obviously connected to the fact that it did not include global.inc. The DVF help says this syntax is correct.
Any ideas?
Adrian
0 Kudos
2 Replies
Steven_L_Intel1
Employee
941 Views
DVF 6.0, eh? Gotta tune up my Wayback Machine.

I have a vague recollection that DVF 6.0 went ahead and processed INCLUDE lines even if you "conditionalized" them out. The way DVF/CVF and even IVF handles the !DEC$ style of conditional compilation is a bit odd, in that the lines get parsed regardless and then conditionally ignored (usually). A number of bugs in this regard have been fixed over the years.

You don't need to define your own symbol - use __INTEL_COMPILER, which is predefined by IVF.

The syntax is correct, but I think you are running into a DVF bug. Consider using the fpp preprocessor instead (you have to enable it with /fpp) and the #ifdef style directives. That should work for you as it actually runs a separate preprocessor.
0 Kudos
ivfuser
Beginner
941 Views
Steve:

That's interesting. I've expereinced various strangeness with !DEC compiler directives in {D|C|I}VF over the years. Your explanation explains volumes. I know I've seen one such strange thing with IVF, but for the life of me can;t recall now. I've always found way to 'trick' the parser into doing what I needed, including fpp, so I'm conditioned to ignore these instead of reporting them. That will change now. Thanks.
0 Kudos
Reply