|
[Sponsors] |
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 7, 2013, 18:57 |
Patches to compile OpenFOAM 2.2 on Mac OS X
|
#1 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Those of you using OpenSource for their CFD-needs, working with a Unix-like operating system but who were tempted by the slick hardware to the dubious corporation with the fruit in the logo may be interested in these patches for the latest version of OpenFOAM that allow compiling it on Mac OS X.
Those who say "How dare you use this fine OpenSource-program on these evil machines" are of course right, I feel ashamed and mumble "But they look so good, they work so fine and as long as it is not in the AppStore Apple will not profit from this" Anyway. To the point. The patch has the same functionality as the last one for 2.1 posted here: http://www.cfd-online.com/Forums/ope...tml#post412411 It is installed in the same way as the 2.1-patch described here: http://openfoamwiki.net/index.php/Ho...enFOAM_v21_Mac One note: the patch is supposed to create some symbolic links in wmake/rules but instead only creates files. So replace the file darwinIntel64Gcc4X (X from {2..8}) with a symbolic link to darwinIntel64Gcc For thirdparty-software I rely on MacPorts. For the compilation I used from MacPorts - OpenMPI - gcc46 (gcc47 doesn't work for me, but your milage may vary) - boost and cgal (these are optional. If found they will be used for surfaceExtractFeatures). Usage of these is new for this patch - ccache (optional but highly recomended) Contents of my ../site/2.2.x/prefs.sh are: Code:
export WM_COMPILER=Gcc46 export WM_SCHEDULER=ccache The only thing used/compiled from the original OpenFOAM-Thirdparty-software currently is scotch/ptscotch (as MacPorts uses an older version here) Have fun and put your MacBooks into brown paper bags when you go outside so that the OpenSource-police won't spot you ThirdParty-2.2_Mac-20130307.patchOpenFOAM-2.2.x_Mac-20130307.patch
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
March 9, 2013, 00:01 |
Patches to compile OpenFOAM 2.2 on Mac OS X
|
#2 |
New Member
Brent Craven
Join Date: Mar 2009
Location: University Park, PA, USA
Posts: 21
Rep Power: 17 |
Thanks, Bernhard!
Two questions for you on this: 1.) In etc/config/settings I see that, if someone has MacPorts installed, you are resetting WM_MPLIB=MACPORTOPENMPI. This caused a hiccup in compiling for me because I have MacPorts installed, but I want to use my SYSTEMOPENMPI installed elsewhere. Perhaps there is a reason for doing this, though? 2.) Did you have any problems compiling scotch in ThirdParty? I cannot get around the following error: ld: library not found for -lrt. I am using Gcc46. Thanks again! Brent |
|
March 9, 2013, 06:05 |
|
#3 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
Looked at the patch and it seems like I forgot to include a include for the Makefile for scotch and therefor the compilation doesn't find out that this is a Mac (I thought scotch now supports the Mac out of the box, but it seems that I applied the 2.1-patch and forgot about that one file) Will upload modified patches ASAP
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|||
March 9, 2013, 07:23 |
|
#4 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Here they come:
ThirdParty-2.2_Mac-20130309.patchOpenFOAM-2.2.x_Mac-20130309.patch The Third-Party-Patch now creates etc/wmakeFiles/scotch/Makefile.inc.i686_mac_darwin.shlib-OpenFOAM that is needed for scotch to compile correctly. The other patch now adds two things if your setup differs from mine (if you don't use Macports for everything): - if macports is not found it tells you so and which file to modify for your setup. It would be nice if people provided me with their modification. Then I can add them to the patch - if MacPorts is used but no openmpi is found in MacPorts it defaults to OPENMPI and prints a variable that can be used to modify that behaviour. Note: the thirdparty-patch assumes for the compilation of scotch that mpicc is called openmpicc
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
March 9, 2013, 09:20 |
|
#5 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
Great job, saves me alot of work again
I also feel a bit ashamed to use openfoam on mac, but only a little |
|
March 9, 2013, 11:43 |
|
#6 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
I try to take the catholic approach about it: confess my sins, get absolved, try to sin less, but know that I eventually will again
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
March 14, 2013, 05:13 |
|
#7 |
Member
Join Date: Mar 2009
Location: Switzerland
Posts: 40
Rep Power: 17 |
Or one could argue, ahem, that the patch is meant to get OpenFOAM working on Darwin, which is in theory open-source, and the hardware is thus irrelevant (read ignored).
Bernhard, fantastic job again! P.S. Works fine with Gcc45 (it stubbornly came with openmpi from macports) Last edited by sushant; March 14, 2013 at 09:22. |
|
March 15, 2013, 22:54 |
|
#8 |
New Member
Join Date: Mar 2011
Posts: 7
Rep Power: 15 |
Hello!
Sourcing the bashrc gives the following output on my MacBook Pro (OS X 10.8.3)! Code:
MacBook-Pro:~ md$ . OpenFOAM/OpenFOAM-2.2.x/etc/bashrc -bash: ulimit: −n: invalid number Cannot open configuration file /usr/local/share/openmpi/openmpicc-wrapper-data.txt Error parsing data file openmpicc: Not found Using paraview in directory /Applications/paraview.app MacBook-Pro:~ md$ Best regards, MD |
|
March 16, 2013, 06:02 |
|
#9 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
No. Seriously: the /usr/local stuff is puzzling as the patch doesn't do anything there. Is it possible that in /usr/local you have an OpenMPI-installation (probably non-MacPorts) About ulimit: is it possible that when adding it you entered 1O24 instead of 1024?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 16, 2013, 08:03 |
|
#10 | |
New Member
Join Date: Mar 2011
Posts: 7
Rep Power: 15 |
Quote:
Thanks for replying. This is very much appreciated. It seems that I figured out the two issues: The "/usr/local stuff" disappeared after rebooting my system. The problem with "ulimit" was due to the fact that the line had been put into the file using copy&paste. I was able to compile OF22x Next I went on to compile the Thirdpartys: Doing ./makeParaView gives me the error message Code:
-- The C compiler identification is unknown -- The CXX compiler identification is GNU 4.6.3 -- Check for working C compiler: /Applications/paraview.app/Contents/bin/cc -- Check for working C compiler: /Applications/paraview.app/Contents/bin/cc -- broken CMake Error at /opt/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/Applications/paraview.app/Contents/bin/cc" is not able to compile a simple test program. Code:
export WM_CC='gcc-mp-4.6' Could anyone please give me a hint to fix this? Best, MD Last edited by marcojdressler; March 16, 2013 at 21:36. Reason: Further analysis done on the problem |
||
March 17, 2013, 07:01 |
|
#11 | |||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
Quote:
If you want to compile Paraview anyway: the makeParaView-script supports you in that because it allows you to select phases: - first run only the config-phase (which will fail as you showed above) ./makeParaView -config -no-make -no-install - got to the directory that makeParaView created for building (somewhere in build) and start the CMake Text-Gui: ccmake . - the TUI will tell you about undefined stuff (like the compiler). Try to fix these until the TUI allows you to generate the necessary Makefiles (you're pretty much on your own here, but most of the problems have already been answered, usually on the Paraview-mailing-list. Google is your friend here) - go back to the root of the ThirdParty-directory and no run the remaining phases: ./makeParaView -no-config -make -install If you fail to specify -no-config it will overwrite all the work you did before, so be careful I did all this (and rolled it into the patch) with older versions. I'd still do it if I had the time, but I think my time is better spent with other projects. So if you (or anyone else) fells like doing this and sharing it with the world I'd appreciate this
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||||
March 17, 2013, 21:10 |
|
#12 |
Senior Member
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16 |
I am having a problem with compiling on 10.8.2
Steps I took: 1) I downloaded the lastest git version 2) applied the 20130309 patches, 3) changed the permissions on addr2line4Mac.py 4) fixed the sym links in wmake/rules 5) update site/2.1.x/prefs.sh for gcc46 and ccache 6) ./Allwmake 2>&1 | tee make.log After trying to compile I also had to comment the changes in etc/config/settings.sh because I have macports installed for MPI and ccache but didn't install cgal or boost: Code:
#if [ -n "$WM_USE_MACPORT" ] #then # export BOOST_ARCH_PATH=/opt/local # export CGAL_ARCH_PATH=/opt/local # export MPFR_ARCH_PATH=/opt/local # export GMP_ARCH_PATH=/opt/local #fi Code:
make[2]: `/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/multiphaseEulerFoam' is up to date. + wmake libso multiphaseMixture multiphaseMixture.dep:264: *** missing separator. Stop. + wmake g++-mp-4.6 -m64 -fsignaling-nans -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -I../interFoam -ImultiphaseMixture/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/transportModels -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/transportModels/incompressible/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/transportModels/interfaceProperties/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/turbulenceModels/incompressible/turbulenceModel -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -lpthread -L/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/lib/openmpi-macport -lPstream Make/darwinIntel64Gcc46DPOpt/multiphaseInterFoam.o -L/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/lib \ -lmultiphaseInterFoam -linterfaceProperties -lincompressibleTransportModels -lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -ldl -lpthread -lm -o /Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/multiphaseInterFoam ld: library not found for -lmultiphaseInterFoam collect2: ld returned 1 exit status make[2]: *** [/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/multiphaseInterFoam] Error 1 + wmake MRFMultiphaseInterFoam g++-mp-4.6 -m64 -fsignaling-nans -ftrapping-math -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -I.. -I../../interFoam -I../../interFoam/MRFInterFoam -I../multiphaseMixture/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/transportModels -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/transportModels/incompressible/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/transportModels/interfaceProperties/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/turbulenceModels/incompressible/turbulenceModel -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude -I/Users/matt/OpenFOAM/OpenFOAM-2.2.x/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -lpthread -L/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/lib/openmpi-macport -lPstream Make/darwinIntel64Gcc46DPOpt/MRFMultiphaseInterFoam.o -L/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/lib \ -lmultiphaseInterFoam -linterfaceProperties -lincompressibleTransportModels -lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -ldl -lpthread -lm -o /Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/MRFMultiphaseInterFoam ld: library not found for -lmultiphaseInterFoam collect2: ld returned 1 exit status make[2]: *** [/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/MRFMultiphaseInterFoam] Error 1 make[1]: *** [multiphaseInterFoam] Error 2 make[2]: `/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/settlingFoam' is up to date. make[2]: `/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/twoLiquidMixingFoam' is up to date. + wmake libso phaseModel '/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/lib/libphaseModel.dylib' is up to date. + wmake libso interfacialModels '/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/lib/libEulerianInterfacialModels.dylib' is up to date. + wmake libso kineticTheoryModels '/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/lib/libkineticTheoryModel.dylib' is up to date. + wmake make[2]: `/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/twoPhaseEulerFoam' is up to date. make[1]: Target `application' not remade because of errors. make: *** [multiphase] Error 2 make[2]: `/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/solidDisplacementFoam' is up to date. make[2]: `/Users/matt/OpenFOAM/OpenFOAM-2.2.x/platforms/darwinIntel64Gcc46DPOpt/bin/solidEquilibriumDisplacementFoam' is up to date. make: Target `application' not remade because of errors. |
|
March 17, 2013, 21:25 |
|
#13 | ||
New Member
Join Date: Mar 2011
Posts: 7
Rep Power: 15 |
Quote:
Thank you so much for your answer. Opening new terminals did not work, I tried that out several times without success. I am all right, however I am still a bit unclear about the various installations of OpenMPI on my system (I used MacPorts as well as another site to download them and I am not sure how all this lives side-by-side). I decided to postpone the compilation of Paraview at a later point since I have a working version of it in the Applications folder, too. I will let you know when I get back to this in the future. Thanks also for clarifying that the patch for the Thirdparties Quote:
Best regards, Marco. |
|||
March 18, 2013, 06:57 |
|
#14 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|||
March 18, 2013, 19:15 |
|
#15 |
Senior Member
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16 |
It worked! Thanks!!
|
|
March 27, 2013, 22:57 |
|
#16 | |
New Member
Join Date: Mar 2011
Posts: 7
Rep Power: 15 |
Dear Forum members:
I try to maintain OF2.1.1 and OF2.2.x on a MacBookPro 10.8.3. Loading OF21 works fine and it seems that I have a fully working installation Code:
Last login: Wed Mar 27 22:09:58 on ttys001 You have mail. MacBook-Pro:~ md$ which cp /bin/cp MacBook-Pro:~ md$ of21 MacBook-Pro:~ md$ which cp /bin/cp MacBook-Pro:~ md$ MacBook-Pro:~ md$ echo $PATH /Users/md/OpenFOAM/ThirdParty-2.1.1/platforms/darwinIntel64Gcc46/paraview-3.12.0/bin:/Users/md/OpenFOAM/md-2.1.1/platforms/darwinIntel64Gcc46DPOpt/bin:/Users/md/OpenFOAM/site/2.1.1/platforms/darwinIntel64Gcc46DPOpt/bin:/Users/md/OpenFOAM/OpenFOAM-2.1.1/platforms/darwinIntel64Gcc46DPOpt/bin:/Users/md/OpenFOAM/OpenFOAM-2.1.1/bin:/Users/md/OpenFOAM/OpenFOAM-2.1.1/wmake:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin MacBook-Pro:~ md$ Quote:
Can anyone comment on this, or give me a hint how to fix it? Looking forward reading from you. Regards, MD |
||
March 28, 2013, 06:27 |
|
#17 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Usually I'd say standard-utilities in non-standard places is highly suspicious (smells like root-kit) but I guess in this case it is "just" a problem with the install scripts
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 28, 2013, 17:24 |
|
#18 | |
New Member
Join Date: Mar 2011
Posts: 7
Rep Power: 15 |
Quote:
Thanks for the post. My paraview.app is not self-compiled and I checked three versions of ParaView on HTML Code:
http://www.paraview.org/paraview/resources/software.php
So I am going to delete my version of ParaView and replace it with one of the other two. … And this should resolve the problem. I hope that working with 3.98.1 is ok. Thanks and regards, MD |
||
March 29, 2013, 03:49 |
|
#19 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 29, 2013, 13:49 |
Use the git version, not the tarball download
|
#20 |
New Member
Bryan Lewis
Join Date: Jul 2010
Posts: 5
Rep Power: 16 |
For new people reading this forum, I found that it may be necessary to use the git repository version, rather than the tarball download. I was getting the following error with the download.
make: *** No rule to make target `matrices/lduMatrix/lduMatrix/lduMatrix.dep', needed by `Make/darwinIntel64Gcc46DPOpt/dependencies'. Stop. make: *** Waiting for unfinished jobs.... But if I pulling the source from git, it worked without a problem. OS X 10.8. gcc-4.6, openmpi, flex, bison, ccache, cgal, and boost installed from macports 1) pull the latest git version 2) applied the 20130309 patches, 3) changed the permissions on addr2line4Mac.py 4) fixed the sym links in wmake/rules 5) update etc/bashrc for gcc46 and ccache 6) ./Allwmake 2>&1 | tee make.log |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting Started with OpenFOAM | wyldckat | OpenFOAM | 26 | June 21, 2024 06:54 |
OpenFOAM course for beginners | Jibran | OpenFOAM Announcements from Other Sources | 2 | November 4, 2019 08:51 |
OpenFOAM v3.0+ ?? | SBusch | OpenFOAM | 22 | December 26, 2016 14:24 |
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker | rt08 | OpenFOAM Installation | 1 | February 28, 2016 19:00 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 13:36 |