How to debug a C++ layer
Hi, I am new to Mxnet. I am interested in implementing a new C++ layer, but I am wondering how to debug during the process. Do I have to recompile the whole framework to test it? Or is there any other simpler way. It seems like recompiling takes way too much time. I did not find any useful info in the tutorial. Hope to get some hints. Thanks. @mli @piiswrong @tqchen
If you just want to print debug log, just set DEBUG=1 in comfig.mk, then recompile the whole framework.
@KangBing What I meant was compiling the whole framework takes too much time. Is there any way to compile only the necessary file, like a minimum package, to test the new layer.
@lovedl I'm not sure. But you can modify the Makefile, don't delete *.o file after compile. If you recompile, the compiler only compile the modified file and relink.
@lovedl , you can just change the code and make, gcc will only re-compile the file you changed and those related with it
if some unexpected problem appear, try make clean, and make to re-compile all frame work
besides,
make -j $(nproc) YOU_OPTIONSwill compile parallellygdb --args python YOU_ARGScan debug with gdb