CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OpenFOAM v2.0.0 installation error on Redhat 5 (https://www.cfd-online.com/Forums/openfoam-installation/90560-openfoam-v2-0-0-installation-error-redhat-5-a.html)

firelet July 13, 2011 21:27

OpenFOAM v2.0.0 installation error on Redhat 5
 
Today I install OpenFOAM v2.0.0 on Redhat Enterprise 5.0, there are some error as follows,

triSurface/interfaces/STL/readSTLASCII.L:59:25: error: no 'int yyFlexLexer::yywrap()' member function declared in class 'yyFlexLexer'
Make/linux64GccDPOpt/readSTLASCII.C: In member function 'int STLLexer::lex()':
Make/linux64GccDPOpt/readSTLASCII.C:5526:10: error: 'yy_buffer_stack' was not declared in this scope
Make/linux64GccDPOpt/readSTLASCII.C:5526:10: error: 'yy_buffer_stack_top' was not declared in this scope
Make/linux64GccDPOpt/readSTLASCII.C:5527:27: error: 'yyensure_buffer_stack' was not declared in this scope
Make/linux64GccDPOpt/readSTLASCII.C:5549:57: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5549:57: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5565:3: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5779:62: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5785:8: error: 'yy_buffer_stack' was not declared in this scope

How to solve this problem?:confused:
Thank you

olesen July 14, 2011 02:30

Quote:

Originally Posted by firelet (Post 316056)
Today I install OpenFOAM v2.0.0 on Redhat Enterprise 5.0, there are some error as follows,

triSurface/interfaces/STL/readSTLASCII.L:59:25: error: no 'int yyFlexLexer::yywrap()' member function declared in class 'yyFlexLexer'
Make/linux64GccDPOpt/readSTLASCII.C: In member function 'int STLLexer::lex()':
Make/linux64GccDPOpt/readSTLASCII.C:5526:10: error: 'yy_buffer_stack' was not declared in this scope
Make/linux64GccDPOpt/readSTLASCII.C:5526:10: error: 'yy_buffer_stack_top' was not declared in this scope
Make/linux64GccDPOpt/readSTLASCII.C:5527:27: error: 'yyensure_buffer_stack' was not declared in this scope
Make/linux64GccDPOpt/readSTLASCII.C:5549:57: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5549:57: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5565:3: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5779:62: warning: use of old-style cast
Make/linux64GccDPOpt/readSTLASCII.C:5785:8: error: 'yy_buffer_stack' was not declared in this scope

How to solve this problem?:confused:
Thank you

You may need to upgrade flex on your machine and see if that helps. I remember some RH5 systems having flex 2.5.4.a installed. But this version was released in 1997! Check with "flex --version" or "rpm -qi flex" to see what you have. Also see http://flex.sourceforge.net/ for more information.

firelet July 14, 2011 03:01

Quote:

Originally Posted by olesen (Post 316067)
You may need to upgrade flex on your machine and see if that helps. I remember some RH5 systems having flex 2.5.4.a installed. But this version was released in 1997! Check with "flex --version" or "rpm -qi flex" to see what you have. Also see http://flex.sourceforge.net/ for more information.


Thank you for your reply.

I have installed the latest flex version 2.5.35, but the problem also exist. :confused:

olesen July 14, 2011 03:24

Quote:

Originally Posted by firelet (Post 316070)
Thank you for your reply.

I have installed the latest flex version 2.5.35, but the problem also exist. :confused:

OK, you have the newest version, but did you also either retouch the *.L file (to force a remake), or wclean the directory first. Otherwise you'll still be using the C++ code generated with the older flex.

firelet July 15, 2011 07:58

Quote:

Originally Posted by olesen (Post 316072)
OK, you have the newest version, but did you also either retouch the *.L file (to force a remake), or wclean the directory first. Otherwise you'll still be using the C++ code generated with the older flex.

Thank you~~~

The problem is solved. I figured out the resson. Gcc can't find the include directory of flex. To add the flex include path to the file "$HOME/.bashrc", such as:

export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$FLEX_INS/include

$FLEX_INS is the directory where flex install

Regards
firelet

pfhan July 21, 2011 07:42

Quote:

Originally Posted by firelet (Post 316242)
Thank you~~~

The problem is solved. I figured out the resson. Gcc can't find the include directory of flex. To add the flex include path to the file "$HOME/.bashrc", such as:

export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$FLEX_INS/include

$FLEX_INS is the directory where flex install

Regards
firelet

Thank you and dear Olesen! My problem is solved, too.

skynet4ever July 30, 2011 06:51

Linker error in RHEL 5
 
1 Attachment(s)
Hi all,

I also have problems installing OF2.0.0 on RHEL 5. I get the famous linker error and some other stuff. I think it maybe is an openmp problem but I tried so much different settings already - I am out of ideas now.

I have done already:
Downloaded+extracted OF+ThirdPraty 2.0.0 and followed the instructions.
changed gcc/g++ to gcc44/g++44 in etc/config/settings.sh
updated flex to 2.5.35

I am using the system compiler because when I am trying to use the Thirdparty compiler (as suggested in other posts), I get the following warning and I don't know what to to about it:
Code:

...@bapf028dl ~/code/OpenFOAM-2.0.0 >source ~/.bashrc

Warning in /user/mars/.../code/OpenFOAM-2.0.0/etc/config/settings.sh:
    Cannot find /user/mars/.../code/ThirdParty-2.0.0/platforms/linux64/gcc-4.4.3 installation.
    Please install this compiler version or if you wish to use the system compiler,
    change the 'foamCompiler' setting to 'system'

The native compiler is 4.1.2 and the gcc44 is 4.4.4

I appended the make.log and my current bashrc+settings.sh and am now hoping for your ideas.
Thank you very much in advance.

Max

alberto July 31, 2011 03:04

There is centfoam for RHEL 5.x and CentOS: http://sourceforge.net/apps/mediawik...itle=Main_Page

skynet4ever July 31, 2011 04:16

Quote:

Originally Posted by alberto (Post 318182)
There is centfoam for RHEL 5.x and CentOS: http://sourceforge.net/apps/mediawik...itle=Main_Page

Yes I heard about it - but somehow I thought they were stuck at OF1.7 which seems not to be true anymore. Anyway as this installation needs root permissions and my admin is not very cooperative I prefer to try it on my own first. Besides, I found a lot of posts where people managed to compile it on this system - so it seams possible.

Thanks for your reply.
Max

wyldckat July 31, 2011 04:39

Greetings to all!

Max, here are the questions I've got for you:
  • Where is your gcc 4.4.4 located?
    If it's located at the ThirdParty folder, then edit settings.sh once again and jump to this section of code:
    Code:

    case "${foamCompiler}" in
    OpenFOAM | ThirdParty)
        case "$WM_COMPILER" in
        Gcc | Gcc++0x)
            gcc_version=gcc-4.4.3
            gmp_version=gmp-5.0.1
            mpfr_version=mpfr-2.4.2
            ;;

    In bold is what you need to change, i.e. the version number. If you scroll down a bit further, you'll find this code:
    Code:

            gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
            gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
            mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
            mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version

    This is where settings.sh expects that gcc and company will be at.

    On the other hand, if gcc44 is already provided outside of OpenFOAM and it's visible simply by running gcc44, then go to bashrc and switch foamCompiler back to system.
  • As for flex, do you already have the latest one, namely flex 2.5.35? Is it already visible from the command line when you run:
    Code:

    flex -V
