CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation

About debugging

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By mxylondon

Reply
 
LinkBack Thread Tools Display Modes
Old   March 4, 2013, 04:10
Default About debugging
  #1
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
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.
mxylondon is offline   Reply With Quote

Old   March 4, 2013, 04:59
Default
  #2
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
In other word, what means 'compile OpenFOAM in debug mode' ?
mxylondon is offline   Reply With Quote

Old   March 4, 2013, 19:16
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Xiangyin,

As I've written in the other thread - Switching to debug mode? - I'll answer here to your questions:
Quote:
In other word, what means 'compile OpenFOAM in debug mode' ?
If you visit OpenFOAM's Download page - http://www.openfoam.org/download/ - you'll find that there are several ways to download and install OpenFOAM.
  • The ones dedicated to Ubuntu, SuSE and Fedora provide a fast download and install method that does not require compiling.
  • The remaining two "Source Pack" and "Git Repository" are instructions for compiling/building OpenFOAM from source code.
In essence, compiling in debug mode is just a matter of following the instructions for the "Source Pack" or "Git Repository" instructions. But before running Allwmake, you must first:
  1. Change "Opt" to "Debug" in OpenFOAM's "etc/bashrc" file.
  2. Start a new terminal.
  3. And only then you can build/compile OpenFOAM in debug mode, by running Allwmake.
Best regards,
Bruno
Thamali likes this.
wyldckat is offline   Reply With Quote

Old   March 5, 2013, 03:15
Default
  #4
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
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 !!!
mxylondon is offline   Reply With Quote

Old   March 5, 2013, 11:02
Default
  #5
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
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!
mxylondon is offline   Reply With Quote

Old   March 5, 2013, 17:12
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Xiangyin,

Quote:
Originally Posted by mxylondon View Post
'foamSystemCheck is not a typo...'
I'm not familiar with that error message. Try the following:
Code:
cd ~
cd OpenFOAM/OpenFOAM-2.1.1
bin/foamSystemCheck
Does it give the same message? If it does, what's the complete message?

If you indicate which exact Linux distribution and respective version+architecture you are using, I can more easily help you.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   March 6, 2013, 03:55
Default
  #7
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
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....
mxylondon is offline   Reply With Quote

Old   March 6, 2013, 04:28
Default
  #8
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
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!
mxylondon is offline   Reply With Quote

Old   March 6, 2013, 06:20
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Run Allwmake like this:
Code:
./Allwmake > make.log 2>&1
Then check the contents of the "make.log" file. The first error is usually the one that tells the whole story.

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
wyldckat is offline   Reply With Quote

Old   March 6, 2013, 07:23
Default
  #10
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
Thank you very much, Bruno.
I'm using the SUSE 12.1, as operation system.
mxylondon is offline   Reply With Quote

Old   March 6, 2013, 11:26
Default
  #11
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
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!!!
mxylondon is offline   Reply With Quote

Old   March 6, 2013, 17:28
Default
  #12
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quote:
Originally Posted by mxylondon View Post
After this, I can do the './Allwmake' in my top-level source directory, right?
I can only guess that yes, you can at least try!
wyldckat is offline   Reply With Quote

Old   March 9, 2013, 17:09
Default Bindings and Compiler?
  #13
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 178
Blog Entries: 1
Rep Power: 7
Linse is on a distinguished road
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! ;-)
Linse is offline   Reply With Quote

Old   March 11, 2013, 05:42
Default
  #14
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
Thank you!!! I am trying, and will tell the result.
mxylondon is offline   Reply With Quote

Old   March 11, 2013, 06:37
Default
  #15
Member
 
Xiangyin Meng
Join Date: Jun 2012
Location: London
Posts: 69
Rep Power: 5
mxylondon is on a distinguished road
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.
Thamali likes this.
mxylondon is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
gdbOF: A debugging Tool for OpenFOAM nisi OpenFOAM Announcements from Other Sources 10 July 16, 2015 05:21
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 11:28
Debugging Udfs in Fluent 5.x Greg Perkins FLUENT 0 April 2, 2001 03:03


All times are GMT -4. The time now is 03:46.