|
[Sponsors] |
September 30, 2009, 08:42 |
yyFlexLexer compilation error
|
#1 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Hi,
I have been compilign OpenFOAM-1.4.1-dev, and it gets through the compilation process for the most part but with just a few solvers and utilities getting the same error about yyFlexLexer: Code:
-lengine -lcompressibleTurbulenceModels -lcombustionThermophysicalModels -lfiniteVolume -llagrangian -ldieselSpray -lliquids -lliquidMixture -lt hermophysicalFunctions -lspecie -lbasicThermophysicalModels -llaminarFlameSpeedModels -lchemistryModel -lODE -lpdf -lOpenFOAM -ldl -lm -o /home/philipc/Ope nFOAM/OpenFOAM-1.4.1-dev/applications/bin/linuxGccDPOpt/dieselEngineFoam /home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/lib/linuxGccDPOpt/libcombustionThermophysicalModels.so: undefined reference to `yyFlexLexer::yywrap()' collect2: ld returned 1 exit status make[2]: *** [/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/applications/bin/linuxGccDPOpt/Xoodles] Error 1 make[1]: *** [Xoodles] Error 2 I don't need the solvers that didn't compile but I do use 'gambitToFoam' which failed. Any suggestion would be much appreciated, Philip |
|
October 13, 2009, 14:44 |
|
#2 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Hmmn...
I still can't seem to figure it out. If someone has an tip it would be great, maybe I'm leaving out something simple... I'll keep trying, Philip |
|
October 13, 2009, 16:46 |
|
#3 |
Senior Member
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22 |
Hello,
Have you tried recompiling libcombustionThermophysicalModels when you switched between flex++ and foamFlex++? There is a .L file there as well that probably needs recompiling. It would also be useful to know your flex version (flex --version). Martin |
|
October 14, 2009, 07:20 |
|
#4 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Hi Martin,
I have tried flex 2.5.35 (flex in YaST2) and flex 2.5.4a (flex old in YaST2). Actually I am getting an error compiling combustion library - I am nearly sure I got this to compile before.. i think). The start of the error is below: Code:
+ wmake libso combustion SOURCE=chemistryReaders/chemkinReader/chemkinLexer.L ; flex++ -f $SOURCE ; mv lex.yy.cc Make/linuxGccDPOpt/chemkinLexer.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/finiteVolume/lnInclude -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/thermophysicalModels/basic/lnInclude -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/OpenFOAM/lnInclude -fPIC -pthread -c Make/linuxGccDPOpt/chemkinLexer.C -o Make/linuxGccDPOpt/chemkinLexer.o SOURCE=derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/finiteVolume/lnInclude -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/thermophysicalModels/basic/lnInclude -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/thermophysicalModels/specie/lnInclude-IlnInclude -I. -I/home/philipc/OpenFOAM/OpenFOAM-1.4.1-dev/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/fixedUnburntEnthalpyFvPatchScalarField.o chemistryReaders/chemkinReader/chemkinLexer.L:58: error: previous declaration of ‘int yywrap()’ with ‘C++’ linkage lex.yy.cc:35561: error: conflicts with new declaration with ‘C’ linkage lex.yy.cc: In member function ‘int Foam::chemkinReader::lex()’: lex.yy.cc:35851: warning: use of old-style cast To change between flex and foamFlex, I just comment out the relevant line in the 'OpenFOAM-1.4.1-dev/wmake/rules/General/flex++' file, right? And then try recompiling everything? Thanks for your help, Philip Btw: I am using OpenSUSE 11.0. Not sure if it makes a difference, but I installed mico-2.3.13, due to an earlier error with mico, it seemed to do the trick. Also, I get this same error with the two versions of flex and foamFlex (assuming I'm actually changing between the different types of flex properly). Last edited by bigphil; October 14, 2009 at 07:36. |
|
October 14, 2009, 10:31 |
|
#5 | |
Senior Member
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22 |
Hello,
That problem was solved in 1.5. This is the piece of code from chemkinReader/chemkinLexer.L that is causing you problem in 1.4.1-dev: // Dummy yywrap to keep yylex happy at compile time.This is what you will now find in 1.5-dev: // Dummy yywrap to keep yylex happy at compile time.You should try to apply the same recipe to all the .L files you need to compile. Another way to correct the problem is to replace the Ltoo rule in the flex++ file by this: Ltoo = flex++ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -DYY_SKIP_YYWRAP -c $*.C -o $@ This is the fix I was using for 1.4.1-dev. The fix implemented in 1.5 is probably much better. Give it a try and see how far you can go. Martin Quote:
|
||
October 14, 2009, 11:14 |
It works!
|
#6 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Martin,
The offending libraries compiled (albeit with quite a few warnings of use of old-style cast). And now the utilities and solvers that didn't before are now compiling! I can finally use gambitToFoam in this installation. Thanks very much for your help, It is very much appreciated! Best Regards, Philip Cardiff Last edited by bigphil; October 14, 2009 at 12:10. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 10:31 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
Compiling problems with hello worldC | fw407 | OpenFOAM Installation | 21 | January 6, 2008 18:38 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |