CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM News & Announcements > OpenFOAM Announcements from Other Sources

gdbOF: A debugging Tool for OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By nisi
  • 1 Post By nisi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2011, 15:33
Default gdbOF: A debugging Tool for OpenFOAM
  #1
New Member
 
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 16
nisi is on a distinguished road
Hi Foamers,

We are glad to present our tool for debugging in FOAM with gdb, called gdbOF.

gdbOF is an attachable to GNU debugger (gdb) tool that includes macros to debug OpenFOAM's solvers and applications in an easier way.

Go to http://openfoamwiki.net/index.php/Contrib_gdbOF to download and to use it.

In the latest version (v1.00a) a new utility to dump vol*Fields in FOAM at debugging time is included (pexportfoamformat). It allows (using proper switches) to export the fields to VTK format and open a Paraview window to examine data, always at debugging time.

This utility is still under development. Currently there are no known bugs (but probably some unknown ones). Suggestions about new tools are welcome!!

Regards,

(This post is an actualization of the post http://www.cfd-online.com/Forums/ope...-openfoam.html)
sfalsharif and pcaron like this.
nisi is offline   Reply With Quote

Old   February 22, 2012, 08:44
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 23
santiagomarquezd will become famous soon enough
gdbOF has been formally presented in Advances in Engineering Software:

gdbOF: A debugging tool for OpenFOAM®

if you want a copy of the paper, please e-mail me.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   April 14, 2014, 12:54
Default Hiiiii
  #3
Member
 
Manjunath Reddy
Join Date: Jun 2013
Posts: 47
Rep Power: 12
manju819 is on a distinguished road
While installing gdbOF


i got this error

-----------------------------------------------------
Installing gdbOF...
-----------------------------------------------------
Making sure that you have all needed libraries
-----------------------------------------------------
installgdbOF.sh: 32: installgdbOF.sh: pushd: not found

what to do??

Regards
Manjunath
manju819 is offline   Reply With Quote

Old   April 14, 2014, 14:33
Default
  #4
New Member
 
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 16
nisi is on a distinguished road
Manjunath

Are you using bash as a shell interpreter? The command "pushd" is a builtin function in bash.

A solution could be

$ export SHELL=/bin/bash

In the terminal you can test it:
$ pushd .
(don't forget the dot at the end) and that command must show the current directory on the screen.
nisi is offline   Reply With Quote

Old   April 14, 2014, 14:48
Default Hiii Nisi
  #5
Member
 
Manjunath Reddy
Join Date: Jun 2013
Posts: 47
Rep Power: 12
manju819 is on a distinguished road
Thanks for your quick reply

ya I'm using shell only.

if I write pushd . on terminal it is showing cwd

where do I have to paste this
$ export SHELL=/bin/bash


Thanks again
manju819 is offline   Reply With Quote

Old   December 9, 2014, 05:08
Default
  #6
New Member
 
Gabriele Mosca
Join Date: Dec 2011
Location: Brussels
Posts: 3
Rep Power: 14
MagnusZeus is on a distinguished road
Hi everybody.

I have given the following command
$ export SHELL=/bin/bash

I have tested
$ pushd .
it has given me the path in which I am

..but when I give
$ sh installgdbOF.sh
I always get the same message

Installing gdbOF...
-----------------------------------------------------
Making sure that you have all needed libraries
-----------------------------------------------------
installgdbOF.sh: 32: installgdbOF.sh: pushd: not found

Any ideas why?
MagnusZeus is offline   Reply With Quote

Old   December 9, 2014, 12:05
Default
  #7
New Member
 
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 16
nisi is on a distinguished road
Foamers,

The problem is regarding to the enviromental variables. I think it can be solved running:

$ ./install_gdbOF.sh

which requires execution permission of the file (chmod +x), instead of

$ sh install_gdbOF.sh

Check out http://openfoamwiki.net/index.php/Contrib_gdbOF where the actual command is shown.

Regards
WernerW likes this.
nisi is offline   Reply With Quote

Old   December 11, 2014, 05:18
Default
  #8
New Member
 
Gabriele Mosca
Join Date: Dec 2011
Location: Brussels
Posts: 3
Rep Power: 14
MagnusZeus is on a distinguished road
Yes. You are right!
Actually I have another issue. I have created two alias for OpenFOAM:
- a classical one which can be called by of230
- a debug one which points a bashrc_debug file in which the parameter $WM_PROJECT_DIR is set to "Debug"

When the file installgdbOF.sh is launched for the installation, it directly points the $WM_PROJECT_DIR/etc/bashrc in which the $WM_PROJECT_DIR is set to "Opt". As a consequence I get the error and the indication to set the $WM_PROJECT_DIR to "Debug".
What I have done: I set the $WM_PROJECT_DIR in the bashrc file to "Debug" and I called the alias of230. The gdbOF has been successfully installed. After that I turned back to "Opt" because I wanted to use the alias of230debug which points my bashrc_debug file
Proceeding in this way, should I expect any problems in using gdbOF?
MagnusZeus is offline   Reply With Quote

Old   December 11, 2014, 06:32
Default
  #9
New Member
 
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 16
nisi is on a distinguished road
The error indication tries to ensure that you have a debug compilation of OpenFOAM (only in that compilation mode is possible to set breakpoints, examine variables and so).

If the installation was successful and if before each use you load the right "debug" alias, you will not have any problems to employ the tool.
nisi is offline   Reply With Quote

Old   July 16, 2015, 00:17
Default
  #10
New Member
 
Weiye Ding
Join Date: Jul 2015
Location: Dalian
Posts: 9
Rep Power: 10
Tings_ is on a distinguished road
Hi nisi,

when i try to run 'wmake' in
tings@linux-7ev3:~/OpenFOAM/OpenFOAM-2.4.0/gdbOF_apps/findCell> ,
there is an error

Code:
SOURCE=findCell.C ;  g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/tings/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude -I/home/tings/OpenFOAM/OpenFOAM-2.4.0/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linuxGccDPDebug/findCell.o
In file included from /home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/ddtScheme.C:30:0,
                 from /home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/ddtScheme.H:325,
                 from /home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcDdt.C:28,
                 from /home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcDdt.H:199,
                 from /home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:44,
                 from /home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from findCell.C:37:
/home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/cyclicAMIFvPatch.H:39:35:  Fatal error:cyclicAMILduInterface.H:No such file or directory 
 #include "cyclicAMILduInterface.H"
                                   ^
compile interrupt. 
findCell.dep:619: recipe for target 'Make/linuxGccDPDebug/findCell.o' failed
make: *** [Make/linuxGccDPDebug/findCell.o] Error 1
and after i put "cyclicAMILduInterface.H" into /home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude

there is also another error

Code:
/home/tings/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/cyclicAMILduInterface.H:39:42: Fatal error:AMIPatchToPatchInterpolation.H:No such file or directory                                                              
 #include "AMIPatchToPatchInterpolation.H"                                                                  
                                          ^                                                                 
compile interrupt.                                                                                                  
findCell.dep:619: recipe for target 'Make/linuxGccDPDebug/findCell.o' failed
make: *** [Make/linuxGccDPDebug/findCell.o] Error 1
Every time I solve a problem but another problem comes out and it's always going on.

while i have run 'wmake' successfully in findFace and findFacesCell directiory

So please tell me what should i do ,Thank you!

Best regard!
Tings
Tings_ is offline   Reply With Quote

Old   July 16, 2015, 05:21
Default
  #11
New Member
 
Weiye Ding
Join Date: Jul 2015
Location: Dalian
Posts: 9
Rep Power: 10
Tings_ is on a distinguished road
Hello nisi,

I have solved the errors by copy all the '*.H' files (by the prompt) into the $LIB_SRC/finiteVolume/lnInclude then i run './installgdbOF.sh' successfully.

But , when i try to run gdb in /tutorails/cavity/ the error comes as below
Code:
tings@linux-7ev3:~/tutorails/cavity> gdb
GNU gdb (GDB; openSUSE 13.2) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

warning: /etc/gdbinit.d/gdb-heap.py: No such file or dirtectory
(gdb)
so please give me some advices to solve the error , thank you !

Best regards
Tings
Tings_ is offline   Reply With Quote

Old   August 11, 2015, 13:16
Default gdbOF Installation issue
  #12
Member
 
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 10
WernerW is on a distinguished road
Hi OpenFoamers,

I'm sorry for going back a little bit in the instalation of gdbOF. I followed the instructions given in

Quote:
Originally Posted by nisi View Post
Foamers,

The problem is regarding to the enviromental variables. I think it can be solved running:

$ ./install_gdbOF.sh

which requires execution permission of the file (chmod +x), instead of

$ sh install_gdbOF.sh

Check out http://openfoamwiki.net/index.php/Contrib_gdbOF where the actual command is shown.

Regards
And got this error in the command window

Quote:
werner@werner-K45VD:~/OpenFOAM/gdbOF$ ./installgdbOF.sh
-----------------------------------------------------
Installing gdbOF...
-----------------------------------------------------
Making sure that you have all needed libraries
-----------------------------------------------------
~/OpenFOAM/gdbOF ~/OpenFOAM/gdbOF
making structure
cp: cannot stat ‘gdbOF.tar.gz’: No such file or directory
I do have the folder gdbOf.tar.gz in the directory and when I check the folder OpenFOAM, the directory gdbOF has been removed...

What may be the cause of this issue ?
I apreciate your help

regards,
Werner
WernerW is offline   Reply With Quote

Old   August 11, 2015, 13:24
Default Got it!
  #13
Member
 
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 10
WernerW is on a distinguished road
Ok !

I realized that such procedure is part of the installation, I must extract the files to a different folder than gdbOF.
WernerW is offline   Reply With Quote

Old   August 11, 2015, 14:24
Default missing files in ~/lnInclude
  #14
Member
 
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 10
WernerW is on a distinguished road
Thank you Tings for sharing your process. I just followed your indications and got gdbOF running.

I made a collection of the libraries missing in src/finiteVolume/lnInclude and would like to share them. I have OpenFOAM 2.4.0.

I actually have your same problem with gdb that doesn't recognise the executable in the case directory ( in my case pimpleDyMFoam). I'll share my hints if I solve this issue.

best regards,
Werner
Attached Files
File Type: gz Missing files lnInclude.tar.gz (29.0 KB, 14 views)
WernerW is offline   Reply With Quote

Old   August 11, 2015, 14:44
Default
  #15
Member
 
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 10
WernerW is on a distinguished road
Since you are trying to debug icofoam's cavity the tutorial of Chalmers might help you. With OpenFoam 2.4.0 I had no issue with that case although i'm having the issue with pimpleDyMFoam.

http://www.tfd.chalmers.se/~hani/kur.../debugging.pdf
WernerW is offline   Reply With Quote

Old   August 20, 2015, 09:02
Default
  #16
New Member
 
S Atkinson
Join Date: Mar 2015
Posts: 14
Rep Power: 11
satkinson is on a distinguished road
I had the same issues with the missing files. After replacing them all as mentoned my new error is;

/home/user/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/AMIInterpolation.H:53:31: fatal error: searchableSurface.H: No such file or directory
#include "searchableSurface.H"

This file is in the directory stated.

Any idea's with this one?

Cheers
satkinson is offline   Reply With Quote

Old   August 20, 2015, 10:29
Default
  #17
Member
 
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 10
WernerW is on a distinguished road
Hi,

To what stated directory are you refering ? I remember I missed to include some files in the folder I uploaded becuase I thought of the Idea after a while. Looking for the missing files src folder solves the issue ?
WernerW is offline   Reply With Quote

Old   August 20, 2015, 10:40
Default
  #18
New Member
 
S Atkinson
Join Date: Mar 2015
Posts: 14
Rep Power: 11
satkinson is on a distinguished road
Hi WernerW,

I have the installgdbOF.sh in OpenFOAM/OpenFOAM-2.4.x/GdbOF_v1.03a

This then was missing the directory OpenFOAM/user/gdbOF_apps so I made these directories and it worked before asking for the missing files, similar to Tings. After adding the files you mentioned to /OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/. It now asks for a file which is already in that directory in the form of #include "searchableSurface.H"

Cheers,
satkinson is offline   Reply With Quote

Old   August 20, 2015, 11:43
Default
  #19
Member
 
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 10
WernerW is on a distinguished road
oook, If it's correctly spelled then I don't know what may be the issue :/ good luck with that.

In my experience debugging is not the best way to solve an issue because an Issue may be provoked by something totally unsuspected and/or unreported. If this doesn't help an alternative would be to revise your simulation parameters. In my case a solved a FPE problem just by setting the timeStep to 1e-5, what I had never guessed with the issues I was having with the speed U.

Cheers anyway !
WernerW is offline   Reply With Quote

Reply

Tags
debug, debugging, gdb, gdbof


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool for converting and estimating turbulence boundary conditions pete Main CFD Forum 1 June 20, 2011 13:52
gdbOF: A debugging Tool for OpenFOAM nisi OpenFOAM Programming & Development 0 June 9, 2011 11:28
Modeling of a Forging Tool. hydro CFX 1 May 19, 2010 18:35
[mesh manipulation] ScalePoints tool cedric_duprat OpenFOAM Meshing & Mesh Conversion 6 September 19, 2008 03:15
tool for approximation of condition number rt Main CFD Forum 6 June 24, 2006 02:42


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