|
[Sponsors] |
December 13, 2016, 22:31 |
How you debug SU2?
|
#1 |
Member
Paul Zhang
Join Date: Feb 2011
Posts: 44
Rep Power: 15 |
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 |
|
February 7, 2017, 07:44 |
How to compile SU2 with a -g (debugger) flag?
|
#2 |
New Member
Sangeeth
Join Date: Jul 2015
Posts: 7
Rep Power: 11 |
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, |
|
February 7, 2017, 20:23 |
|
#3 | |
Member
Paul Zhang
Join Date: Feb 2011
Posts: 44
Rep Power: 15 |
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:
|
||
February 8, 2017, 00:10 |
|
#4 |
Member
Tom
Join Date: Oct 2015
Posts: 67
Rep Power: 10 |
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 |
|
February 26, 2019, 17:16 |
Issues in running Xcode debugger for SU2 code..
|
#5 | |
New Member
monika chauhan
Join Date: Feb 2019
Location: Blacksburg, VA
Posts: 2
Rep Power: 0 |
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:
|
||
March 21, 2019, 14:59 |
|
#6 | |
New Member
Robert Alviani
Join Date: Mar 2019
Posts: 3
Rep Power: 7 |
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. |
||
May 3, 2019, 08:34 |
|
#7 | |
New Member
Amir Bagheri
Join Date: Feb 2019
Location: Southampton, UK
Posts: 11
Rep Power: 7 |
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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SU2 debug mode. | neetin | SU2 | 4 | June 5, 2014 14:48 |
Pointwise-SU2 joint webinar (April 29th) and SU2 v3.1.0 new release | fpalacios | SU2 News & Announcements | 1 | April 30, 2014 02:40 |
Official release of SU2 V3.0 and SU2 Educational V1.0 | fpalacios | SU2 News & Announcements | 2 | January 22, 2014 05:28 |
SU2 suite has moved to GitHub! | fpalacios | SU2 News & Announcements | 0 | August 12, 2013 02:07 |
Welcome to the Stanford University Unstructured (SU2) forum! | economon | SU2 | 0 | January 7, 2013 02:48 |