CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   erros when compiling simpleSRFFoam (http://www.cfd-online.com/Forums/openfoam-installation/74145-erros-when-compiling-simplesrffoam.html)

examosty March 25, 2010 11:26

erros when compiling simpleSRFFoam
 
Hello everyone,
I've installed OpenFoam 1.6 in suse 11.2.
When I try to compile the simpleSRFFoam or other user defined solvers, I always receive these errors:

Making dependency list for source file simpleSRFFoam.C
g++ simpleSRFFoam.C -o simpleSRFFoam
simpleSRFFoam.C:34:19: error: fvCFD.H: file or directory not fund
simpleSRFFoam.C:35:39: error: singlePhaseTransportModel.H: file or directory not fund
simpleSRFFoam.C:36:22: error: RASModel.H: Datei oder Verzeichnis nicht gefunden
simpleSRFFoam.C:37:22: error: SRFModel.H: Datei oder Verzeichnis nicht gefunden
simpleSRFFoam.C:43:29: error: setRootCase.H: Datei oder Verzeichnis nicht gefunden
simpleSRFFoam.C:44:28: error: createTime.H: Datei oder Verzeichnis nicht gefunden
simpleSRFFoam.C:45:28: error: createMesh.H: Datei oder Verzeichnis nicht gefunden
simpleSRFFoam.C:47:36: error: initContinuityErrs.H: Datei oder Verzeichnis nicht gefunden
simpleSRFFoam.C:57:40: error: readSIMPLEControls.H: Datei oder Verzeichnis nicht gefunden
In file included from simpleSRFFoam.C:65:
pEqn.H:26:31: error: continuityErrs.H: Datei oder Verzeichnis nicht gefunden
In file included from simpleSRFFoam.C:46:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:1: error: ‘Info’ was not declared in this scope
createFields.H:1: error: ‘endl’ was not declared in this scope
createFields.H:2: error: ‘volScalarField’ was not declared in this scope
createFields.H:2: error: expected `;' before ‘p’
createFields.H:16: error: ‘volVectorField’ was not declared in this scope
createFields.H:16: error: expected `;' before ‘Urel’
createFields.H:30: error: ‘surfaceScalarField’ was not declared in this scope
createFields.H:30: error: expected `;' before ‘phi’
createFields.H:43: error: ‘label’ was not declared in this scope
createFields.H:43: error: expected `;' before ‘pRefCell’
createFields.H:44: error: ‘scalar’ was not declared in this scope
createFields.H:44: error: expected `;' before ‘pRefValue’
createFields.H:45: error: ‘p’ was not declared in this scope
createFields.H:45: error: ‘mesh’ was not declared in this scope
createFields.H:45: error: ‘pRefCell’ was not declared in this scope
createFields.H:45: error: ‘pRefValue’ was not declared in this scope
createFields.H:45: error: ‘setRefCell’ was not declared in this scope
createFields.H:47: error: ‘singlePhaseTransportModel’ was not declared in this scope
createFields.H:47: error: expected `;' before ‘laminarTransport’
createFields.H:49: error: ‘autoPtr’ was not declared in this scope
createFields.H:49: error: ‘incompressible’ has not been declared
createFields.H:51: error: ‘incompressible’ has not been declared
createFields.H:51: error: ‘Urel’ was not declared in this scope
createFields.H:51: error: ‘phi’ was not declared in this scope
createFields.H:51: error: ‘laminarTransport’ was not declared in this scope
createFields.H:52: error: ‘turbulence’ was not declared in this scope
createFields.H:55: error: ‘SRF’ has not been declared
createFields.H:57: error: ‘SRF’ has not been declared
createFields.H:58: error: ‘SRF’ was not declared in this scope
simpleSRFFoam.C:53: error: ‘runTime’ was not declared in this scope
simpleSRFFoam.C:55: error: ‘nl’ was not declared in this scope
...etc.
It's strange, because the files (e.g. fvCFD.H) are included in the file finiteVolume.
Does someone have any idea how can I figure it out?

Regards.

examosty April 21, 2010 13:05

Could someone tell me which can be the problem? I've tried to solve it by myself, but I can not. Is it something about the compiler installed in my computer?

niklas April 21, 2010 13:15

are you using wmake?

if you dont know what Im talking about you should consult the UserGuide documentation.

examosty April 22, 2010 03:19

Hi niklas,
yes i'm using wmake.
if i just change the code of (for example) simpleFoam it works, but if i try to compile a new foam, no way. I hope you can help me more.
Best Regards!

niklas April 22, 2010 03:39

You haven't included the include search paths in the Make/options file.

Code:

EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude


examosty April 22, 2010 03:55

Hello niklas,

But i do include that in the Make/option file:
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel

EXE_LIBS = \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools
The "fvCFD.H" is also included in the "simpleSRFFoam.C" file. I cannot understand why he doesn't find it.

Best Regards!

wyldckat April 22, 2010 09:51

Greetings to all,

June, have you tried seeing if the file "fvCFD.H" does exist in the folder "$FOAM_SRC/finiteVolume/lnInclude"? Actually, it should be a symbolic link... For example, try:
Code:

ls -l $FOAM_SRC/finiteVolume/lnInclude/fvCFD.H
This command gives me something like this:
Code:

lrwxrwxrwx 1 xxx xxx 2010-01-18 16:58 /home/xxx/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/fvCFD.H -> ../cfdTools/general/include/fvCFD.H
If it doesn't give you something similar and instead gives you "No such file or directory", then that is what's wrong! You'll probably have to rebuild OpenFOAM again.

The other possibility is: how did you run wmake? Try this inside the folder where you have your solver:
Code:

wclean
wmake


Best regards,
Bruno

examosty April 23, 2010 03:34

Hi Bruno,
that's exactly what i can not understand. The fvCFD.H exist, but can not be fund. I've tried to rebuild OpenFOAM, it didn't help.
About the wmake i alway do it as you said. So I'm thinking maybe it's something wrong with my system or compiler. But I don't know how can I figure out. What will you say?
Best regards,
June

wyldckat April 23, 2010 17:25

Greetings June,

OK, lets try the following possibilities:
  1. what gcc version are you using? Run the following command, so we can know what version it is:
    Code:

    gcc -v
  2. try to build the volField test utility (that also depends on fvCFD.H), by running the following commands:
    Code:

    cd $WM_PROJECT_DIR/applications/test/volField
    wmake

    If it doesn't output any errors, then it's one more reason simpleSRFFoam should build...
  3. after I tracked down other posts you've made in the past, I was able to identify that the installed openSUSE architecture is x86_64, and more importantly, something somewhat uncommon: you've installed OpenFOAM 1.6 in the folder "/usr/local/OpenFOAM/1.6/" instead of the usual "/home/username/OpenFOAM/OpenFOAM-1.6". This could be part of the reason you're getting some problems with building simpleSRFFoam. So the question is: did you build OpenFOAM with the user root, or did you build it with your normal user?
    If you've built OpenFOAM as root, and then try to build simpleSRFFoam as a normal user, you possibly can't access the famed fvCFD.H file.
    So, two possibilities arise:
    1. run this command as root:
      Code:

      chmod 777 -R /usr/local/OpenFOAM
      which will make the whole OpenFOAM fully accessible to your all openSUSE's users, and try again building simpleSRFFoam.
    2. or you could setup OpenFOAM in your home folder, just like most people do ;) (I think... but I'm not certain of this)
  4. Additionally, where are you trying to build simpleSRFFoam? Is it in your own user folder, or in the folder "/usr/local/OpenFOAM/1.6/tutorials/incompressible/simpleSRFFoam"?

So, to sum up, the less information you provide on how you installed OpenFOAM, the less likely we'll be able to guess or reproduce the problem you are having right now! Of course too much information would also be counter productive :rolleyes:

Best regards,
Bruno

gwierink April 24, 2010 04:47

Hi June,

Strange problem, I just gave it a try (with OpenFOAM-1.6.x on OpenSUSE 11.2) and no problem occurred. But then again, I have compiled 1.6.x (with Alberto Passalacqua's howTo). Maybe it's an idea to compile the whole lot?

examosty April 26, 2010 10:18

Greetings Bruno,

Thanks very much for you suggestion.

I did the things you`ve mentioned:

1. with the code "gcc -v" I got the version: gcc version 4.3.3. The whole message is:
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-languages=c,c++ --with-pkgversion=OpenFOAM --enable-__cxa_atexit --enable-libstdcxx-allocator=new --with-system-zlib --prefix=/home/dm2/henry/OpenFOAM/ThirdParty/gcc-4.3.3/platforms/linux64 --with-mpfr=/home/dm2/henry/OpenFOAM/ThirdParty/mpfr-2.4.1/platforms/linux64 --with-gmp=/home/dm2/henry/OpenFOAM/ThirdParty/gmp-4.2.4/platforms/linux64
Thread model: posix
gcc version 4.3.3 (OpenFOAM)


2. SOURCE=volFieldTest.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/yang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/yang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/yang/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/volFieldTest.o
/home/yang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/fvMatrixSolve.C: In member function ‘Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve(const Foam::dictionary&) [with Type = Foam::SphericalTensor<double>]’:
/home/yang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/fvMatrixSolve.C:186: instantiated from ‘Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve() [with Type = Foam::SphericalTensor<double>]’
/home/yang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/fvMatrix.C:1288: instantiated from ‘Foam::lduMatrix::solverPerformance Foam::solve(const Foam::tmp<Foam::fvMatrix<Type> >&) [with Type = Foam::SphericalTensor<double>]’
volFieldTest.C:95: instantiated from here
/home/yang/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/fvMatrixSolve.C:88: error: no matching function for call to ‘Foam::SphericalTensor<int>::SphericalTensor(Foam: :SymmTensor<int>)’
/home/yang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude
/SphericalTensorI.H:63: note: candidates are: Foam::SphericalTensor<Cmpt>::SphericalTensor(Foam: :Istream&) [with Cmpt = int]
/home/yang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/SphericalTensorI.H:55: note: Foam::SphericalTensor<Cmpt>::SphericalTensor(const Cmpt&) [with Cmpt = int]
/home/yang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/SphericalTensorI.H:47: note: Foam::SphericalTensor<Cmpt>::SphericalTensor(const Foam::VectorSpace<Foam::SphericalTensor<Cmpt>, Cmpt, 1>&) [with Cmpt = int]
/home/yang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/SphericalTensorI.H:38: note: Foam::SphericalTensor<Cmpt>::SphericalTensor() [with Cmpt = int]
/home/yang/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/SphericalTensor.H:56: note: Foam::SphericalTensor<int>::SphericalTensor(const Foam::SphericalTensor<int>&)
make: *** [Make/linux64GccDPOpt/volFieldTest.o] Fehler 1
one error exist.
What did this mean?


3. I've installed Openfoam in the local folder before, but I unstalled it. The OpenFoam I'm using now is installed in my home folder like most people do :).

4. I always try to build the simpleSRFFoam in the turtorial folder, I think it should be right.

Best Regards,
June

examosty April 26, 2010 11:08

Hi Gij,
Thank you very much for the information. Maybe I'll try it later.

wyldckat April 26, 2010 18:53

Greetings June,

OK, as for the reply to each point on the list:
1. you're using gcc-4.3.3 - this is good, because this is a must for building OpenFOAM 1.6;

2. Sorry about that, I only checked in OpenFOAM 1.6.x. I've now checked in OpenFOAM 1.6 and it gave me the exact same response. These specific errors that it gives in 1.6 are already fixed in 1.6.x.
The good thing about this one is that it actually means that fvCFD.H was found! Which means that simpleSRFFoam should build!

3. OK, so far so good.

4. Actually, as a precautionary measure, you should have followed the User Guide's instructions (see --> here <--):
Code:

mkdir -p $FOAM_RUN
cp -r $FOAM_TUTORIALS $FOAM_RUN

This way you always keep the original copy safe from being corrupted ;)


Uhm... this is very odd. The only thing left that seems possibly logical to me is that due to some specific chain of events, the following things happened:
  1. you unpacked the files:
    Code:

    OpenFOAM-1.6.General.gtgz
    OpenFOAM-1.6.linux64GccDPOpt.gtgz
    ThirdParty-1.6.General.gtgz
    ThirdParty-1.6.linux64Gcc.gtgz

  2. sourced the bashrc file that comes with OpenFOAM-1.6/etc;
  3. then ran Allwmake in the folder OpenFOAM-1.6.
  4. errors occurred during the building process, but weren't visible nor did they catch your sight.
  5. although errors occurred, the libraries and applications remained untouched, because they already came from the "linux64*" packages.
Now, what this theory doesn't explain, is why volField doesn't point out that the fvCFD.H file is missing.

So, only two possibilities remain:
  1. the most likely one: the OpenFOAM environment isn't properly active when you try to build simpleSRFFoam. So, how do you "activate" the OpenFOAM environment?
  2. the strange... yet possible one: the unpacked OpenFOAM-1.6.General.gtgz file wasn't 100% properly unpacked; or didn't download properly. Both of these issues have been reported in the past (bad unpack or bad download).
And for now, I'm all out of ideas :(

Best regards,
Bruno


All times are GMT -4. The time now is 12:09.