CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Yy_current_buffer undefined flexx2533 vs flexx254 (https://www.cfd-online.com/Forums/openfoam-bugs/62489-yy_current_buffer-undefined-flexx2533-vs-flexx254.html)

jens_klostermann December 4, 2007 12:35

Description: If you compile O
 
Description:
If you compile OpenFoam-1.4.1-dev the following error occurs:
SOURCE=triSurface/interfaces/STL/readSTLASCII.L ; foamFlex++ -f $SOURCE ; mv lex.yy.cc Make/linux64GccDPOpt/readSTLASCII.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/klosterm/OpenFOAM/OpenFOAM-1.4.1-dev/src/OpenFOAM/lnInclude -fPIC -c Make/linux64GccDPOpt/readSTLASCII.C -o Make/linux64GccDPOpt/readSTLASCII.o
SOURCE=triSurface/interfaces/STL/readSTLBINARY.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/klosterm/OpenFOAM/OpenFOAM-1.4.1-dev/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/readSTLBINARY.o
lex.yy.cc: In member function 'int STLLexer::lex()':
lex.yy.cc:5447: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:5468: warning: use of old-style cast
lex.yy.cc:5468: warning: use of old-style cast
lex.yy.cc:5484: warning: use of old-style cast
lex.yy.cc:5698: warning: use of old-style cast
lex.yy.cc:5704: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:5727: error: 'yy_current_buffer' was not declared in this scope
triSurface/interfaces/STL/readSTLASCII.L:204: warning: unused variable 'endPtr'
lex.yy.cc: In constructor 'yyFlexLexer::yyFlexLexer(std::istream*, std::ostream*)':
lex.yy.cc:5844: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc: In destructor 'virtual yyFlexLexer::~yyFlexLexer()':
lex.yy.cc:5856: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc: In member function 'virtual void yyFlexLexer::switch_streams(std::istream*, std::ostream*)':
lex.yy.cc:5863: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc: In member function 'int yyFlexLexer::yy_get_next_buffer()':
lex.yy.cc:5916: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:5947: warning: use of old-style cast
lex.yy.cc:5974: warning: use of old-style cast
lex.yy.cc:5987: warning: use of old-style cast
lex.yy.cc:5988: warning: use of old-style cast
lex.yy.cc:6009: warning: use of old-style cast
lex.yy.cc: In member function 'yy_state_type yyFlexLexer::yy_get_previous_state()':
lex.yy.cc:6057: warning: use of old-style cast
lex.yy.cc:6057: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yyunput(int, char*)':
lex.yy.cc:6106: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:6118: warning: use of old-style cast
lex.yy.cc:6119: warning: use of old-style cast
lex.yy.cc:6127: warning: use of old-style cast
lex.yy.cc: In member function 'int yyFlexLexer::yyinput()':
lex.yy.cc:6148: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:6196: warning: use of old-style cast
lex.yy.cc: In member function 'virtual void yyFlexLexer::yyrestart(std::istream*)':
lex.yy.cc:6207: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:6210: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc: In member function 'virtual void yyFlexLexer::yy_switch_to_buffer(yy_buffer_state*) ':
lex.yy.cc:6217: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:6220: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:6228: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc: In member function 'void yyFlexLexer::yy_load_buffer_state()':
lex.yy.cc:6242: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc: In member function 'virtual yy_buffer_state* yyFlexLexer::yy_create_buffer(std::istream*, int)':
lex.yy.cc:6253: warning: use of old-style cast
lex.yy.cc:6262: warning: use of old-style cast
lex.yy.cc: In member function 'virtual void yyFlexLexer::yy_delete_buffer(yy_buffer_state*)':
lex.yy.cc:6279: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc:6280: warning: use of old-style cast
lex.yy.cc:6283: warning: use of old-style cast
lex.yy.cc:6285: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yy_flush_buffer(yy_buffer_state*)':
lex.yy.cc:6321: error: 'yy_current_buffer' was not declared in this scope
lex.yy.cc: In member function 'void yyFlexLexer::yy_push_state(int)':
lex.yy.cc:6349: warning: use of old-style cast
lex.yy.cc:6353: warning: use of old-style cast
lex.yy.cc:6353: warning: use of old-style cast
lex.yy.cc: In function 'void* yy_flex_alloc(yy_size_t)':
lex.yy.cc:6455: warning: use of old-style cast
lex.yy.cc: In function 'void* yy_flex_realloc(void*, yy_size_t)':
lex.yy.cc:6473: warning: use of old-style cast
lex.yy.cc:6473: warning: use of old-style cast
make: *** [Make/linux64GccDPOpt/readSTLASCII.o] error 1



Source file:
readSTLBINARY.C

Platform:
Debian based Ubuntu 7.10, but probably on all system using flexx version > 2.5.33 remedy downgrade to version 2.5.4 as already mentioned by
By Juan Hierro on Wednesday May 31 2006 - 05:03 pm


Version:
OpenFoam-1.4.1-dev error does not occur on OpenFoam-1.4.1 which is strange to me.

Notes:
probably not really an OpenFoam bug but still anoying.

henry December 4, 2007 12:51

I built the released OpenFOAM-
 
I built the released OpenFOAM-1.4.1 and our 1.4.2 development version on SuSE linux with flex version 2.5.33 without problem so it may not be a problem with the flex version but a problem with the sources you are building.

mbeaudoin December 4, 2007 23:43

Hello Jens, I built OpenFoa
 
Hello Jens,

I built OpenFoam-1.4.1-dev on Knoppix 5.1 with flex version 2.5.33. No problem here.

The problem is not with the sources nor with flex version 2.5.33. Must be somewhere else.

Martin

jens_klostermann December 5, 2007 04:11

Hello all, I think the sour
 
Hello all,

I think the sources are all right. The problem was the user (me).

I just found out that it all depends if flex++ or foamFlex++ is used, which is set in $WM_PROJECT_INST_DIR/wmake/rules/General/flex++.

With Ubuntu 7.10

foamFlex++ (default in OF-1.4.1-dev) works with flex version 2.5.4
flex++ (default in OF-1.4.1 and maybe OF-1.4.2-dev??) works with flex version 2.5.33

So for OF-1.4.1-dev and flex version 2.5.33
make sure your flexx++ contains the line:
Ltoo = flex++ $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
instead of
Ltoo = foamFlex++ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
!!

Jens

hjasak December 5, 2007 05:46

Hi Jens, The error is due t
 
Hi Jens,

The error is due to a mis-match between the header and the flex version being picked up. Have a look at $FOAM_SRC/OpenFOAM/lnInclude - there should be a file in there called FlexLexer.h. If not, do the following:


cd $FOAM_APP/utilities/miscellaneous
cp foamFlex/FlexLexer.h $FOAM_SRC/OpenFOAM/lnInclude


and try again. I think David had and solved a similar problem in the past but haven't heard any updates.

jens_klostermann December 7, 2007 07:03

Hi Hrv, If I do as suggeste
 
Hi Hrv,

If I do as suggested:

{cd $FOAM_APP/utilities/miscellaneous
cp foamFlex/FlexLexer.h $FOAM_SRC/OpenFOAM/lnInclude

(which is also set $FOAM_SRC/Allwmake (why doesn't work this as set in the Allwmake file?))

The errors from above (yy_current_buffer) is now gone (foamFlex++ (default in OF-1.4.1-dev) works with flex version 2.5.33.), but later on I get some nasty segmentation faults:

+ wmake libo fbsdmalloc
/home/klosterm/OpenFOAM/OpenFOAM-1.4.1-dev/wmake/wmakeLnInclude: linking include files to /home/klosterm/OpenFOAM/OpenFOAM-1.4.1-dev/src/malloc/fbsdmalloc/lnInclude

Making dependency list for source file fbsdmalloc.c
could not open file libc_private.h for source file fbsdmalloc.c
could not open file spinlock.h for source file fbsdmalloc.c
Segmentation fault (core dumped)
.

which I also get if I use flex++ with flex version 2.5.33, instead of foamFlex++.

So the only thing which works for me is using the old flex version 2.5.4.

Jens

lakeat February 27, 2008 02:51

I do as suggested: 1. cd $
 
I do as suggested:

1.
cd $FOAM_APP/utilities/miscellaneous
cp foamFlex/FlexLexer.h $FOAM_SRC/OpenFOAM/lnInclude

No effect.

2.
make sure your flexx++ contains the line:
Ltoo = flex++ $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
instead of
Ltoo = foamFlex++ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@

No effect.

It's annoying to compile in Ubuntu (7.10).

lakeat February 27, 2008 02:53

I do as suggested: 1. cd $
 
I do as suggested:

1.
cd $FOAM_APP/utilities/miscellaneous
cp foamFlex/FlexLexer.h $FOAM_SRC/OpenFOAM/lnInclude

No effect.

2.
make sure your flexx++ contains the line:
Ltoo = flex++ $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
instead of
Ltoo = foamFlex++ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@

No effect.

It's annoying to compile in Ubuntu (7.10).

schmidt_d April 1, 2008 10:41

I had a similar error with com
 
I had a similar error with compiling the -dev version under SUSE Enterprise 10.1 and came up with a silly workaround....just wmake a second time and the readSTLASCII.L file gets processed correctly. I have no idea why...

-David

niklas April 10, 2008 09:58

flex-2.5.35 works for me flex
 
flex-2.5.35 works for me
flex-2.5.33 does not.


All times are GMT -4. The time now is 21:02.