CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." (https://www.cfd-online.com/Forums/openfoam-community-contributions/65938-groovybc-problems-compiling-flex-not-found-undefined-reference.html)

sega July 1, 2009 10:54

groovyBC: problems compiling: "flex: not found" and "undefined reference to ..."
 
Maybe its the right time and place to put some questions about groovyBC into a separate thread instead of posting them into other threads about transient boundary condition.

First I have to say, I'm talking about two different computers with two different errors:

First one (running Kubuntu 9.04)

Code:

rm: Entfernen von „Make/linux64GccDPOpt/PatchValueExpressionLexer.C“ nicht möglich: No such file or directory
/bin/sh: flex: not found
mv: Aufruf von stat für „*.c“ nicht möglich: No such file or directory
g++: Make/linux64GccDPOpt/PatchValueExpressionLexer.C: No such file or directory
g++: no input files
make: *** [Make/linux64GccDPOpt/PatchValueExpressionLexer.o] Fehler 1



Second one
(running OpenSUSE 10.3)

Code:

Make/linux64GccDPOpt/groovyBCPointPatchFields.o: In function `Foam::getFvPatch(Foam::pointPatch const&)':
groovyBCPointPatchFields.C:(.text+0x33): undefined reference to `typeinfo for Foam::fvMesh'
groovyBCPointPatchFields.C:(.text+0x66): undefined reference to `Foam::fvMesh::boundary() const'
groovyBCPointPatchFields.C:(.text+0xa3): undefined reference to `typeinfo for Foam::fvMesh'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Fehler 1

So, any ideas whats wrong?

gschaider July 1, 2009 11:39

Quote:

Originally Posted by sega (Post 221101)
Maybe its the right time and place to put some questions about groovyBC into a separate thread instead of posting them into other threads about transient boundary condition.

Good thinking ;)

Quote:

Originally Posted by sega (Post 221101)

First one (running Kubuntu 9.04)

Code:

rm: Entfernen von „Make/linux64GccDPOpt/PatchValueExpressionLexer.C“ nicht möglich: No such file or directory
/bin/sh: flex: not found

flex is not installed on that machine. And if that is missing you'll probably have to install bison too

Second one (running OpenSUSE 10.3)

Code:

Make/linux64GccDPOpt/groovyBCPointPatchFields.o: In function `Foam::getFvPatch(Foam::pointPatch const&)':
groovyBCPointPatchFields.C:(.text+0x33): undefined reference to `typeinfo for Foam::fvMesh'
groovyBCPointPatchFields.C:(.text+0x66): undefined reference to `Foam::fvMesh::boundary() const'
groovyBCPointPatchFields.C:(.text+0xa3): undefined reference to `typeinfo for Foam::fvMesh'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Fehler 1

So, any ideas whats wrong?
[/QUOTE]

That's a strange one. There seem to be some very essential things to be missing from libOpenFOAM.so OR the .so is missing. Did anything every get successfully compiled on that machine?

Bernhard

sega July 1, 2009 12:26

Quote:

Originally Posted by gschaider (Post 221107)
Did anything every get successfully compiled on that machine?

Actually not. I'm always struggling to compile OpenFOAM related things on this machine. Even funkySetFields did not work...

I'm working with this machine at the university, but as far as I know there has been big trouble to compile OpenFOAM 1.5.x at all...

gschaider July 1, 2009 16:09

Quote:

Originally Posted by sega (Post 221115)
Actually not. I'm always struggling to compile OpenFOAM related things on this machine. Even funkySetFields did not work...

I'm working with this machine at the university, but as far as I know there has been big trouble to compile OpenFOAM 1.5.x at all...

Sorry. Then it is not a groovyBC-problem per se. From the error message my first guess would be that it can't link to the OpenFOAM library because
  1. it is not there
  2. it is of a different architecture (32/64-bit? the file-command is your friend when it comes to determining whether your .o and the .so in question fit)
  3. they are not off the same ABI (incompatible) because the c++-compiler was changed in the meantime to a much higher version
