# Update on April 2013
New post about OpenFOAM 2.2 on Mac OS X Snow Lion
# Now back to the original post…
As of today, the latest OpenFOAM available is OpenFOAM-2.0.1. I am going to walk through installing it on my Macbook Pro (2.4 Ghz Intel Core 2 Duo). Installing open-source code can be a hassle since hardware/specification varies a lot. But it’s a price to pay, but you can google whenever you encounter a problem. You may find this forum (cfd-online) very useful. I listed
1. Update your OS X to the most recent version. I paid $29.99 for the new OS X Lion (10.7.1) from App Store. (~6 hrs)
2. Go to App Store, and download and install Xcode 4.1 . It’s free, but you have to register as a developer. (~3 hrs)
3. Install Macports for Lion. Simply follow the link and click on Lion to download dmg file. (< 5min)
4. Now you’re ready to install gcc 4.5.3. Open Terminal or X11, and type as followed
>> sudo port install gcc45
It will take a while. (~3 hrs?)
5. Mac OS X 10.7 does NOT come with OpenMPI, so you need to install it. On Terminal, type
>> sudo port install openmpi +gcc45
6. Now we’re ready to install OpenFOAM. Here’s the link for OpenFOAM disk image file for Mac. Download ‘README’ and ‘Mac-OF-2.0.x.sparseimage.zip’.
7. Extract Mac-OF-2.0.x.sparseimage.zip, and mount the image by double clicking.
8. Now, follow the instruction on ‘README’… I’m just going to narrate it here as well. Open Terminal and type..
>> cd ~
>> ln -sf /Volumes/Mac-OF-2.0.x OpenFOAM
>> cd OpenFOAM
>> ln -sf ~/Documents/OF-User ‘whoami’-2.0.x
>> cd ~
>> vi .profile
and add this line
Quit and restart Terminal…
9. Change the OpenMPI setting…
and replace OPENMPI to SYSTEMOPENMPI
10. It’s a good idea to recompile it from the beginning.
>> cd ~/OpenFOAM/OpenFOAM-2.0.x
…. this will clear everything up
…. this will take a while…
After few hours of wait, OpenFOAM is finally ready to use. Test drive it by doing one of the tutorials.