You can use @njit(debug=True) for standalone functions but how can you enable debug for a jitclass function? (since it doesn’t use the njit decorator)
Hi @scottbecker
jitclass
uses the njit
decorator internally (numba/base.py at e5c2c629a4bcec4a46afb3dce409f50976ced0df · numba/numba · GitHub), but at present there’s no way to wire flags like debug=True
through to it (requests for similar Parallelize (or fastmath) some methods of a jitclass · Issue #6675 · numba/numba · GitHub, JIT class support for object mode on method-by-method basis · Issue #2083 · numba/numba · GitHub).
However, in the case of debug
, it can be configured globally via environment variables:
-
NUMBA_DEBUGINFO=1
(Environment variables — Numba 0.55.1+0.g76720bf88.dirty-py3.7-linux-x86_64.egg documentation) this will switch on DWARF generation to debug with e.g.gdb
-
NUMBA_BOUNDSCHECK=1
(Environment variables — Numba 0.55.1+0.g76720bf88.dirty-py3.7-linux-x86_64.egg documentation) will switch on bounds checking.
I think switching on those two things will produce an effect similar to debug=True
. There’s more information about the use of environment variables for debugging in this docs section too: Troubleshooting and tips — Numba 0.55.1+0.g76720bf88.dirty-py3.7-linux-x86_64.egg documentation
Hope this helps?