CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

OF 1.9 (aka OF 2.1) on Mac OS X

Register Blogs Community New Posts Updated Threads Search

Like Tree25Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 1, 2012, 16:35
Default OF 1.9 (aka OF 2.1) on Mac OS X
  #1
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi!

For those who haven't just applied the 2.0-patch to the shiny new OpenFOAM 2.1.x here comes a set of patches to get it to run.

This time you have the choice:
a) use the gcc 4.2 that comes with Apple XCode (advantage is: you'll only have to install one compiler)
b) use gcc 4.6 from MacPorts (advantage: supposedly faster)

Basically do the same as if you would install OF from sources on a Linux-Machine (so I'll be sketchy):

1. Download OF 2.1 (preferably via git) and Thirdparty-2.1 and unpack them on a case-sensitive filesystem (see elsewhere what this means)

2. Go to the ThirdParty-Directory and apply the first patch
patch -p1 <ThirdParty-2.1.0-Mac.patch

3. Go to the OpenFOAM-Directory and apply the base-patch
patch -p1 <OpenFOAM-2.1.x-Mac.patch
then make the script that helps with the tracedumps executable (if the patch-utilitiy didn't do it)
chmod a+x bin/addr2line4Mac.py

4. Now decide which compiler you're going to use (although you can also apply both patches if you want to)
a) gcc 4.2: apply the appropriate patch:
patch -p1 <OpenFOAM-2.1.x-gcc42.patch
(this patch fixes some places where gcc4.2 can't cope with advanced constructs)
b) gcc 4.6: apply
patch -p1 <OpenFOAM-2.1.x-Mac-gcc46.patch
and make sure that the WM_COMPILER environment variable is set to Gcc46 (preferably in site/2.1.x/prefs.sh)
c) other compiler: copy wmake/rules/darwinIntel.. that the patches create. Basically only the compiler name has to be changed in the c ant the c++-file if you use gcc

5. Now source etc/bashrc, grab some coffee and compile

As usual I didn't bother to get the PV3Reader (aka paraFoam) to compile. Use an up-to-date paraview from Kitware with the built in reader for OF

Bernhard

PS: comments on the procedure are welcome. If somebody feels like writing a step-by-step instruction on the Wiki this would be even more welcome
Attached Files
File Type: patch ThirdParty-2.1.0-Mac.patch (3.0 KB, 1830 views)
File Type: patch OpenFOAM-2.1.x-Mac.patch (37.1 KB, 1442 views)
File Type: patch OpenFOAM-2.1.x-Mac-gcc46.patch (4.1 KB, 1513 views)
File Type: patch OpenFOAM-2.1.x-gcc42.patch (15.9 KB, 1193 views)
makaveli_lcf, liybzd, sako and 6 others like this.
gschaider is offline   Reply With Quote

 

Tags
compilation error


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend Project 1.6-ext Binary Release for Mac OS X hjasak OpenFOAM Announcements from Other Sources 26 November 5, 2013 16:50
Openfoam mac: Compiling custom libraries atareen64 OpenFOAM 3 April 14, 2011 11:01
OpenFOAM-1.6 on Mac OS X 10.6.1 elvisjohndowson OpenFOAM 6 October 21, 2009 15:45
Mac Simple Install Request or Processing Assistance Help sjohnson OpenFOAM Installation 4 December 12, 2008 07:46
MAC + SOLA for free surface T Main CFD Forum 1 April 11, 2001 13:43


All times are GMT -4. The time now is 07:55.