CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   PROBLEMS WITH THE COMPILATION (http://www.cfd-online.com/Forums/openfoam-solving/59559-problems-compilation.html)

oscar_j July 11, 2007 11:29

hi, I am trying to get the
 
hi,

I am trying to get the compilation of the laplacianFoam solver with wmake. But some errors happens.

I type within $FOAM_APP/solvers/basic/laplacianFoam directory (OpenFOAM-1.4) simply 'wmake' but I have error messages like these:

/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: variable or field '_M_initialize_moneypunct' declared void
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: 'int std::moneypunct<wchar_t,>::_M_initialize_moneypunc t' is not a static member of 'class std::moneypunct<wchar_t,>'
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: '__c_locale' was not declared in this scope
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3917: error: expected primary-expression before 'const'
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3917: error: initializer expression list treated as compound expression
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3921: error: variable or field '_M_initialize_moneypunct' declared void


What's my mistake?

Thanks!
Oscar

gschaider July 11, 2007 12:26

Hi! This is only a guess: i
 
Hi!

This is only a guess: it looks like the compiler uses headers that he is not supposed to (for instance your sytem-g++ tries to use the OpenFOAM-g++-headers (but for some reason the OpenFOAM-g++ is not used))

Take the following steps:
- Check which g++ you are using: 'which g++'
- If it is not the OpenFOAM-g++ check the version with 'g++ -v'
- Try to compile and execute a small helloWorld.C (you'll have to write one yourself) to check whether your compiler is working

Bernhard

PS: is this the first time you're trying to compile any OF-stuff on that machine?

oscar_j July 11, 2007 13:59

Hi Bernhard, I have the fol
 
Hi Bernhard,

I have the following messages:

1. 'which g++'

-> /home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/g++

2. 'g++ -v'

-> Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr/tmp/gcc-4.1.2 --exec-prefix=/usr/tmp/gcc-4.1.2 --enable-languages=c,c++ --enable-shared --enable-__cxa_atexit --disable-checking
Thread model: posix
gcc version 4.1.2

3. With the compilation of 'HelloWorld.C' appears (gcc HelloWorld.C):

helloworld.C:1:19: error with stdio.h
helloworld.C:6:2: warning: no newline at end of file
helloworld.C: In function 'int main()':
helloworld.C:4: error: 'printf' was not declared in this scope

You're right, the compiler isn't working.

What can I do to fix this problem?

Thanks!
Oscar

gschaider July 12, 2007 09:48

Nope. You tried a C-HelloWorld
 
Nope. You tried a C-HelloWorld. Try a C++-HelloWorld.
(although it looks like he doesn'T find standard-Headers. Check whether there are any under /home/oscar/OpenFOAM/linux/gcc-4.1.2/include (especially look for c++/4.1.2/bits/locale_facets.h)

My guess: Something went wrong while unpacking the downloaded tar (not all the files reached the disk).

oscar_j July 14, 2007 15:53

hi, I reviewed the archives
 
hi,

I reviewed the archives of OpenFOAM installation in linux directory (gcc-4.1.2-, j2sdkl-1.4.2_05 and paraview-2.4.4), and they're all ok.

About my compiler error messages I guess that are produce because the compiler installation in WM_PROJECT_INST_DIR/$WM_ARCH/gcc-3.4.? and enviroment variable in the $WM_PROJECT_DIR/.bashrc aren't correctly configured.

I hope to fix it, I'd appreciate any suggestion .

Thank you very much for your help.
Oscar

oscar_j July 14, 2007 15:57

hi, I forgot it, this is t
 
hi,

I forgot it, this is the first time trying to compile any OpenFoam solver on my machine.

Thanks!
Oscar

oscar_j July 18, 2007 21:41

hi, I could fix the errors.
 
hi,

I could fix the errors. Thank you very much.
The information about it in this link:
> http://www.cfd-online.com/cgi-bin/Op...cus/discus.cgi

Thanks!
Oscar


All times are GMT -4. The time now is 07:44.