My personal recommendation: try recompiling one of the standary-applications (interFoam for example). If that doesn't work either then remove all binary stuff from that OF-version and recompile from scratch

You're on your own. Good luck

sega July 1, 2009 16:59

Quote:

Originally Posted by gschaider (Post 221128)
Sorry. Then it is not a groovyBC-problem per se. From the error message my first guess would be that it can't link to the OpenFOAM library because
  1. it is not there
  2. it is of a different architecture (32/64-bit? the file-command is your friend when it comes to determining whether your .o and the .so in question fit)
  3. they are not off the same ABI (incompatible) because the c++-compiler was changed in the meantime to a much higher version
My personal recommendation: try recompiling one of the standary-applications (interFoam for example). If that doesn't work either then remove all binary stuff from that OF-version and recompile from scratch

You're on your own. Good luck

Thanks for your answer. Of course I'm stuck with this. Despite I'm not that new to linux I have to make sure of what you mean, when you are talkin about

  • OpenFOAM library. What do you mean by that?
  • .o or .os files. How are they related to the system architecture?
    What about the find-command in this case?! What should I search?
  • What is ABI at all?
  • and how can I check the current C++ compiler version?

gschaider July 2, 2009 04:56

Quote:

Originally Posted by sega (Post 221132)
Thanks for your answer. Of course I'm stuck with this. Despite I'm not that new to linux I have to make sure of what you mean, when you are talkin about

I don't know either, some of the time ;)
Quote:

Originally Posted by sega (Post 221132)
  • OpenFOAM library. What do you mean by that?

libOpenFOAM.so
Quote:

Originally Posted by sega (Post 221132)
  • .o or .os files. How are they related to the system architecture?
    What about the find-command in this case?! What should I search?

for instance on my system

file $FOAM_LIBBIN/libOpenFOAM.so

prints something like

libOpenFOAM.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

If for instance you look at a .o file with

file example.o

the output should be similar:

example.o: ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), not stripped

Quote:

Originally Posted by sega (Post 221132)
  • What is ABI at all?

http://en.wikipedia.org/wiki/Applica...nary_interface
The ABIs of g++ are usually downward compatible. But if your OpenFOAM was compiled with a NEWER version of g++ than you are currently using (strange things happen)

Quote:

Originally Posted by sega (Post 221132)
  • and how can I check the current C++ compiler version?

which g++
g++ -v

But honestly: a recompile of your OF-installation seems to me to be the easiest solution in your case

Arnoldinho November 6, 2009 08:28

Hi,

I have also started using OpenFOAM for some of my simulations. When trying to use the groovyBC condition and testing the Demo cases coming with the boundary condition, I always get the following error, which is independent of the demo I am running (circulatingSplash, pulsedPitzDaily, groovywaveTank):

Quote:

// using new solver syntax:
nuTilda
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}


Reading g


cannot open file

file: /home/stahlmann/OpenFOAM/OpenFOAM-1.6/src/groovyBC/Demos/circulatingSplash/constant/g at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 62.

FOAM exiting
There is of course no g file. Do you have any ideas? I'm using Ubuntu 9.04 64-bit and OpenFOAM 1.6.

Arne

matejfor November 8, 2009 05:06

I'm not very familiar with groovyBC, but I guess you're using 1.6.x which reads the gravitational acceleration from file in <case>/constant/g file. In previous versions the file was called different. So the only thing you have to do is to look into tutorials of your OpenFOAM installation and copy the g file to your case and check the vector of gravity is heading to where you want.

good luck

matej

gschaider November 9, 2009 05:04

Quote:

Originally Posted by matejfor (Post 235472)
I'm not very familiar with groovyBC, but I guess you're using 1.6.x which reads the gravitational acceleration from file in <case>/constant/g file. In previous versions the file was called different. So the only thing you have to do is to look into tutorials of your OpenFOAM installation and copy the g file to your case and check the vector of gravity is heading to where you want.

Matej is right. It doesn't look like a problem with groovyBC, but like one of the usual 1.5/1.6-tranhsition problems

