I need to debug some pure
functions in a fortran Program compiled with gfortran. Is there any way to ignore the pure
statements so I can use write
, print
, etc. in these pure
functions without great effort?
Unfortunately it is not easly possible to just remove the pure
statement.
相关问题
- Pass custom debug information to Microsoft bot fra
- CABS(x) function for complex(8)
- How do I identify what code is generating “ '&
- Monodevelop: `Waiting for debugger`
- Upper bound of random number generator
相关文章
- How do I get to see DbgPrint output from my kernel
- Does gfortran take advantage of DO CONCURRENT?
- Advanced profiling is unavailable for the selected
- Can't Inspect Variables When Debugging .NET As
- What is the difference between glibc's MALLOC_
- Embedding a program's source code into its bin
- How to execute another python script from your scr
- How do I debug errors that have no error message?
You can use a macro and use the
-cpp
flag.I usually use the pre-processor for this task:
Then you can compile your code with
gfortran -DDEBUG
for verbose output. (In fact I personally do not set this flag globally, but via#define DEBUG
at the beginning of the file I want debug).I also have a MACRO defined to ease the use of debugging write statements:
With this, the code above reduces to:
You can enable the pre-processor with
-cpp
forgfortran
, and-fpp
forifort
. Of course, when using.F90
or.F
, the pre-processor is enabled by default.