CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Foam 13 How can one run solver in debugger (https://www.cfd-online.com/Forums/openfoam/60806-foam-13-how-can-one-run-solver-debugger.html)

atzaru April 7, 2006 18:25

I would like to ask how can i
 
I would like to ask how can i debug simpleFoam solver in ddd. I understand that i need to recompile the code. What i need to changde and where?

Thank u very much

Atzaru

didomenico April 8, 2006 07:04

Look in .OpenFOAM-1.3/bashrc,
 
Look in .OpenFOAM-1.3/bashrc, you have to comment out the following option:

export WM_COMPILE_OPTION=Debug

and re-source the file. After that, go to OpenFOAM-1.3 and run

./Allwmake

that's all...
Remember I will have both the optimized and debug versions installed and you can switch between them with that flag.

mattijs April 8, 2006 08:21

It might be easier to only com
 
It might be easier to only compile (a copy of) the conflicting command (unless your bug is in one of the libraries). Search on this forum for FULLDEBUG.

atzaru April 11, 2006 03:07

Hi thanks a lot for the tip
 
Hi

thanks a lot for the tips

I compiled the code with
export WM_COMPILE_OPTION=Debug activated and i obtain the following type of errors:

bin/linuxGcc4DPProf/setFields
/usr/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make: *** [/home/gda/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPProf/setFields] Error 1
+ wmake mapFields


/usr/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make: *** [/home/gda/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPProf/foamInfoExec] Error 1
gda@tzapuu:~/OpenFOAM/OpenFOAM- 1.3$


Does anybody know how i can fix it?

thanks

mattijs April 11, 2006 05:22

You don't have the debug versi
 
You don't have the debug version of the library compiled. If you follow Massimilianos steps so recompile everything you will end up with a whole set of debug libraries.

E.g. where my libOpenFOAM is now in
.../linuxGcc4DPOpt/libOpenFOAM.so

it will then be in something like
.../linuxGcc4DPDEBUG/libOpenFOAM.so

With you it actually looks like your binaries end up in 'linuxGcc4DPProf/' but anyway you don't seem to have libraries in the corresponding library directories ($FOAM_LIBBIN).

(you could always try the local compilation option in my post above)

mss October 17, 2007 06:12

Hej, I am trying to debu
 
Hej,


I am trying to debug my own solver in OpenFoam. For this I added a line in
the Make/options:
------------------------------------------------
EXE_INC =\
-DFULLDEBUG -g O0
------------------------------------------------

and I used the comand line : gdb <name_solver> <case_name>
But It seems to be be something wrong in this line.

Could someone give some instructions on how to use interactive debugger in
openFoam step by step for person who is new in this area?

Thank you in advance,
Rita

marevaz June 10, 2008 03:13

Hi I am a beginer with OpenFO
 
Hi
I am a beginer with OpenFOAM.
Can i trace a solver line by line in debug mode?
if yes, how can i do that?
Thank You.

karlvirgil July 6, 2009 11:45

Quote:

Originally Posted by marevaz (Post 180500)
Hi
I am a beginer with OpenFOAM.
Can i trace a solver line by line in debug mode?
if yes, how can i do that?
Thank You.

Yes you can. All you need to do is recompile OpenFOAM with the debug option turned on (see etc/bashrc file in OpenFOAM installation). Then, launch application in gdb and step through the code :)


All times are GMT -4. The time now is 20:18.