Best regards,
Bruno

skynet4ever July 31, 2011 06:54

Hi Bruno,
yes flex,gcc44 are visible from everywhere in the comandline. (Can there be a problem because I am using bash, which is not my loginshell?)
Code:


...@bapf028dl ~/code/OpenFOAM-2.0.0 >gcc44 --version
gcc44 (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

...@bapf028dl ~/code/OpenFOAM-2.0.0 >flex --version
flex 2.5.35
...@bapf028dl ~/code/OpenFOAM-2.0.0 >which gcc44
/usr/bin/gcc44

what baffles me is this error
Code:

blockMesh/blockMeshMerge.C:120: error: call of overloaded 'boundBox(Foam::pointField)' is ambiguous
and the fact that i still see so many calls to g++ instead of g++44. can it be that setting the compiler in settings.sh is not enough? And I also have to set it somewhere else. I already tried to work with alias (from g++ to g++44) but that didn't help either. In the configuration phase wmake shows the use of gcc44 alright...

Thank you for your help.
Max

pfhan July 31, 2011 07:34

1 Attachment(s)
Quote:

Originally Posted by skynet4ever (Post 318185)
Yes I heard about it - but somehow I thought they were stuck at OF1.7 which seems not to be true anymore. Anyway as this installation needs root permissions and my admin is not very cooperative I prefer to try it on my own first. Besides, I found a lot of posts where people managed to compile it on this system - so it seams possible.

Thanks for your reply.
Max

Here is my installation procedure, hoping that it would be useful.
I am a newbie on linux OS and i don't know what to do, so I added all the
software lib path to PATH just in case for problems.
Noting --prefix won't work on all the gcc4.4.6files,so if you don't have root permissions, use -with-local-prefix to specify your own path.


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