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

[Other] Installation issues with flex 2.6.0 and inelegant solution

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By windscion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 29, 2015, 14:58
Default Installation issues with flex 2.6.0 and inelegant solution
  #1
New Member
 
Thomas Evans
Join Date: Dec 2015
Posts: 21
Rep Power: 10
windscion is on a distinguished road
Issues are caused by the fact that the pre-processor only checks the subminor version of the flex release.

Do this:

% cd $WM_PROJECT_DIR
% find . -name '*.L' -print

Open all of the above in your fav editor (I use jEdit). Change all instances of
#if YY_FLEX_SUBMINOR_VERSION < 34
to
#if YY_FLEX_SUBMINOR_VERSION < 34 && YY_FLEX_SUBMINOR_VERSION > 0

Your code will (hopefully) now compile.

************************************************** *******

NOTE: THIS IS A HORRIBLE HORRIBLE HACK. Use only if you prefer to keep flex 2.6.0+. A proper check needs to know major, minor and subminor numbers (or whatever they are called). Hopefully the future versions will patch this issue.
atulkjoy likes this.
windscion is offline   Reply With Quote

Old   January 18, 2016, 15:18
Default
  #2
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Quote:
Originally Posted by windscion View Post
Open all of the above in your fav editor (I use jEdit). Change all instances of
#if YY_FLEX_SUBMINOR_VERSION < 34
to
#if YY_FLEX_SUBMINOR_VERSION < 34 && YY_FLEX_SUBMINOR_VERSION > 0

NOTE: THIS IS A HORRIBLE HORRIBLE HACK. Use only if you prefer to keep flex 2.6.0+. A proper check needs to know major, minor and subminor numbers (or whatever they are called). Hopefully the future versions will patch this issue.
The less horrible hack is to check minor and subminor version, just as you suggested.
The check original seems to have been necessary due to a problem with versions 2.5.4 and 2.5.34, see http://www.openfoam.org/mantisbt/view.php?id=224

Code:
#if YY_FLEX_SUBMINOR_VERSION < 34 && YY_FLEX_MINOR_VERSION < 6
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
#endif
{
    return 1;
}
I reported the issue with flex-2.6 (http://www.openfoam.org/mantisbt/view.php?id=1974)
At some point in time, this will affect also non-Arch users, although Ubuntu 16.04 will include flex-2.5.39-8

Last edited by GerhardHolzinger; January 18, 2016 at 15:58. Reason: Added remark on reported issue
GerhardHolzinger is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 16:14.