Debugging mode on Linux/Ubuntu

Dear Guido and all,

I have seen that most of the things start in ccx_2.16.c.

Is there any way to get a “debugging” mode of ccx on Ubuntu? Since it calls both C and FORTRAN subroutines.

I am quite interested in entering the subroutines for modifying/extending the code. I am interested in adding new elements and accessing the non-linear subroutines (e.g. N-R) to solve staggered type of problems.

It would be quite nice to get to know more about the code structure. Otherwise, it would be tricky or a least not so ideal to be printing stuff all the time to understand the workflow.

Thanks a lot and have a nice weekend!

1 Like

Hi,

for debugging you just change -O2 or -O3 in the Makefile by -g. Then you delete all objects and recompile. As debugger you can e.g. use DDD.

Some parts of the code and the variables are explained in the chapter at the end of the User’s Manual.

Best Greetings,

Guido

Thanks for your response, Guido.
/J.

Hello again, Guido. I could do debugging with DDD and the input parameters option in the run menu to include the input file. Is it possible, however, to include the input file somewhere in the MakeFile before generating the .o’s? Or to hardcode the name of the file in ccx_216.c (e.g. hardcoding jobnamec/jobnamef and by pass line 107 asking for argc==1, for instance, doing a strcpy(jobnamec, definedname))? What would be the most correct way for doing this? I am asking since I would like to perform debugging in another IDE (I run linux under WSL and an XTERM is a bit of a pain). Thanks!.

in the DDD-lower window enter:

run inputfile

if the inputfile is inputfile.inp

Best Greetings,

Guido

Thanks for your reply. I actually figured out it and for some reason you got my first message, not the edited one.

I did debugging with DDD and the input parameters option in the run menu to include the input file. Is it possible, however, to include the input file somewhere in the MakeFile before generating the .o’s? Or to hardcode the name of the file in ccx_216.c (e.g. hardcoding jobnamec/jobnamef and by pass line 107 asking for argc==1, for instance, doing a strcpy(jobnamec, definedname))? What would be the most correct way for doing this? I am asking since I would like to perform debugging in another IDE. Thanks!.