I have input and consistency checks that I need during development but want to disable for final runs of my code. Is there a way to annotate these checks s.t. they are not included at higher optimisation levels or depending on other global settings?
For example, if these consistency checks are boundschecks I could annotate the corresponding code with @boundscheck
and then after development start a julia process with julia --checkbounds no
to disable the corresponding code.
Or in C/C++ I would wrap the corresponding code in a
# ifdef DEBUG
// check consistency
# endif
and have a line # define DEBUG
that I would comment out once I am done debugging.
Is there a similar mechanism in julia or what is the recommended way to enable some code only in debugging mode?