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.org] [MacOSX] 10.10.5 Yosemite, OpenFOAM-2.3.x: "Symbol not found: *FlexLexer*" (https://www.cfd-online.com/Forums/openfoam-installation/166655-macosx-10-10-5-yosemite-openfoam-2-3-x-symbol-not-found-flexlexer.html)

edjonathan February 14, 2016 09:06

[MacOSX] 10.10.5 Yosemite, OpenFOAM-2.3.x: "Symbol not found: *FlexLexer*"
 
Hi all,

I have MacOsx 10.10.5 Yosemite
I am trying to install OpenFOAM-2.3.x on my macbook.
I have followed step-by-step guide given here:http://openfoamwiki.net/index.php/In...OpenFOAM_2.3.x

Installation seems is over.

I go to : OpenFOAM/OpenFOAM-2.3.x/tutorials/incompressible/icoFoam/cavity

then run: blockMesh

and I get this result:
$ blockMesh
dyld: Symbol not found: __ZN11yyFlexLexer6yywrapEv
Referenced from: /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Expected in: flat namespace
in /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Trace/BPT trap: 5

What could has gone wrong here? I have no clue..
any one can help in this?
Thank you so much.

edjonathan February 15, 2016 09:37

Any help will be much appreciated? ...

Quote:

Originally Posted by edjonathan (Post 585115)
Hi all,

I have MacOsx 10.10.5 Yosemite
I am trying to install OpenFOAM-2.3.x on my macbook.
I have followed step-by-step guide given here:http://openfoamwiki.net/index.php/In...OpenFOAM_2.3.x

Installation seems is over.

I go to : OpenFOAM/OpenFOAM-2.3.x/tutorials/incompressible/icoFoam/cavity

then run: blockMesh

and I get this result:
$ blockMesh
dyld: Symbol not found: __ZN11yyFlexLexer6yywrapEv
Referenced from: /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Expected in: flat namespace
in /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Trace/BPT trap: 5

What could has gone wrong here? I have no clue..
any one can help in this?
Thank you so much.


bigphil February 16, 2016 12:46

Quote:

Originally Posted by edjonathan (Post 585260)
Any help will be much appreciated? ...

Hi,

This appears to be a problem with the system version of flex (even though you have installed flex using Macports).

This post suggests to move/rename the system flex:
Code:

sudo mv /usr/bin/flex /usr/bin/flex_xcode
But note that you must disable System Integrity Protection (SIP - a new feature of El Capitan) to be able to modify items in /usr/bin.
Details of disabling SIP are given here, but in short are:
  • reboot
  • as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
  • Open Utilities->Terminal
  • Run the command:
    Code:

    csrutil disable
  • Reboot, you'll land in the normal OS with SIP disabled, open the terminal and
  • run the command:
    Code:

    sudo mv /usr/bin/flex /usr/bin/flex_xcode
  • Reboot again
  • as soon as you hear the "Mac sound" on the grey screen, press Cmd+R to enter Recovery mode
  • Enable SIP with:
    Code:

    csrutil enable
  • Reboot again
  • done

After moving the system flex you may have to recompile, but try running blockMesh first anyway to see if it works.

Let me know if it works for you,

Philip

edjonathan February 16, 2016 13:06

Thank you very much for the comments.
A quick questions: Is SIP also a feature of Yosemite. I have MacOsx 10.10.5 Yosemite.
Do I still need to do disable SIP?

bigphil February 16, 2016 13:12

Quote:

Originally Posted by edjonathan (Post 585498)
Thank you very much for the comments.
A quick questions: Is SIP also a feature of Yosemite. I have MacOsx 10.10.5 Yosemite.
Do I still need to do disable SIP?

Good question; a quick way to check is to try rename the flex while logged in as normal; if you can do it then SIP is not active.
So open a terminal and run:
Code:

sudo mv /usr/bin/flex /usr/bin/flex_xcode
When I try it, I get the following:
Code:

dhcp-892b95d9:~ philipc$ sudo mv /usr/bin/flex /usr/bin/flex_xcode
Password:
mv: rename /usr/bin/flex to /usr/bin/flex_xcode: Operation not permitted

If it works for you then you don't need to disable and re-enable SIP.

Philip

edjonathan February 16, 2016 13:18

Ok, so I could rename the flex.
But running the blockMesh lands me in the same error again.
Guess I have to recompile "./Allwmake" again..is it?

Thanks.
Jonathan

bigphil February 16, 2016 13:19

Quote:

Originally Posted by edjonathan (Post 585505)
Ok, so I could rename the flex.
But running the blockMesh lands me in the same error again.
Guess I have to recompile "./Allwmake" again..is it?

Thanks.
Jonathan

Yep, "./Allwmake" again.

Philip

edjonathan February 16, 2016 13:47

Unfortunately I still get the same error.
While running "./Allwmake" One recurring set of errors I get are the following:


make[2]: *** No rule to make target `darwinIntel64DPOpt/options'. Stop.
wmake error: file 'Make/darwinIntel64DPOpt/objectFiles' could not be created in /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/applications/solvers/multiphase/twoPhaseEulerFoam
make[1]: *** [twoPhaseEulerFoam] Error 1
make[1]: Target `application' not remade because of errors.
make: *** [multiphase] Error 2
make: Target `application' not remade because of errors.



thanks.
Jonathan

bigphil February 16, 2016 13:53

Quote:

Originally Posted by edjonathan (Post 585511)
Unfortunately I still get the same error.
While running "./Allwmake" One recurring set of errors I get are the following:


make[2]: *** No rule to make target `darwinIntel64DPOpt/options'. Stop.
wmake error: file 'Make/darwinIntel64DPOpt/objectFiles' could not be created in /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/applications/solvers/multiphase/twoPhaseEulerFoam
make[1]: *** [twoPhaseEulerFoam] Error 1
make[1]: Target `application' not remade because of errors.
make: *** [multiphase] Error 2
make: Target `application' not remade because of errors.



thanks.
Jonathan

Try clean and remake the applications, for example try blockMesh:
Code:

cd $FOAM_UTILITIES/mesh/generation/blockMesh
wclean
wmake

And then try run blockMesh.

Philip

edjonathan February 17, 2016 08:09

Sorry for delay in coming back, I tried installing the whole OpenFoam2.3.x again on my mac.

This time the change regarding "flex_xcode" already in place.
But still when I run "blockMesh" in cavity folder, I get the same error:

dyld: Symbol not found: __ZN11yyFlexLexer6yywrapEv
Referenced from: /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Expected in: flat namespace
in /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Trace/BPT trap: 5


Please any help is appreciated much?

Thanks a lot,
Jonathan


P.S: Did I need to reboot my Mac after I made that change of "flex_xcode" ?

bigphil February 17, 2016 15:50

Quote:

Originally Posted by edjonathan (Post 585672)
Sorry for delay in coming back, I tried installing the whole OpenFoam2.3.x again on my mac.

This time the change regarding "flex_xcode" already in place.
But still when I run "blockMesh" in cavity folder, I get the same error:

dyld: Symbol not found: __ZN11yyFlexLexer6yywrapEv
Referenced from: /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Expected in: flat namespace
in /Users/l-jodawson/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64ClangDPOpt/lib/libsurfMesh.dylib
Trace/BPT trap: 5


Please any help is appreciated much?

Thanks a lot,
Jonathan


P.S: Did I need to reboot my Mac after I made that change of "flex_xcode" ?

Hi Jonathan,

Hmnn I thought that would work.
You could try using the flex in ThirdParty but I'm not sure if it will definitely fix it; you would do the following:

copy prefs.sh file (if you haven't already done so):
Code:

cp $WM_PROJECT_DIR/etc/prefs.sh-EXAMPLE $WM_PROJECT_DIR/etc/prefs.sh
Then uncomment (remove the leading hash symbol) the following line in $WM_PROJECT_DIR/etc/prefs.sh:
Code:

#export WM_THIRD_PARTY_USE_FLEX_2535=1
Then open a new terminal and recompile foam with ./Allwmake.firstInstall

Philip

edjonathan February 17, 2016 16:09

Hi Philip,

Thanks.

I don't have a ThirdParty folder.
I followed the installation steps from:https://openfoamwiki.net/index.php/I...OpenFOAM_2.3.x

As suggested there, I had installed all the ports from MacPorts.

Just now following your suggestion I also looked into the "prefs.sh" file, actually located in "/Users/ljodawson/OpenFOAM/OpenFOAM_2.3.x/etc/config/example/", and I didn't find the line you mentioned (i.e export WM_THIRD_PARTY_USE_FLEX_2535=1).

Jonathan

bigphil February 17, 2016 16:12

Quote:

Originally Posted by edjonathan (Post 585749)
Hi Philip,

Thanks.

I don't have a ThirdParty folder.
I followed the installation steps from:https://openfoamwiki.net/index.php/I...OpenFOAM_2.3.x

As suggested there, I had installed all the ports from MacPorts.

Just now following your suggestion I also looked into the "prefs.sh" file, actually located in "/Users/ljodawson/OpenFOAM/OpenFOAM_2.3.x/etc/config/example/", and I didn't find the line you mentioned (i.e export WM_THIRD_PARTY_USE_FLEX_2535=1).

Jonathan

Sorry, I was thinking of foam extend.
I'm not quite sure where/if you can specify to use flex from the ThirdParty folder for OpenFOAM-2.3.x, and if it will help.

Philip

bigphil February 23, 2016 06:12

Quote:

Originally Posted by bigphil (Post 585750)
Sorry, I was thinking of foam extend.
I'm not quite sure where/if you can specify to use flex from the ThirdParty folder for OpenFOAM-2.3.x, and if it will help.

Philip

Hi Jonathan,

It won't help you but for those who have this problem with foam-extend-3.2, the solution is to use the 3rd party version of flex instead of system or macports:

Copy the prefs.sh-EXAMPLE file to prefs.sh
Code:

cd $WM_PROJECT_DIR/etc
cp prefs.sh-EXAMPLE prefs.sh

Open the "foam-extend-3.2/etc/prefs.sh” file with a text editor and find and replace this line:
Code:

#export WM_THIRD_PARTY_USE_FLEX_2535=1
with this line:
Code:

export WM_THIRD_PARTY_USE_FLEX_2535=1
Then open a new terminal and compile all of foam:
foam
Code:

./Allwmake.firstInstall
Note: if you have previously unsuccessfully compiled then you may need to clean the some of the library (e.g. wclean lib $FOAM_SRC/meshTools).


Jonathan, for OpenFOAM-2.3.x, I believe the error is related to using the correct version of flex and making sure settings/environment variables are consistent.

Philip

bigphil September 27, 2016 13:15

FYI

http://www.cfd-online.com/Forums/ope...tml#post595275


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