Bernhard

farbfilm January 7, 2010 04:36

Hello,

I think I need some help with the compilation of the groovybc!!

When I'm trying to do 'wmake libso', I get the following error:

Code:

michael@wopl:~/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/fields/fvPatchFields/derived/groovyBC> wmake libso
SOURCE=PatchResult.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 -IMake/linux64GccDPOpt  -I/home/michael/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/michael/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -I/home/michael/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/PatchResult.o
In file included from PatchResult.C:34:
PatchResult.H:47:19: error: Field.H: No such file or directory
PatchResult.C:35:20: error: vector.H: No such file or directory
PatchResult.C:36:20: error: tensor.H: No such file or directory
PatchResult.C:37:24: error: symmTensor.H: No such file or directory
PatchResult.C:38:29: error: sphericalTensor.H: No such file or directory
In file included from PatchResult.C:34:
PatchResult.H:62: error: ‘string’ does not name a type
PatchResult.H:86: error: ‘Field’ was not declared in this scope
PatchResult.H:86: error: expected primary-expression before ‘>’ token
PatchResult.H:86: error: expected primary-expression before ‘,’ token
PatchResult.H:86: error: expected primary-expression before ‘bool’
PatchResult.H:86: error: variable or field ‘setResult’ declared void
PatchResult.H:89: error: expected initializer before ‘<’ token
PatchResult.H:93: error: ISO C++ forbids declaration of ‘string’ with no type
PatchResult.H:93: error: ‘string’ declared as an ‘inline’ field
PatchResult.H:93: error: expected ‘;’ before ‘&’ token
In file included from PatchResult.H:105,
                from PatchResult.C:34:
