|
I'm asking this here but if you think another place (PennyLane discussion forums, Catalyst GitHub issue...) would be more appropriate, please let me know.
How do you debug Catalyst C++ code? Thanks! |
Replies: 2 comments 5 replies
|
Hi, @rturrado. Thanks for raising this up.
You can build Catalyst with debug mode, such as |
|
Thanks for asking the question @rturrado! Generally my workflow will depend on what kind of code I'm debugging, and what kind of example I'm running.
|
Thanks for asking the question @rturrado! Generally my workflow will depend on what kind of code I'm debugging, and what kind of example I'm running.
I think debugging Python code launched from a Python example is pretty self explanatory, since Python makes this quite easy on us, and it should also integrate straight forwardly with IDEs (I cannot speak to jetbrain tools though since I use vs code myself).
Debugging C++ code from a C++ binary (like the
quantum-opttool) is also relatively straightforward.The first step is building the relevant code in DEBUG mode. So for example using our make targets you can do
make dialects BUILD_TYPE=Debug, ormake runtime BUILD_TYPE=Debug. Note tha…