CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   About debugging (http://www.cfd-online.com/Forums/openfoam-installation/114029-about-debugging.html)

mxylondon March 4, 2013 04:10

About debugging
 
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 March 4, 2013 04:59

In other word, what means 'compile OpenFOAM in debug mode' ?

wyldckat March 4, 2013 19:16

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:

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

mxylondon March 5, 2013 03:15

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 March 5, 2013 11:02

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!

wyldckat March 5, 2013 17:12

Hi Xiangyin,

Quote:

Originally Posted by mxylondon (Post 411675)
'foamSystemCheck is not a typo...'

:confused: 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

mxylondon March 6, 2013 03:55

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 March 6, 2013 04:28

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!

wyldckat March 6, 2013 06:20

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

mxylondon March 6, 2013 07:23

Thank you very much, Bruno.
I'm using the SUSE 12.1, as operation system.

mxylondon March 6, 2013 11:26

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!!!

wyldckat March 6, 2013 17:28

Quote:

Originally Posted by mxylondon (Post 412006)
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! ;)

Linse March 9, 2013 17:09

Bindings and Compiler?
 
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! ;-)

mxylondon March 11, 2013 05:42

Thank you!!! I am trying, and will tell the result.

mxylondon March 11, 2013 06:37

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. :)


All times are GMT -4. The time now is 05:13.