Community
cancel
Showing results for 
Search instead for 
Did you mean: 
bucaioni__thomas
New Contributor I
241 Views

Pre-compilation to remove all the debug tests and prints

Jump to solution

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
223 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
224 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
204 Views

Or use:

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

Then you do not need to use fpp.

Jim Dempsey

Tags (1)
bucaioni__thomas
New Contributor I
192 Views

Perfect, thank you for your answers

Reply