|
[Sponsors] |
March 4, 2013, 04:10 |
About debugging
|
#1 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
Dear all, I have a question about OF debug.
That is, in many instructions, it is said that, 'In $WM PROJECT DIR/etc/bashrc the environment variable $WM COMPILE OPTION can be set to Debug. You need to recompile OpenFOAM.' I have changed 'Opt' to 'Debug' now, but what's that mean 'recopile OpneFOAM' ? Really confused... Thank you very much! Waitting online for answers. |
|
March 4, 2013, 04:59 |
|
#2 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
In other word, what means 'compile OpenFOAM in debug mode' ?
|
|
March 4, 2013, 19:16 |
|
#3 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Xiangyin,
As I've written in the other thread - http://www.cfd-online.com/Forums/ope...ebug-mode.html - I'll answer here to your questions: Quote:
Bruno
__________________
|
||
March 5, 2013, 03:15 |
|
#4 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
OMG! OMG! I did the thing in a totally wrong way before...
Thank you very very very much! wyldckat! I will do that in your way right now. Thank you very much for your help !!! |
|
March 5, 2013, 11:02 |
|
#5 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
Dear Bruno,
When I excute 'foamSystemCheck' in OpenFOAM-2.1.1/bin as the instruction before building the sources, it shows 'foamSystemCheck is not a typo...' I did something in wrong way again? Thank you very much! |
|
March 5, 2013, 17:12 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Xiangyin,
I'm not familiar with that error message. Try the following: Code:
cd ~ cd OpenFOAM/OpenFOAM-2.1.1 bin/foamSystemCheck If you indicate which exact Linux distribution and respective version+architecture you are using, I can more easily help you. Best regards, Bruno
__________________
|
|
March 6, 2013, 03:55 |
|
#7 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
Dear Bruno, Thank you very much for reply.
When I try to compile the solvers in debug mode, I do all the things as the instruction and as your suggestion, but I still got error. e.g. when I compile icoFoam, this is the result (message): /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Making dependency list for source file icoFoam.C SOURCE=icoFoam.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/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPDebug/icoFoam.o /home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’: /home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] /home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable] /home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable] g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linuxGccDPDebug/icoFoam.o -L/home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/platforms/linuxGccDPDebug/lib \ -lfiniteVolume -lOpenFOAM -ldl -ggdb3 -DFULLDEBUG -lm -o /home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/platforms/linuxGccDPDebug/bin/icoFoam /usr/lib/gcc/i586-suse-linux/4.6/../../../../i586-suse-linux/bin/ld: cannot find -lfiniteVolume /usr/lib/gcc/i586-suse-linux/4.6/../../../../i586-suse-linux/bin/ld: cannot find -lOpenFOAM collect2: ld returned 1 exit status make: *** [/home/xiangyin/OpenFOAM/OpenFOAM-2.1.1/platforms/linuxGccDPDebug/bin/icoFoam] Error 1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// I'm really f**ked by it.... |
|
March 6, 2013, 04:28 |
|
#8 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
And, I also have a question about the compile process.
In the instruction, it's siad: ''Go to the top-level source directory $WM_PROJECT_DIR and execute the top-level build script ./Allwmake. In principle this will build everything, but if problems occur with the build order it may be necessary to update the environment variables and re-execute ./Allwmake.'' My question is, what the last sentence 'but if problems occur with the build order it may be necessary to update the environment variables and re-execute ./Allwmake' means? May that be the reason for my trouble? Thanks again! |
|
March 6, 2013, 06:20 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Run Allwmake like this:
Code:
./Allwmake > make.log 2>&1 In the mean time, since you didn't indicate which Linux distribution you are using, check the unofficial installation instructions available here: http://openfoamwiki.net/index.php/Installation
__________________
|
|
March 6, 2013, 07:23 |
|
#10 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
Thank you very much, Bruno.
I'm using the SUSE 12.1, as operation system. |
|
March 6, 2013, 11:26 |
|
#11 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
And, after I execute the oder 'foamSystemCheck', I got the message 'System check: PASS====Continue OpenFOAM installation'.
That means all the things I did before this are correct, right? After this, I can do the './Allwmake' in my top-level source directory, right? Thank you very much!!! |
|
March 6, 2013, 17:28 |
|
#12 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
I can only guess that yes, you can at least try!
__________________
|
|
March 9, 2013, 17:09 |
Bindings and Compiler?
|
#13 |
Senior Member
|
I had a similar error message during the last few days when trying to install an earlier version of OpenFOAM. If I remember correctly, that was connected with the choice of the C++ compiler.
I would suggest to check the following steps: - Which gcc are you using? ( You will learn that by "gcc --version") - Is the version chosen within your OpenFOAM-2.1.1/etc/config/bashrc and within OpenFOAM-2.1.1/etc/settings.sh the same as the one your computer uses? - Do you have the development-libraries for this gcc installed on your computer? ( just try apt-get gcc* or yum install gcc* or whatever your package-manager is ) In any case: If you manage to solve the problem, tell us how you did it! ;-) |
|
March 11, 2013, 05:42 |
|
#14 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
Thank you!!! I am trying, and will tell the result.
|
|
March 11, 2013, 06:37 |
|
#15 |
Member
X Meng
Join Date: Jun 2012
Location: Scotland
Posts: 89
Rep Power: 14 |
All problems solved, finally.
Bruno, thank you! And Linseisen, thank you! All troubles are about my authority to the computer. For OP 2.2.0 installation on SUSE 12.1, My expirence is: 1. Just do all the things as said in Official instruction, step by step. 2. Do all the things using root authority. Thanks again. God save the queen, and me. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
gdbOF: A debugging Tool for OpenFOAM | nisi | OpenFOAM Announcements from Other Sources | 18 | August 20, 2015 12:43 |
How to extract Ax=B from solver for debugging | sontac | OpenFOAM | 3 | January 30, 2012 09:32 |
Debugging Unsteady 2-D Panel Method Code: Wake Modeling | RajeshAero | Main CFD Forum | 5 | November 10, 2011 06:48 |
gdbOF: A debugging Tool for OpenFOAM | nisi | OpenFOAM Programming & Development | 0 | June 9, 2011 12:28 |
Debugging Udfs in Fluent 5.x | Greg Perkins | FLUENT | 0 | April 2, 2001 04:03 |