|
[Sponsors] |
[OpenFOAM.org] Installing OpenFOAM 3.0.x on Mac OS X with Homebrew |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 19, 2015, 16:48 |
|
#41 |
Member
Mattia de\' Michieli Vitturi
Join Date: Mar 2009
Posts: 51
Rep Power: 17 |
||
December 19, 2015, 19:04 |
|
#42 |
Senior Member
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17 |
Hi !
I modified wmake/rules/darwin64Clang/c and "recycled" the settings suggested by Bernhard on a previous patch. Cheers PO |
|
December 20, 2015, 05:50 |
|
#43 |
Senior Member
|
Hi,
Rules from wmake/rules/darwin64Clang/c are used during compilation of C code, for C++ rules from wmake/rules/darwin64Clang/c++ are used. This part of change Code:
-Xlinker -z -Xlinker nodefs So basically it is unknown what helped you with compilation. |
|
December 20, 2015, 10:33 |
|
#44 |
Senior Member
|
Hi,
I have made alternative patch for 3.0.1 - https://raw.githubusercontent.com/mr...AM-3.0.1.patch. wmake rules in this patch do not rely on dynamic_lookup functionality and are more similar to the rules used in earlier versions of patches. I have tested the patch on my laptops, though it seems this does not guarantee anything |
|
December 30, 2015, 13:36 |
|
#45 |
Senior Member
|
@demichie and @o.kotsur:
Just to clarify (and for the future reference), finally by accident I was able to reproduce your error, and a reason for the error is in this part of $FOAM_SRC/OpenFOAM/Make/files: Code:
#if defined(__APPLE__) && defined(__clang__) $(ints)/long/long.C $(ints)/long/longIO.C $(ints)/ulong/ulong.C $(ints)/ulong/ulongIO.C #endif Code:
$ cpp -dM /dev/null | grep -E '(__APPLE__|__clang__)' #define __APPLE__ 1 #define __clang__ 1 Last edited by alexeym; December 30, 2015 at 17:24. |
|
December 30, 2015, 13:46 |
|
#46 |
Member
Mattia de\' Michieli Vitturi
Join Date: Mar 2009
Posts: 51
Rep Power: 17 |
Thank you for your efforts! This is the output on my computer:
cpp -dM /dev/null | grep -E '(__APPLE__|__clang__)' #define __APPLE__ 1 As you see __APPLE__ seems to be defined, but not __clang__. I will try to investigate. Thank you Mattia |
|
December 30, 2015, 19:20 |
|
#47 |
Senior Member
|
Hi,
Surely you can investigate (and maybe find that you have installed cpp from somewhere else), one way to solve the problem is to remove __clang__ condition (since your cpp is from somewhere else), i.e. change above fragment to: Code:
#if defined(__APPLE__) $(ints)/long/long.C $(ints)/long/longIO.C $(ints)/ulong/ulong.C $(ints)/ulong/ulongIO.C #endif Code:
#if defined(darwin64) $(ints)/long/long.C $(ints)/long/longIO.C $(ints)/ulong/ulong.C $(ints)/ulong/ulongIO.C #endif |
|
January 12, 2016, 11:22 |
|
#48 |
Member
Mattia de\' Michieli Vitturi
Join Date: Mar 2009
Posts: 51
Rep Power: 17 |
It worked! Now I finally have 3.0.1 compiled on my Macbook Pro.
Thank you!!! |
|
February 17, 2016, 18:35 |
|
#49 |
New Member
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11 |
I've modified the mrklein 3.0.1 patch for MacPorts installed libraries, but using apple clang for compilation. I am hopeful it should work, but I get this immediate error when trying to build:
Code:
$ ./Allwmake 2>&1 | tee build.log dyld: Symbol not found: _CGLGetCurrentContext Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo xcrun: error: unable to lookup item 'Path' in SDK '/' xcrun cc -arch x86_64 -Wall -O3 -fPIC -isysroot -Wno-unneeded-internal-declaration -Wno-unused-function dirToString.c -o /Users/jstickel/OpenFOAM/OpenFOAM-3.0.1/wmake/platforms/darwin64Clang/dirToString clang: warning: no such sysroot directory: '-Wno-unneeded-internal-declaration' dirToString.c:43:10: fatal error: 'stdio.h' file not found #include <stdio.h> ^ 1 error generated. make: *** [/Users/jstickel/OpenFOAM/OpenFOAM-3.0.1/wmake/platforms/darwin64Clang/dirToString] Error 1 |
|
February 18, 2016, 03:50 |
|
#50 |
Senior Member
|
Hi,
Code:
xcrun cc -arch x86_64 -Wall -O3 -fPIC -isysroot ? Code:
$ xcrun --show-sdk-path $ xcrun cc --version $ make --version |
|
February 18, 2016, 17:00 |
|
#51 | |
New Member
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11 |
Quote:
Code:
$ xcrun --show-sdk-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk $ xcrun cc --version Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin14.5.0 Thread model: posix $ make --version GNU Make 3.81 <snip> Code:
$ xcodebuild -version Xcode 7.2.1 Build version 7C1002 $ source etc/bashrc clang: error: unsupported option '--showme:link' Please download binary Paraview release from http://paraview.org and install it in /Applications folder. $ xcodebuild -version dyld: Symbol not found: _CGLGetCurrentContext Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo Trace/BPT trap: 5 |
||
February 18, 2016, 17:24 |
|
#52 |
Senior Member
|
Hi,
To have more hints, one needs to know what modifications you have made. This part is rather funny: Code:
$ source etc/bashrc clang: error: unsupported option '--showme:link' This Code:
$ xcodebuild -version dyld: Symbol not found: _CGLGetCurrentContext Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo Trace/BPT trap: 5 Again, since you have modified patch I do not have any more comments. I have Xcode 7.2.1 and OpenFOAM compiles smoothly with unmodified patch. |
|
February 18, 2016, 17:53 |
|
#53 | |
New Member
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11 |
Quote:
I've made some progress. Indeed, having "/opt/local/lib" in DYLD_LIBRARY_PATH is causing my xcode symbol error. I'll see if I can figure out why the entire path is being added. What I have changed from your patch is essentially just the modifications of CGAL.sh, metis.sh, and scotch.sh (i.e., the parts that specifically called out "brew"). I'll attach those sections. Regarding your rant, my understanding is that (for the default variant) gcc5 is installed as dependency only to support fortran with mpich (or openmpi); clang is used for the c/c++ parts. It should not cause a problem for openfoam. BTW, previously I did successfully compile openfoam-2.4 with apple clang. Now I am trying to do the same with 3.0. I only mention this as a point of clarification, not to stir the homebrew vs macports waters! |
||
February 19, 2016, 08:14 |
|
#54 |
Senior Member
|
DYLD_LIBRARY_PATH is filled by config/settings.sh and config/CGAL.sh (via _foamAddLib call). Since all your third-party libraries are in /opt/local/lib, it is added there.
In fact, since library paths are compiled into executables: Code:
$ pwd /Users/.../platforms/darwin64ClangDPInt64Opt/bin daphne:bin$ otool -L mapFields mapFields: /Users/.../lib/libsampling.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/.../lib/libmeshTools.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/.../lib/liblagrangian.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/.../lib/libfiniteVolume.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/.../lib/libgenericPatchFields.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/..../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 1226.10.1) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0) Code:
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_LIBBIN/dummy Code:
DYLD_LIBRARY_PATH This is a colon separated list of directories that contain libraries. The dynamic linker searches these directories before it searches the default locations for libraries. It allows you to test new versions of existing libraries. |
|
February 19, 2016, 17:40 |
|
#55 |
Senior Member
|
Additions concerning your patch:
- What if Macports are installed somewhere else (you know, /opt/local is just DEFAULT prefix)? - What if someone does not want CGAL-dependent functionality (even Scotch and METIS are somewhat optional)? |
|
February 19, 2016, 17:42 |
|
#56 | |
New Member
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11 |
Quote:
Anyway, success! I had some problems with macports mpich that went away when I switch to openmpi. I'll post more, including a patch, on the "... 3.0.x with MacPorts" thread. That's probably where this discussion should have been, but I wasn't sure you would be monitoring that thread. Thanks for your help, Alexey. I'd be amenable to upload my patch and add to the wiki on your git repo (but only if you are interested). BTW, I worked from your "alternative" patch for 3.0.1. |
||
February 19, 2016, 17:44 |
|
#57 |
New Member
Jonathan
Join Date: Jan 2015
Posts: 20
Rep Power: 11 |
Sure, what I've done needs improvement, especially for it to apply across multiple use cases. Let's discuss on the the other thread. I'll upload my full patch there shortly.
|
|
|
|
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 |