CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [Other] Installation issues with flex 2.6.0 and inelegant solution (https://www.cfd-online.com/Forums/openfoam-installation/164682-installation-issues-flex-2-6-0-inelegant-solution.html)

windscion December 29, 2015 13:58

Installation issues with flex 2.6.0 and inelegant solution
 
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.

GerhardHolzinger January 18, 2016 14:18

Quote:

Originally Posted by windscion (Post 578983)
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


All times are GMT -4. The time now is 10:50.