|
[Sponsors] |
[OpenFOAM.org] Installing OpenFOAM 3.0.x on Mac OS X with Homebrew |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 11, 2015, 13:05 |
Installing OpenFOAM 3.0.x on Mac OS X with Homebrew
|
#1 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Hi Alexey!
I am trying to compile OpenFOAM-3.0.0 following your guidelines and your newly posted patch for OF3.0.0 on your repository https://github.com/mrklein/openfoam-os-x. I tried both with macports and homebrew, and I managed to compile it both without any bad issues. However when I run the cavity case I always have this issue: Code:
Starting time loop Time = 0.005 Courant Number mean: 0 max: 0 smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 8.90511e-06, No Iterations 19 smoothSolver: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for p, Initial residual = 1, Final residual = 7.55423e-07, No Iterations 35 time step continuity errors : sum local = 5.03808e-09, global = -7.94093e-21, cumulative = -7.94093e-21 DICPCG: Solving for p, Initial residual = 0.523588, Final residual = 9.72371e-07, No Iterations 34 time step continuity errors : sum local = 1.07766e-08, global = 2.00426e-19, cumulative = 1.92485e-19 dyld: lazy symbol binding failed: Symbol not found: __ZN4FoamlsERNS_7OstreamEl Referenced from: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/icoFoam Expected in: flat namespace dyld: Symbol not found: __ZN4FoamlsERNS_7OstreamEl Referenced from: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/icoFoam Expected in: flat namespace Trace/BPT trap: 5 Any response is highly appreciated! Oleg |
|
November 11, 2015, 16:00 |
|
#2 |
Senior Member
|
Hi,
Unfortunately I can not reproduce the error, so could you please post: 1. Output of "sw_vers" 2. Output of "clang++ --version" 3. Output of "export | grep -E '(FOAM_|WM_|LD_)'" (after you source OpenFOAM's bashrc) And I also do not create disk image every time new version is released. @wyldckat Dear Bruno, Could you please move the post to separate thread as currently is has nothing to do with version 2.3. [Moderator note: Done. Moved posts for OpenFOAM 3.0.x from the other thread http://www.cfd-online.com/Forums/ope...-patch-12.html] Last edited by wyldckat; February 7, 2016 at 16:02. Reason: see "Moderator note:" |
|
November 11, 2015, 16:07 |
|
#3 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Hi, Alexey,
Thank you for a quick reply! Code:
MacBook-Air-Oleg:cavity oleg$ sw_vers ProductName: Mac OS X ProductVersion: 10.11.1 BuildVersion: 15B42 MacBook-Air-Oleg:cavity oleg$ clang++ --version Apple LLVM version 7.0.0 (clang-700.1.76) Target: x86_64-apple-darwin15.0.0 Thread model: posix MacBook-Air-Oleg:cavity oleg$ source ~/OpenFOAM/OpenFOAM-3.0.x/etc/bashrc MacBook-Air-Oleg:cavity oleg$ export | grep -E '(FOAM_|WM_|LD_)' declare -x DYLD_LIBRARY_PATH="/usr/local/opt/boost/lib:/usr/local/opt/cgal/lib:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/openmpi-system:/openmpi-system:/usr/local/lib:/Users/oleg/OpenFOAM/oleg-3.0.x/platforms/darwin64ClangDPInt32Opt/lib:/Users/oleg/OpenFOAM/site/3.0.x/platforms/darwin64ClangDPInt32Opt/lib:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/dummy:/openmpi-system" declare -x FOAM_APP="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/applications" declare -x FOAM_APPBIN="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin" declare -x FOAM_ETC="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/etc" declare -x FOAM_INST_DIR="/Users/oleg/OpenFOAM" declare -x FOAM_JOB_DIR="/Users/oleg/OpenFOAM/jobControl" declare -x FOAM_LIBBIN="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib" declare -x FOAM_MPI="openmpi-system" declare -x FOAM_RUN="/Users/oleg/OpenFOAM/oleg-3.0.x/run" declare -x FOAM_SETTINGS="" declare -x FOAM_SIGFPE="" declare -x FOAM_SITE_APPBIN="/Users/oleg/OpenFOAM/site/3.0.x/platforms/darwin64ClangDPInt32Opt/bin" declare -x FOAM_SITE_LIBBIN="/Users/oleg/OpenFOAM/site/3.0.x/platforms/darwin64ClangDPInt32Opt/lib" declare -x FOAM_SOLVERS="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/applications/solvers" declare -x FOAM_SRC="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/src" declare -x FOAM_TUTORIALS="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/tutorials" declare -x FOAM_USER_APPBIN="/Users/oleg/OpenFOAM/oleg-3.0.x/platforms/darwin64ClangDPInt32Opt/bin" declare -x FOAM_USER_LIBBIN="/Users/oleg/OpenFOAM/oleg-3.0.x/platforms/darwin64ClangDPInt32Opt/lib" declare -x FOAM_UTILITIES="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/applications/utilities" declare -x LD_LIBRARY_PATH="/usr/local/opt/boost/lib:/usr/local/opt/cgal/lib:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/openmpi-system:/openmpi-system:/usr/local/lib:/Users/oleg/OpenFOAM/oleg-3.0.x/platforms/darwin64ClangDPInt32Opt/lib:/Users/oleg/OpenFOAM/site/3.0.x/platforms/darwin64ClangDPInt32Opt/lib:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/dummy:/openmpi-system" declare -x WM_ARCH="darwin64" declare -x WM_ARCH_OPTION="64" declare -x WM_CC="clang" declare -x WM_COMPILER="Clang" declare -x WM_COMPILER_LIB_ARCH="64" declare -x WM_COMPILE_OPTION="Opt" declare -x WM_CXX="clang++" declare -x WM_DIR="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/wmake" declare -x WM_LABEL_OPTION="Int32" declare -x WM_LABEL_SIZE="32" declare -x WM_LINK_LANGUAGE="c++" declare -x WM_MPLIB="SYSTEMOPENMPI" declare -x WM_OPTIONS="darwin64ClangDPInt32Opt" declare -x WM_OSTYPE="POSIX" declare -x WM_PRECISION_OPTION="DP" declare -x WM_PROJECT="OpenFOAM" declare -x WM_PROJECT_DIR="/Users/oleg/OpenFOAM/OpenFOAM-3.0.x" declare -x WM_PROJECT_INST_DIR="/Users/oleg/OpenFOAM" declare -x WM_PROJECT_USER_DIR="/Users/oleg/OpenFOAM/oleg-3.0.x" declare -x WM_PROJECT_VERSION="3.0.x" |
|
November 11, 2015, 18:04 |
|
#4 |
Senior Member
|
Hi,
Unfortunately I still can not reproduce your problem even after building 3.0.x (previously I tested on 3.0.0). Could you please also post output of Code:
$ echo $PATH $ icoFoam -version |
|
November 12, 2015, 04:25 |
|
#5 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Hi,
Yes, that looks strange, since I never saw anyone had had the same error. Basically, I've checked before that there were no interaction between my previous installed version. Code:
$ echo $PATH /Users/oleg/OpenFOAM/oleg-3.0.x/platforms/darwin64ClangDPInt32Opt/bin:/Users/oleg/OpenFOAM/site/3.0.x/platforms/darwin64ClangDPInt32Opt/bin:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/bin:/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/wmake:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin:/Users/oleg/Qt/5.4/clang_64/bin:/Users/oleg/Qt_Tests/bin Code:
icoFoam -version Code:
... Using: OpenFOAM-3.0.x (see www.OpenFOAM.org) Build: 3.0.x-fddd87acfd83 --> FOAM FATAL ERROR: Invalid option: -version FOAM exiting Code:
MacBook-Air-Oleg:cavity oleg$ which icoFoam /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/icoFoam |
|
November 12, 2015, 04:37 |
|
#6 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
I think, I got, what was wrong.
It looks like that OpenFOAM wants to link libraries, that end with .so and not with .dylib, because executing pimpleDyMFoam in movingCone tutorial, I had following issue: Code:
Create time Create mesh for time = 0 Selecting dynamicFvMesh dynamicMotionSolverFvMesh Selecting motion solver: velocityComponentLaplacian --> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1183 dlopen error : dlopen(libfvMotionSolvers.so, 9): image not found --> FOAM Warning : From function dlLibraryTable::open(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "libfvMotionSolvers.so" --> FOAM Warning : From function dlLibraryTable::open(const dictionary&, const word&, const TablePtr&) in file /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/src/OpenFOAM/lnInclude/dlLibraryTableTemplates.C at line 67 Could not open library "libfvMotionSolvers.so" --> FOAM FATAL ERROR: solver table is empty From function motionSolver::New(const polyMesh& mesh) in file motionSolver/motionSolver/motionSolver.C at line 116. FOAM exiting So, it looks like the patch was not applied properly. But I don't know why.. |
|
November 12, 2015, 04:59 |
|
#7 |
Senior Member
|
Well, not quite so. Patch does nothing to tutorials, so all dynamic library names, like one in dynamicMeshDict of movingCone tutorial
Code:
motionSolverLibs ( "libfvMotionSolvers.so" ); Code:
motionSolverLibs ( "libfvMotionSolvers.dylib" ); Code:
functionObjectLibs ("libsampling.dylib"); I am still trying to understand what can go wrong, since even emptying LD_LIBRARY_PATH variables and renaming of OpenFOAM folder (two things that come to mind first) did not break anything. Does the error happen just with icoFoam (it seems blockMesh does its job)? |
|
November 12, 2015, 05:08 |
|
#8 |
Senior Member
|
A little bit more diagnostics, could you also post output of:
Code:
$ otool -L $(which icoFoam) |
|
November 12, 2015, 11:51 |
|
#9 | |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Quote:
Code:
Does the error happen just with icoFoam (it seems blockMesh does its job)? pimpleDyMFoam for movingCone tutorial: Code:
Courant Number mean: 0 max: 0 Time = 5e-06 DICPCG: Solving for cellMotionUx, Initial residual = 1, Final residual = 7.49026e-09, No Iterations 41 GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.0120425, No Iterations 9 time step continuity errors : sum local = 1.21024e-05, global = -1.93129e-06, cumulative = -1.93129e-06 PIMPLE: iteration 1 smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.00518207, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.00630599, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.130994, Final residual = 0.000745908, No Iterations 1 GAMG: Solving for p, Initial residual = 1, Final residual = 0.0045295, No Iterations 11 time step continuity errors : sum local = 4.56003e-06, global = -7.17971e-07, cumulative = -2.64927e-06 PIMPLE: iteration 2 smoothSolver: Solving for Ux, Initial residual = 0.0285794, Final residual = 1.34937e-06, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.0214531, Final residual = 2.63463e-06, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 0.0175449, Final residual = 5.14228e-07, No Iterations 2 GAMG: Solving for p, Initial residual = 0.00717312, Final residual = 4.74127e-07, No Iterations 15 time step continuity errors : sum local = 5.50739e-08, global = 7.35885e-09, cumulative = -2.64191e-06 dyld: lazy symbol binding failed: Symbol not found: __ZN4FoamlsERNS_7OstreamEl Referenced from: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/pimpleDyMFoam Expected in: flat namespace dyld: Symbol not found: __ZN4FoamlsERNS_7OstreamEl Referenced from: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/pimpleDyMFoam Expected in: flat namespace Trace/BPT trap: 5 Code:
$ otool -L $(which icoFoam) /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/bin/icoFoam: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/libfiniteVolume.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/libmeshTools.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/libOpenFOAM.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0) Code:
... U __ZN4FoamlsERNS_7OstreamEb U __ZN4FoamlsERNS_7OstreamEc U __ZN4FoamlsERNS_7OstreamEd U __ZN4FoamlsERNS_7OstreamEi U __ZN4FoamlsERNS_7OstreamEj ... |
||
November 12, 2015, 12:08 |
|
#10 |
Senior Member
|
The symbol is in
Code:
alexey at daphne in lib$ nm libOpenFOAM.dylib | grep 7OstreamEl 00000000000381d0 T __ZN4FoamlsERNS_7OstreamEl Code:
libs ("libOpenFOAM.dylib"); |
|
November 12, 2015, 13:10 |
|
#11 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
I don't have this symbol in libOpenFOAM.dylib ...
Code:
What if you force loading of libOpenFOAM.dylib in controlDict with Code: libs ("libOpenFOAM.dylib"); ? I think, it is smth bad with my libOpenFOAM.dylib compiled on my machine. Could you send me, please, your libOpenFOAM.dylib? Since you have the same os x version and other soft as mine, it could work with your build, if the problem is with this lib. |
|
November 12, 2015, 15:52 |
|
#12 |
Senior Member
|
You can try to download it here: https://github.com/mrklein/openfoam-...OpenFOAM.dylib (it is built for WM_LABEL_SIZE=32)
|
|
November 12, 2015, 18:19 |
|
#13 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Well, that worked!
Apparently, the thing was in libOpenFOAM.dylib. Now both icoFoam and pimpleDyMFoam work as they should, though your libOpenFOAM was built with your local dependencies. However, if I execute any Allrun script for tutorials, it sais, that it can't find libraries, on which libOpenFOAM is dependent: Code:
MacBook-Air-Oleg:oscillatingInletACMI2D oleg$ cat log.blockMesh dyld: Library not loaded: /Users/alexey/OpenFOAM/OpenFOAM-3.0.0/platforms/darwin64ClangDPInt32Opt/lib/dummy/libPstream.dylib Referenced from: /Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32Opt/lib/libOpenFOAM.dylib Reason: image not found That is strange for me. |
|
November 13, 2015, 03:37 |
|
#14 |
Senior Member
|
What if you try to relink your libOpenFOAM.dylib? I.e. remove it from platforms/darwin64ClangDPInt32Opt/lib and rerun Allwmake (or just run wmake in src/OpenFOAM)?
I was thinking about possible differences between our OS installations and can only come up with 1. I have developer mode switched on (DevToolsSecurity -enable), though since you have Qt installed, guess on your laptop it is also on. 2. In El Capitan they introduced System Integrity Protection, so, for example, scripts are run in slightly stripped environment (in particular (DY)LD_LIBRARY_PATH variables are cleared and there were certain difficulties with dynamic libraries). Did you check Allwmake output? Was there any errors/warnings? Maybe you have log-file of build process? |
|
November 13, 2015, 05:10 |
|
#15 | |||
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Quote:
Quote:
Quote:
I have one warning in my build log, but don't think, it concerns this problem: Code:
$ cat log.Allwmake | grep warning ld: warning: directory not found for option '-L/Users/oleg/OpenFOAM/OpenFOAM-3.0.x/platforms/darwin64ClangDPInt32OptSYSTEMOPENMPI/lib' |
||||
November 13, 2015, 06:49 |
|
#16 | |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Quote:
I executed install_name_tool command like described in this blog http://thecourtsofchaos.com/2013/09/...naries-on-osx/ And now everything seems to work fine. Though I don't like this way to solve the problem If you still have some ideas, I am ready to work them out |
||
November 13, 2015, 10:03 |
|
#17 |
Senior Member
|
I have tried to reproduce the problem starting from scratch: created new user, created new disk image, etc., etc. To exclude influence of current environment setup on build process. I was again unsuccessful. Solvers are running, _ZN4FoamlsERNS_7OstreamEl is on libOpenFOAM.dylib.
Then I vaguely recalled (or it was Macport's ElCapitanProblems page that created these memories) that maybe after the upgrade to El Capitan I have repeated sequence: Code:
$ xcode-setect --install $ xcodebuild -license Though maybe you have already done this. During weekend I could try to utilize another virgin El Capitan laptop to reproduce your problem. |
|
November 13, 2015, 16:27 |
|
#18 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Thank you Alexey, I really appreciate your help.
Indeed, I didn't install command line tools after the upgrade. After executing these commands Code:
$ xcode-select --install $ xcodebuild -license Would be nice to know the build experience on the virgin laptop, if it doesn't bother you too much |
|
November 14, 2015, 10:58 |
|
#19 |
Senior Member
|
Hi,
Unfortunately I was not able to reproduce your error neither on my laptop under new user account, nor on the new laptop (well, it was not exactly new, yet I never installed Xcode and OpenFOAM there). 3.0.x with the latest patch builds and runs smoothly. And unfortunately I have run out of ideas what could be wrong. |
|
November 15, 2015, 15:23 |
|
#20 |
New Member
Oleg Kotsur
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
That's all right, thank you, alexey!
I am sure, there is a stupid explanation, because substitution libOpenFOAM.dylib by yours really seems to work. So that is enough for me Еще раз большое спасибо! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology | wyldckat | OpenFOAM | 17 | November 10, 2017 16:54 |
[OpenFOAM.org] Installing OpenFOAM 4.1 on Mac OS Sierra | spitchers | OpenFOAM Installation | 18 | August 11, 2017 11:01 |
[OpenFOAM.org] -bash: fluentMeshToFoam: command not found, after installing OpenFoam 2.3.x on Mac | jundong | OpenFOAM Installation | 1 | July 1, 2015 14:31 |
[swak4Foam] Installing swak4Foam to OpenFOAM in mac | Kaquesang | OpenFOAM Community Contributions | 22 | January 21, 2013 12:51 |
Is it a good idea to use OpenFoam on a Mac (OS 10.7.5) or on Windows7? | bzz77 | OpenFOAM Installation | 4 | November 21, 2012 18:06 |