gdbOF: A debugging Tool for OpenFOAM
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) |
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. |
Hiiiii
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 |
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. |
Hiii Nisi
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 |
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? |
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 |
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? |
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. |
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 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 while i have run 'wmake' successfully in findFace and findFacesCell directiory So please tell me what should i do ,Thank you! Best regard! Tings |
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:D. But , when i try to run gdb in /tutorails/cavity/ the error comes as below Code:
tings@linux-7ev3:~/tutorails/cavity> gdb Best regards Tings |
gdbOF Installation issue
Hi OpenFoamers,
I'm sorry for going back a little bit in the instalation of gdbOF. I followed the instructions given in Quote:
Quote:
What may be the cause of this issue ? I apreciate your help ;) regards, Werner |
Got it!
Ok !
I realized that such procedure is part of the installation, I must extract the files to a different folder than gdbOF. |
missing files in ~/lnInclude
1 Attachment(s)
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 |
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 |
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 |
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 ? |
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, |
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 ! |
All times are GMT -4. The time now is 19:57. |