CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

Yy_current_buffer undefined flexx2533 vs flexx254

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 4, 2007, 13:35
Default Description: If you compile O
  #1
Senior Member
 
Jens Klostermann
Join Date: Mar 2009
Posts: 117
Rep Power: 8
jens_klostermann is on a distinguished road
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.
jens_klostermann is offline   Reply With Quote

Old   December 4, 2007, 13:51
Default I built the released OpenFOAM-
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
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.
henry is offline   Reply With Quote

Old   December 5, 2007, 00:43
Default Hello Jens, I built OpenFoa
  #3
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 330
Rep Power: 13
mbeaudoin will become famous soon enough
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
mbeaudoin is offline   Reply With Quote

Old   December 5, 2007, 05:11
Default Hello all, I think the sour
  #4
Senior Member
 
Jens Klostermann
Join Date: Mar 2009
Posts: 117
Rep Power: 8
jens_klostermann is on a distinguished road
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
jens_klostermann is offline   Reply With Quote

Old   December 5, 2007, 06:46
Default Hi Jens, The error is due t
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
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.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 7, 2007, 08:03
Default Hi Hrv, If I do as suggeste
  #6
Senior Member
 
Jens Klostermann
Join Date: Mar 2009
Posts: 117
Rep Power: 8
jens_klostermann is on a distinguished road
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
jens_klostermann is offline   Reply With Quote

Old   February 27, 2008, 03:51
Default I do as suggested: 1. cd $
  #7
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: South Bend, IN, USA
Posts: 688
Blog Entries: 9
Rep Power: 12
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
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).
__________________
~
Daniel WEI
-------------
NatHaz Modeling Laboratory
Department of Civil & Environmental Engineering & Earth Sciences
University of Notre Dame, USA
Email || My Personal CFD Blog
lakeat is offline   Reply With Quote

Old   February 27, 2008, 03:53
Default I do as suggested: 1. cd $
  #8
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: South Bend, IN, USA
Posts: 688
Blog Entries: 9
Rep Power: 12
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
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).
__________________
~
Daniel WEI
-------------
NatHaz Modeling Laboratory
Department of Civil & Environmental Engineering & Earth Sciences
University of Notre Dame, USA
Email || My Personal CFD Blog
lakeat is offline   Reply With Quote

Old   April 1, 2008, 10:41
Default I had a similar error with com
  #9
Member
 
David P. Schmidt
Join Date: Mar 2009
Posts: 70
Rep Power: 8
schmidt_d is on a distinguished road
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
schmidt_d is offline   Reply With Quote

Old   April 10, 2008, 09:58
Default flex-2.5.35 works for me flex
  #10
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
flex-2.5.35 works for me
flex-2.5.33 does not.
niklas is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference mateusz_slowikowski OpenFOAM Running, Solving & CFD 7 February 27, 2015 15:35
Undefined reference to %60mainb seang OpenFOAM Installation 8 February 1, 2014 14:48
Undefined reference mateusz_slowikowski OpenFOAM Running, Solving & CFD 3 March 11, 2008 13:19
undefined symbol Dario Nexus FLUENT 0 October 12, 2006 07:54
GmshToFoam undefined faces derath Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 22, 2006 04:54


All times are GMT -4. The time now is 23:25.