Difference between revisions of "Installation/Mac OS/OpenFOAM 2.1.x"

From OpenFOAMWiki
(First chapter complete. Time to save the page.)
 
(Having problems previewing things...)
Line 1: Line 1:
 
This is a transcript and subsequent improvements on the guide made by [http://www.cfd-online.com/Forums/openfoam-installation-windows-mac/95763-1-9-aka-2-1-mac-os-x-2.html#post343833 Michael Plagge]. The original PDF: [[Media:Compiling Manual OpenFOAm Mac OS X.pdf|Compiling Manual OpenFOAm Mac OS X.pdf]]
 
This is a transcript and subsequent improvements on the guide made by [http://www.cfd-online.com/Forums/openfoam-installation-windows-mac/95763-1-9-aka-2-1-mac-os-x-2.html#post343833 Michael Plagge]. The original PDF: [[Media:Compiling Manual OpenFOAm Mac OS X.pdf|Compiling Manual OpenFOAm Mac OS X.pdf]]
  
 +
__FORCETOC__
 +
 +
<br>
 
= Basic requirements =
 
= Basic requirements =
 
This manual assumes that the reader is familiar with Mac OS X, the installation of
 
This manual assumes that the reader is familiar with Mac OS X, the installation of
Line 29: Line 32:
 
[[File:Howto install OpenFOAM v21 Mac-images-008.ppm.png|thumb|500px|center]]</li>
 
[[File:Howto install OpenFOAM v21 Mac-images-008.ppm.png|thumb|500px|center]]</li>
 
</ol>
 
</ol>
 +
 +
<br>
 +
= Installing and compiling OpenFOAM 2.1 with GCC 4.6 and OpenMPI 1.5.4 =
 +
First, we create a disk image with the Apple Disk Utility. Open <tt>/Applications/Utilities/Disk Utility</tt>. Click New Image:
 +
[[File:Howto install OpenFOAM v21 Mac-images-010.ppm.png|thumb|500px|center]]
 +
 +
It is important to set as <tt>Format: Mac OS Extended (Case-sensitive,Journaled)</tt>. The sparse image will grow with the place used inside the image. Create a sparse image with the following settings (examples, you could change the values):
 +
[[File:Howto install OpenFOAM v21 Mac-images-012.ppm.png|thumb|500px|center]]
 +
 +
Go to the directory of the image by typing <tt>cd /Volumes/OpenFOAM-v2.1</tt>:
 +
[[File:Howto install OpenFOAM v21 Mac-images-014.ppm.png|thumb|500px|center]]
 +
 +
Use a browser to download the archives of OpenFoam 2.1 and ThirdParty 2.1 from [http://openfoam.org/download/source.php openfoam.org/download/source.php] and copy the archives into the image. Extract the archives by double clicking on each one.
 +
 +
Then download the patches created by Bernhard Gschaider, see [http://www.cfd-online.com/Forums/openfoam-installation-windows-mac/95763-1-9-aka-2-1-mac-os-x.html#post340297 here].
 +
 +
Copy or move them into the image. Your image content should look like this:
 +
[[File:Howto install OpenFOAM v21 Mac-images-016.ppm.png|thumb|500px|center]]
 +
 +
Move the appropriate patches into the directories, see below:
 +
[[File:Howto install OpenFOAM v21 Mac-images-018.ppm.png|thumb|500px|center]]
 +
 +
Change into the OpenFOAM directory and apply the first patche via:
 +
<bash>patch -p1 < *.patch</bash>
 +
[[File:Howto install OpenFOAM v21 Mac-images-020.ppm.png|thumb|500px|center]]
 +
 +
The end of the output should look like this:
 +
[[File:Howto install OpenFOAM v21 Mac-images-022.ppm.png|thumb|500px|center]]
 +
 +
Add executive rights to a python script like this:
 +
[[File:Howto install OpenFOAM v21 Mac-images-024.ppm.png|thumb|500px|center]]
 +
 +
Apply the second patch for the compiler, in this case we use the GCC 4.6 so choose the right patch by typing:
 +
<bash>patch -p1 < OpenFOAM-2.1.x-Mac-gcc46.patch</bash>
 +
Open the file <tt>/etc/bashrc</tt> with a text editor, e. g. Text Wrangler or <tt>pico</tt> or <tt>nano</tt> and add these lines:
 +
<bash>ulimit −n 1024
 +
export WM_NCOMPPROCS=20</bash>
 +
The first entry is to increase the number of files which one process may open at a time; the second you should set to the number of processes your CPU could manage in parallel, e. g. 4, 8, 16, ...
 +
 +
It should look like this:
 +
[[File:Howto install OpenFOAM v21 Mac-images-026.ppm.png|thumb|500px|center]]

Revision as of 10:13, 1 April 2012