How you debug SU2?
The question is how you guys debug your code, like which platform Windows/Linux/Mac, and what kind of tool you use?
I use to set a breakpoint in the code, but it seems not quite efficient. Any suggestions will be appreciated. Thanks, Paul |
How to compile SU2 with a -g (debugger) flag?
Dear Paul,
I encountered the same problem recently. I was trying to use Valgrind tool to map out the function calls in SU2. But to be able to use this tool, one has to compile SU2 with a -g flag ( a debugger flag). I am not sure how to do this? Since you mentioned that you used a breakpoint feature to debug the code, I presume you must have already done this? Can you please detail as what and which files you changed to compile the whole SU2 code in a debugger version? Any help is highly appreciated. Regards, |
Dear SangeethCFD,
I haven't found a good way yet. The breakpoint feature I mentioned is just that I add a piece of code in a way when SU2 runs to this place, it exits. I also output some information to check if my variable or array is functional. Best, Paul Quote:
|
Hi guys
I think the best way to read or debug the code is with help of Xcode If you use windows you can install mac on VMWare and then install xcode on that with Xcode one can track the run process line by line it is also possible to connect the Xcode to the GitHub and try branching |
Issues in running Xcode debugger for SU2 code..
Hi Guys,
Help me how you connect Xcode to GitHub and branching? I am getting this error in Xcode while running the SU2 code. Error in "void CConfig::SetConfig_Parsing(char *)": ------------------------------------------------------------------------- The configuration file (.cfg) is missing!! ------------------------------ Error Exit ------------------------------- Program ended with exit code: 1 I am new to SU2 as well as to Xcode to be used, appreciate your help Quote:
|
Quote:
Well first make sure you have a configuration file, and are calling it correctly when you run SU2: SU2_CFD {file.cfg} If you are already doing this and SU2 is not finding your configuration file, I’d say look into your environment variables and make sure they are set correctly. |
Quote:
Hi Paul, You need to add the "-g" flag when you're compiling SU2. Simply add the following in your configuration command: CXXFLAGS="-g" Then you make and install as usual. When you want to run SU2, prefix your run command with gdb: "gdb SU2_CFD" You don't need to specify the configuration file just yet. You do that when gdb starts and you want to run the code by typing: "run path_to_config_file" You also would have access to all the gdb commands such as setting breakpoints and watching variables. A good place to start for more info is: https://www.cprogramming.com/gdb.html Hope that helps, Amir |
All times are GMT -4. The time now is 23:44. |