Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646
26860 Discussions

Pre-compilation to remove all the debug tests and prints

bucaioni__thomas
New Contributor I
422 Views

Is there a pre-compilation phase to remove all the debug tests, for example:

# PRE_COMPIL_FLAG_BEGIN
print *, "Check of variable V: V = ", V
if (V.le.0) then
print *, "Bug"
stop
end if
# PRE_COMPIL_FLAG_END

and when compiling for optimized execution, having all these lines removed?

0 Kudos
1 Solution
Arjen_Markus
Valued Contributor III
404 Views

You can use the preprocessor step for this, this is typically done via:

#ifdef PRE_COMPIL_FLAG
your debug code
#endif

 For this to work you need to specify the compile option /fpp (in VS it is the first option under "Preprocessor")

View solution in original post

3 Replies
Arjen_Markus
Valued Contributor III
405 Views

You can use the preprocessor step for this, this is typically done via:

#ifdef PRE_COMPIL_FLAG
your debug code
#endif

 For this to work you need to specify the compile option /fpp (in VS it is the first option under "Preprocessor")

View solution in original post

jimdempseyatthecove
Black Belt
385 Views

Or use:

!dir$ if defined(PRE_COMPIL_FLAG)
your debug code
!dir$ endif 

Then you do not need to use fpp.

Jim Dempsey

bucaioni__thomas
New Contributor I
373 Views
Reply