|
[Sponsors] |
July 6, 2011, 16:33 |
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 |
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) |
|
February 22, 2012, 09:44 |
|
#2 |
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24 |
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 |
|
April 14, 2014, 13:54 |
Hiiiii
|
#3 |
Member
Manjunath Reddy
Join Date: Jun 2013
Posts: 47
Rep Power: 13 |
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 |
|
April 14, 2014, 15:33 |
|
#4 |
New Member
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 16 |
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. |
|
April 14, 2014, 15:48 |
Hiii Nisi
|
#5 |
Member
Manjunath Reddy
Join Date: Jun 2013
Posts: 47
Rep Power: 13 |
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 |
|
December 9, 2014, 06:08 |
|
#6 |
New Member
Gabriele Mosca
Join Date: Dec 2011
Location: Brussels
Posts: 3
Rep Power: 14 |
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? |
|
December 9, 2014, 13:05 |
|
#7 |
New Member
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 16 |
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 |
|
December 11, 2014, 06:18 |
|
#8 |
New Member
Gabriele Mosca
Join Date: Dec 2011
Location: Brussels
Posts: 3
Rep Power: 14 |
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? |
|
December 11, 2014, 07:32 |
|
#9 |
New Member
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 16 |
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. |
|
July 16, 2015, 01:17 |
|
#10 |
New Member
Weiye Ding
Join Date: Jul 2015
Location: Dalian
Posts: 9
Rep Power: 11 |
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 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 while i have run 'wmake' successfully in findFace and findFacesCell directiory So please tell me what should i do ,Thank you! Best regard! Tings |
|
July 16, 2015, 06:21 |
|
#11 |
New Member
Weiye Ding
Join Date: Jul 2015
Location: Dalian
Posts: 9
Rep Power: 11 |
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) Best regards Tings |
|
August 11, 2015, 14:16 |
gdbOF Installation issue
|
#12 | ||
Member
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 11 |
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 |
|||
August 11, 2015, 14:24 |
Got it!
|
#13 |
Member
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 11 |
Ok !
I realized that such procedure is part of the installation, I must extract the files to a different folder than gdbOF. |
|
August 11, 2015, 15:24 |
missing files in ~/lnInclude
|
#14 |
Member
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 11 |
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 |
|
August 11, 2015, 15:44 |
|
#15 |
Member
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 11 |
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 |
|
August 20, 2015, 10:02 |
|
#16 |
New Member
S Atkinson
Join Date: Mar 2015
Posts: 14
Rep Power: 11 |
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 |
|
August 20, 2015, 11:29 |
|
#17 |
Member
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 11 |
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 ? |
|
August 20, 2015, 11:40 |
|
#18 |
New Member
S Atkinson
Join Date: Mar 2015
Posts: 14
Rep Power: 11 |
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, |
|
August 20, 2015, 12:43 |
|
#19 |
Member
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 11 |
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 ! |
|
Tags |
debug, debugging, gdb, gdbof |
|
|
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 14:52 |
gdbOF: A debugging Tool for OpenFOAM | nisi | OpenFOAM Programming & Development | 0 | June 9, 2011 12:28 |
Modeling of a Forging Tool. | hydro | CFX | 1 | May 19, 2010 19:35 |
[mesh manipulation] ScalePoints tool | cedric_duprat | OpenFOAM Meshing & Mesh Conversion | 6 | September 19, 2008 04:15 |
tool for approximation of condition number | rt | Main CFD Forum | 6 | June 24, 2006 03:42 |