After I've made patches for OpenFOAM 2.3.0 to build it with clang I came upon post by Bernhard Gshaider where he decided to drop ThirdParty source packs as all necessary software can be installed with Macports. Since all software from ThirdParty package can be installed with Homebrew (except you don't need to install gcc with all the stuff Macports pull with it), I've made this patch.
Installation is more or less straight-forward:
- Download OpenFOAM-2.3.0.tgz source pack
- Download patch.
- Create disk image with CASE SENSITIVE file system. Guide with pictures is on OpenFOAM wiki. Usually guides suggest sparseimage format though sparsebundle format is more convenient for the systems with active backup software.
- Mount created image into $HOME/OpenFOAM (hdiutil attach -quiet -mountpoint $HOME/OpenFOAM <your disk image file>)
- Unpack source archive into $HOME/OpenFOAM. Assuming you've downloaded it in $HOME/Downloads you can do the following:
$ cd $HOME/OpenFOAM
$ tar xzf ~/Downloads/OpenFOAM-2.3.0.tgz
- Copy patch into $HOME/OpenFOAM/OpenFOAM-2.3.0 folder
$ cd $HOME/OpenFOAM/OpenFOAM-2.3.0
$ cp ~/Downloads/OpenFOAM-2.3.0-3.patch .
- Apply patch with git apply OpenFOAM-2.3.0-3.patch
- Install third party software. I assume you're using Homebrew as a package manager, so you need to do:
$ brew install open-mpi gmp mpfr boost gcal - Now you can initialize environment variables for OpenFOAM with
$ source etc/bashrc
(or you can first edit this file if you're installing OpenFOAM somewhere but $HOME/OpenFOAM/OpenFOAM-2.3.0) - Now you are ready to execute ./Allwmake