- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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")
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or use:
!dir$ if defined(PRE_COMPIL_FLAG)
your debug code
!dir$ endif
Then you do not need to use fpp.
Jim Dempsey
- Tags:
- preprocessor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perfect, thank you for your answers
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page