PatchResultI.H:40: error: variable or field ‘setResult’ declared void
PatchResultI.H:40: error: ‘Field’ was not declared in this scope
PatchResultI.H:40: error: expected primary-expression before ‘>’ token
PatchResultI.H:40: error: ‘val’ was not declared in this scope
PatchResultI.H:40: error: expected primary-expression before ‘bool’
PatchResultI.H:50: error: expected constructor, destructor, or type conversion before ‘<’ token
PatchResultI.H:75: error: expected initializer before ‘&’ token
PatchResult.C: In constructor ‘Foam::PatchResult::PatchResult()’:
PatchResult.C:46: error: class ‘Foam::PatchResult’ does not have any field named ‘valType_’
PatchResult.C:47: error: ‘NULL’ was not declared in this scope
PatchResult.C: In copy constructor ‘Foam::PatchResult::PatchResult(const Foam::PatchResult&)’:
PatchResult.C:55: error: class ‘Foam::PatchResult’ does not have any field named ‘valType_’
PatchResult.C:56: error: ‘NULL’ was not declared in this scope
PatchResult.C: In member function ‘void Foam::PatchResult::uglyDelete()’:
PatchResult.C:82: error: ‘valType_’ was not declared in this scope
PatchResult.C:82: error: ‘pTraits’ was not declared in this scope
PatchResult.C:82: error: ‘scalar’ was not declared in this scope
PatchResult.C:82: error: ‘::typeName’ has not been declared
PatchResult.C:83: error: expected type-specifier before ‘scalarField’
PatchResult.C:83: error: expected `>' before ‘scalarField’
PatchResult.C:83: error: expected `(' before ‘scalarField’
PatchResult.C:83: error: ‘scalarField’ was not declared in this scope
PatchResult.C:83: error: expected primary-expression before ‘>’ token
PatchResult.C:83: error: expected `)' before ‘;’ token
PatchResult.C:84: error: ‘vector’ has not been declared
PatchResult.C:85: error: expected type-specifier before ‘Field’
PatchResult.C:85: error: expected `>' before ‘Field’
PatchResult.C:85: error: expected `(' before ‘Field’
PatchResult.C:85: error: ‘Field’ was not declared in this scope
PatchResult.C:85: error: ‘vector’ was not declared in this scope
PatchResult.C:85: error: expected primary-expression before ‘>’ token
PatchResult.C:85: error: expected `)' before ‘;’ token
PatchResult.C:86: error: ‘tensor’ has not been declared
PatchResult.C:87: error: expected type-specifier before ‘Field’
PatchResult.C:87: error: expected `>' before ‘Field’
PatchResult.C:87: error: expected `(' before ‘Field’
PatchResult.C:87: error: ‘Field’ was not declared in this scope
PatchResult.C:87: error: ‘tensor’ was not declared in this scope
PatchResult.C:87: error: expected primary-expression before ‘>’ token
PatchResult.C:87: error: expected `)' before ‘;’ token
PatchResult.C:88: error: ‘symmTensor’ has not been declared
PatchResult.C:89: error: expected type-specifier before ‘Field’
PatchResult.C:89: error: expected `>' before ‘Field’
PatchResult.C:89: error: expected `(' before ‘Field’
PatchResult.C:89: error: ‘Field’ was not declared in this scope
PatchResult.C:89: error: ‘symmTensor’ was not declared in this scope
PatchResult.C:89: error: expected primary-expression before ‘>’ token
PatchResult.C:89: error: expected `)' before ‘;’ token
PatchResult.C:90: error: ‘sphericalTensor’ has not been declared
PatchResult.C:91: error: expected type-specifier before ‘Field’
PatchResult.C:91: error: expected `>' before ‘Field’
PatchResult.C:91: error: expected `(' before ‘Field’
PatchResult.C:91: error: ‘Field’ was not declared in this scope
PatchResult.C:91: error: ‘sphericalTensor’ was not declared in this scope
PatchResult.C:91: error: expected primary-expression before ‘>’ token
PatchResult.C:91: error: expected `)' before ‘;’ token
PatchResult.C:92: error: expected primary-expression before ‘bool’
PatchResult.C:92: error: expected `)' before ‘bool’
PatchResult.C:93: error: expected type-specifier before ‘Field’
PatchResult.C:93: error: expected `>' before ‘Field’
PatchResult.C:93: error: expected `(' before ‘Field’
PatchResult.C:93: error: ‘Field’ was not declared in this scope
PatchResult.C:93: error: expected primary-expression before ‘bool’
PatchResult.C:93: error: expected `)' before ‘bool’
PatchResult.C:93: error: expected `;' before ‘bool’
PatchResult.C:95: error: ‘WarningIn’ was not declared in this scope
PatchResult.C:96: error: ‘endl’ was not declared in this scope
PatchResult.C:97: warning: deleting ‘void*’ is undefined
PatchResult.C:100: error: ‘valType_’ was not declared in this scope
PatchResult.C:101: error: ‘NULL’ was not declared in this scope
PatchResult.C: In member function ‘void Foam::PatchResult::operator=(const Foam::PatchResult&)’:
PatchResult.C:109: error: ‘FatalErrorIn’ was not declared in this scope
PatchResult.C:111: error: ‘FatalError’ was not declared in this scope
PatchResult.C:111: error: ‘abort’ was not declared in this scope
PatchResult.C:115: error: ‘valType_’ was not declared in this scope
PatchResult.C:115: error: ‘const class Foam::PatchResult’ has no member named ‘valType_’
PatchResult.C:118: error: ‘NULL’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/PatchResult.o] Error 1


Can somebody help me??
I'm using OpenFOAM 1.6.x and Bison 2.3


Cheers Michael

farbfilm January 7, 2010 10:51

Well, I think I have another problem with my installation...

matejfor January 8, 2010 02:36

Yep. It looking at the topmost error, the shell does not know anything about your foam installation. Have you checked the foamInstallationTest ? Your comp. does not see the src I would say. Always look at the topmost error first ;).


good luck
matej

gwierink February 17, 2010 09:30

Hi Michael,

Besides the OF installtion issue you mentioned, on the groovyBC wiki it says that groovyBC is know to work with Bison 2.4.1. Maybe you need to have a look at that as well ...


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