CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Installation notes: OpenFOAM 2.3.x (git repo) on OSX 10.9 (https://www.cfd-online.com/Forums/openfoam-installation/148486-installation-notes-openfoam-2-3-x-git-repo-osx-10-9-a.html)

opedrofunk February 13, 2015 03:32

Installation notes: OpenFOAM 2.3.x (git repo) on OSX 10.9
 
Here are notes on installing OpenFOAM 2.3.x on OSX 10.9 with macports for dependencies.

So far, no errors have been noted. foamyHexMesh and snappyHexMesh work as normal (some have noted that this is not the case when compiling with gcc48, but I have not seen those issues). No libscotch erros have been noted (a problem sometimes encountered with the "homebrew" install method).

Here are the steps taken for successful compile:

1) Install Dependencies:

Code:

sudo port install gcc48
sudo port select --set gcc mp-gcc48
sudo port install openmpi-gcc48
sudo port select --set mpi openmpi-gcc48-fortran
sudo port install boost +openmpi
sudo port install cgal
sudo port install ccache
sudo port install flex
sudo port install scotch -mpich +gcc48 +openmpi
sudo port install metis +gcc48

# for completeness
sudo port select --set llvm mp-llvm-3.5
sudo port select --set python python27
sudo port select --set db db48

Note, before installing and upon running, port select looks like this:

Code:

$ port select --summary
Name    Selected              Options
====    ========              =======
db      db48                  db48 none
gcc    mp-gcc48              mp-gcc48 none
llvm    mp-llvm-3.5            mp-llvm-3.5 none
mpi    openmpi-gcc48-fortran  openmpi-gcc48-fortran none
python  python27              python25-apple python26-apple python27 python27-apple none



2) Create a volume and mount it:

Code:

$ hdiutil create -size 8.3g -type SPARSEBUNDLE -fs HFSX -volname OpenFOAM -fsargs -s OpenFOAM.sparsebundle
$ mkdir -p OpenFOAM
$ hdiutil attach -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle
$ cd OpenFOAM
$ git clone https://github.com/OpenFOAM/OpenFOAM-2.3.x
$ cd OpenFOAM-2.3.x


3) Get the patch here:
http://sourceforge.net/p/openfoam-ex....3.x-Mac.patch

Or from here:
https://bitbucket.org/peterjvonk/mac...am-2.3.x-patch

Download it and place it in the OpenFOAM-2.3.x directory.

4) Apply the patch:

Code:

$ patch -p1<OpenFOAM-2.3.x-Mac.patch
5) Append these these lines to the /path/to/OpenFOAM-2.3.x/etc/bashrc

Code:

$ echo "WM_CC=mpicc" >> /path/to/OpenFOAM-2.3.x/etc/bashrc
$ echo "WM_CXX=mpicxx" >> /path/to/OpenFOAM-2.3.x/etc/bashrc

Note: using the mpi wrappers (mpicc, mpicxx) revolves errors locating mpi header files, i.e. "mpi.h" - no sideffects were observed in the logs.

6) Install

Code:

$ source etc/bashrc && WM_NCOMPPROCS=$(sysctl -n hw.ncpu)
$ ./Allwmake > log.Allwmake 2>&1

Note, you may notice this message:
Code:

"Proper OpenMPI not installed. Either do 'port install openmpi-mp' or 'port install openmpi-default'"
Ignore it. Using mpicc and mpicxx wrappers will take care of includes and linking.

It might also complain about the ulimit, ignore this as well. Don't run as sudo - the ulimit is fine as is.

7) Update your bash profile to load the OpenFOAM bashrc file by adding:

Code:

# # openfoam
if [ -f $HOME/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc ]; then
  . $HOME/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc
fi

to your ~/.bash_profile

Thats it. All steps were taken from bash history file after compilation and testing.

Hope this helps!
Peter

wyldckat February 14, 2015 12:00

Greetings Peter,

Many thanks for providing these instructions!
I personally don't own a Mac, but I usually come around asking those who do to also write such instructions on the wiki :)

Right now, I've created the page for this particular version OpenFOAM 2.3.x: http://openfoamwiki.net/index.php/In...OpenFOAM_2.3.x - and added the main links for it. If you feel like it, feel free to also write your instructions on this wiki page! Although do keep in mind the license that the wiki uses by default:
Quote:

Content is available under GNU Free Documentation License 1.3 unless otherwise noted.
Best regards,
Bruno

opedrofunk February 16, 2015 13:59

All,
Instructions and build notes may also be found on the wiki, here:

http://openfoamwiki.net/index.php/In...tion_and_Notes

Hope this will be of use!
Peter

xZer0 February 17, 2015 12:59

Hi opedrofunk,

Quote:

Originally Posted by opedrofunk (Post 532077)
All,
Instructions and build notes may also be found on the wiki, here:

http://openfoamwiki.net/index.php/In...tion_and_Notes

Hope this will be of use!
Peter


Follow your wiki page, I've tried to get patch file from your propose URL (Topic 2.3) as bellow link:
Quote:

2.3 Get the patch
http://sourceforge.net/p/openfoam-ex....3.x-Mac.patch

Download the above and place it in the OpenFOAM-2.3.x directory.
That page is no longer to download (page error 404!).
Do you have another link to get it?


Thank you,
x

opedrofunk February 17, 2015 14:19

Here's a copy of the patch I used:

https://bitbucket.org/peterjvonk/mac...am-2.3.x-patch

The wiki will be subsequently updated.

Cheers,
Peter

dgraham March 18, 2015 06:04

Hello Peter,

Quote:

Originally Posted by opedrofunk (Post 531674)
2) Create a volume and mount it:

Code:

$ hdiutil create -size 8.3g -type SPARSEBUNDLE -fs HFSX -volname OpenFOAM -fsargs -s OpenFOAM.sparsebundle
$ mkdir -p OpenFOAM
$ hdiutil attach -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle
$ cd OpenFOAM
$ git clone https://github.com/OpenFOAM/OpenFOAM-2.3.x
$ cd OpenFOAM-2.3.x

Peter

Thanks for this. Everything worked fine except that when I mounted the volume it was not writeable so I had to add the -readwrite flag to hdiutil attach as follows:

Code:

hdiutil attach -readwrite -mountpoint $HOME/OpenFOAM OpenFOAM.sparsebundle
All fine after that.

Thanks again.
Dave

duan May 1, 2015 18:05

I followed the notes to install of 2.3.x on OS X 10.10.

Most solvers work fine, i.e icoFoam, However the interFoam not. In folder platforms/ darwinIntel64GccDPOpt/bin/ the interFoam do not exist.

Then I execute ./Allwclean and ./Allwmake to rebuild the interFoam in the solvers/multiphase/interFoam folder. It shows 26 warnings but no error.

Finally when I run the dam break tutorial case with interFoam, I get the error:
Quote:

#0 Foam::error::printStack(Foam::Ostream&) in "libOpenFOAM.dylib"
#1 0x0 in "/Users/qingfengduan/OpenFOAM/OpenFOAM-2.3.x/platforms/darwinIntel64GccDPOpt/bin/interFoam"
Segmentation fault: 11
Any ideas for this error?

And any notes to install the Thirdparty-2.3.x will be appreciated.

jundong July 1, 2015 13:51

This Process Ruined Python in Terminal
 
This ones doesn't work on Yosemite or Mavericks. After following that step by step, it ruined my python totally.:eek::eek::eek::eek:


All times are GMT -4. The time now is 01:28.