Installation/Mac OS/OpenFOAM 2.2.2

From OpenFOAMWiki
< Installation‎ | Mac OS
Revision as of 12:25, 15 November 2013 by Tidusuper91 (Talk | contribs)

1 Introduction and Notes

This guide is derived from OpenFOAM 2.1.x Installation with some modifications derived thanks to help provided on this thread of CFD Online Forum . The format of the page is based on OpenFOAM 1.7.x Installation.

These compilation instructions have only been tested on the following system:

Macbook (version 6,2)
Intel Core i7 2.66Ghz
Mac OS X Mavericks (version 10.9)

These instructions may need to be tailored as required to fit your specific system if they deviate from the above; you would be able to ask support on this thread if you needed it.

Many thanks go to Bernhard Gschaider (a.k.a. gschaider) of CFD Online for maintaining the latest OpenFOAM Mac OS X patches and for the big help that he provided me.

2 Prepare your Mac OS X Environment

2.1 Macports

To install Macports you need to install xCode, you can find it on the App Store. After XCode you need to install the Command Line Tools. Installing Command Line Tools for Mavericks is different from what you would do with previous OSX versions.

2.1.1 Command Line Tools for OSX 10.9 "Mavericks"

To install CLT on OSX 10.9 open a terminal application (for example Terminal.app) and run

 
xcode-select --install

a window will be prompted where you can confirm installation.

2.1.2 Command Line Tools for OSX version < 10.9

In previous versions of OSX (and of xCode) you can download CLT directly from xCode Preferences > Downloads > Components

2.1.3 xCode License

Now you should accept the xCode License so run, always in the Terminal (this could be needed only on OSX 10.9)

 
sudo xcodebuild -license

and when asked type "agree" to accept the license. Now xCode "things" should work correctly.

2.1.4 MacPorts Installation

Now to install Macports you can download the pre-compiled package from the Official Website.

2.2 Build and Install the necessary software

To install all the tools we'll need run in Terminal:

 
sudo port selfupdate

Wait for the end of all operations then do:

 
sudo port install gcc46 openmpi boost cgal ccache flex bison