Difference between revisions of "Installation"

From OpenFOAMWiki
(Building)
(Revised working and added a bit more description)
 
(24 intermediate revisions by 6 users not shown)
Line 1: Line 1:
OpenFOAM is [http://www.opencfd.co.uk/openfoam/download.html available for download] as source code and binary files for linux and linux-like operating systems. An official Windows binary is not provided.  OpenFOAM can be tested without installation by using the [http://sourceforge.net/projects/openfoam-extend/files/ SLAX Live CD].
+
<big><big>'''The old instructions are still available here''': [[Installation/Installation (old monolithic version)]]</big></big>
 +
<hr>
 +
<br>
 +
= Introduction =
 +
This page aims to gather all possible instructions for installing as many versions, [[Forks_and_Variants|forks and variants]] of OpenFOAM technology and in as many Operating Systems as possible, for example:
 +
* {{OpenFOAM}} is [http://www.openfoam.org/download/ available for download] as source code and binary files for Linux and Linux-like operating systems (also known as [http://en.wikipedia.org/wiki/POSIX POSIX]-compliant systems), provided along with the official installation instructions. Currently there aren't any official Windows or Mac OS binaries provided by the {{OpenFOAM}} Foundation.
 +
* {{-Extend}} is [http://sourceforge.net/projects/openfoam-extend/files/ available for download] as source code and binary files for Linux and other operating systems.  
  
=General Instructions=
 
  
==OpenCFD git repository==
+
This is where this [[Installation]] page steps in: provides a community based effort for documenting how to install OpenFOAM related technology (OpenFOAM, foam-extend, etc...) on any and all [http://en.wikipedia.org/wiki/Operating_system Operating Systems], along with more detailed instructions where possible. Keep in mind that this effort is constantly ongoing and may be slower than desired. If you want to help, please refer to the chapter [[#How to help|How to help]].
  
OpenCFD provide a repository using the [http://en.wikipedia.org/wiki/Git_(software) git distributed version control system]. A script that automates all the following steps can be found in the cfd-online [http://www.cfd-online.com/Forums/openfoam/68136-openfoam-1-6-install-cookbook.html forums].
+
Since installing OpenFOAM related technology can be a rather extensive subject, specially due to the many OSes and respective versions, it has been divided into categories listed in the following Table of Contents:
 +
__TOC__
  
{{VersionInfo}}{{Version1.6}}
+
= Installing OpenFOAM =
===Unpacking===
+
This is the tree of the categories and respective sub-categories about installing OpenFOAM technology: {{#categorytree:Installing OpenFOAM|mode=pages|hideroot=on}}
  
To get the sources you will need to do the following
+
'''Notes''':
<pre>
+
* Click the '''+''' symbols for expanding the branches on the tree, the '''-''' symbols for collapsing expanded branches.
cd ~/OpenFOAM/
+
* You'll find two types of branches:
git clone http://repo.or.cz/r/OpenFOAM-1.6.x.git/
+
*# Branches that list sub-categories.
cd OpenFOAM-1.6.x
+
*# Branches that list pages themselves.
git pull
+
* The tree list is automatically generated and probably is not complete, since it's constantly ongoing.
</pre>
+
  
You will also need to install the ThirdParty source, from [http://www.opencfd.co.uk/openfoam/linux.html http://www.opencfd.co.uk/openfoam/linux.html], make sure you get the right version (ie 32 or 64 bit)
 
  
To install this you need to unpack this file in the OpenFOAM directory (the code below assumes that the tar file is in <tt>~/OpenFOAM/</tt>
+
= Installing Third-Party software =
 +
This is the tree of the categories and respective sub-categories about installing Third-Party software which is meant for using with OpenFOAM: {{#categorytree:Installing Third-Party software|mode=pages|hideroot=on}}
  
<pre>
+
= Other Details =
cd ~/OpenFOAM/
+
This is the tree of the pages with other details related to installing OpenFOAM and other third-party applications: {{#categorytree:Installing OpenFOAM - Other Details|mode=pages|hideroot=on}}
tar -zxf ThirdParty-1.6.General.gtgz
+
</pre>
+
  
===Set-up===
+
= Outdated Instructions =
Before compiling you will need to set up the openfoam environment. Firstly - set wmake to use the system compiler. (Check the compiler version before changing it to System, make the change if it's compatible with OpenFOAM specification)
+
This is the tree of outdated pages related to installing OpenFOAM and other third-party applications: {{#categorytree:Installing OpenFOAM - Outdated Instructions|mode=pages|hideroot=on}}
  
in <tt>~/OpenFOAM/OpenFOAM-1.6.x/etc/settings.sh</tt> change the line (line no 98)
+
= How to help =
<pre>
+
The effort for this new page structure is being talked about on this thread: [http://www.cfd-online.com/Forums/openfoam-installation/102534-discussion-restructuring-installation-page-openfoamwiki-net.html &#91;Discussion&#93; Restructuring the Installation page at openfoamwiki.net] - this is where you can ask questions on how the structure for this section of the [http://openfoamwiki.net openfoamwiki.net] is kept.
compilerInstall=OpenFOAM
+
</pre>
+
to
+
<pre>
+
compilerInstall=System
+
</pre>
+
  
Next source the OF settings
+
On each main OS page you should find instructions on how to add new pages and what is the structure to be respected. Said OS pages are:
<pre>
+
* [[Installation/Linux]]
. ~/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc
+
* [[Installation/Mac OS]]
</pre>
+
* [[Installation/Windows]]
  
Your session should now be set up to run OF-1.6 (but there won't be anything to run yet)
 
  
===Compiling===
+
For the other 2 sets of category pages, here are the instructions for each one:
 +
<ul>
 +
<li>'''Other Details''': these pages are to be added directly in the [[Installation]] sub-pages section. <br>
 +
For example, for a page about the ''Shell Environment'', the page should be '''Installation/Shell Environment'''. <br>
 +
The category marker given in these pages should be:
 +
<pre>[[Category:Installing OpenFOAM - Other Details]]</pre></li>
 +
<li>'''Outdated Instructions ''': these pages are also to be added directly in the [[Installation]] sub-pages section. <br>
 +
For example, for a page about installing ''FoamX'', the page should be '''Installation/FoamX'''. <br>
 +
The category marker given in these pages should be:
 +
<pre>[[Category:Installing OpenFOAM - Outdated Instructions]]</pre></li>
 +
</ul>
  
Next step is to compile OF.
+
[[Category:Installing OpenFOAM]]
 
+
Set the number of processors to use, in this case 4
+
<pre>
+
export WM_NCOMPPROCS=4
+
</pre>
+
 
+
Compile the ThirdParty stuff
+
<pre>
+
cd ~/OpenFOAM/
+
ln -s ThirdParty-1.6 ThirdParty-1.6.x
+
cd ThirdParty-1.6.x
+
./Allwmake
+
</pre>
+
 
+
Assuming you have no errors, we can now compile OpenFOAM
+
re-source the settings (to pick up newly created directories)
+
<pre>
+
cd ~/OpenFOAM/OpenFOAM-1.6.x
+
. etc/bashrc
+
</pre>
+
 
+
Then compile away
+
<pre>
+
./Allwmake
+
</pre>
+
 
+
When it finishes (hopefully) you should have a completely working installation.
+
 
+
==Compile OpenCFD release==
+
{{VersionInfo}}{{Version1.4}}
+
 
+
This is a step-by-step installation guide to OpenFOAM on 32 bit machines. It is highly focused on Linux-newbies, thus many steps might
+
look superfluous on more experienced users. The character ">" is used to signal that what follows on that specific line is to be typed in a command line.
+
 
+
- Make a directory for your OpenFOAM installation by typing:
+
  > mkdir $HOME/OpenFOAM
+
  > cd $HOME/OpenFOAM
+
  > mkdir linux
+
 
+
- Download the following six archives from the opencfd-homepage to the $HOME/OpenFOAM directory:
+
  > OpenFOAM-1.4.1.General.gtgz
+
  > OpenFOAM-1.4.1.linuxGccDOpt.gtgz
+
  > OpenFOAM-1.4.1.linuxGccSOpt.gtgz
+
  > gcc-4.2.1.linux.tgz
+
  > j2sdk1.4.2_05.linux.tgz
+
  > paraview-2.4.4.linux.tgz
+
 
+
- Open a terminal and type:
+
  > ls /usr/include/features.h
+
  a) EITHER "/usr/include/features.h" is written to screen. Do not do any further.
+
  b) OR "cannot access /usr/include/features.h: No such file or directory"
+
    is written to screen. You need the build essentials to compile your own
+
    boundary conditions, thus type the following in a terminal:
+
    > aptitude install build-essential gcc
+
 
+
- Unpack the archives by typing the following command:
+
  > cd $HOME/OpenFOAM
+
  > tar -xzf OpenFOAM-1.4.1.General.gtgz
+
  > tar -xzf OpenFOAM-1.4.1.linuxGCCDPOpt.gtgz
+
  > tar -xzf OpenFOAM-1.4.1.linuxGCCSPOpt.gtgz
+
  > tar -xzf gcc-4.2.1.linux.tgz linux/
+
  > mv *.tgz linux/.
+
  > cd linux
+
  > tar -xzf gcc-4.2.1.linux.tgz
+
  > tar -xzf j2sdk1.4.2_05.linux.tgz
+
  > tar -xzf paraview-2.4.4.linux.tgz
+
 
+
- You need to set some environmental variables to be able to run OpenFOAM. This is done in the following way:
+
 
+
  a) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), do the
+
    following:
+
    > nano $HOME/.bashrc (this open a text-editor in your command window)
+
    In the end of the file you type:
+
    . $HOME/OpenFOAM/OpenFOAM-1.4.1/.OpenFOAM-1.4.1/bashrc
+
    Press 'CTRL-X' to quit nano and agree to save changes.
+
 
+
  a) OR, if running tcsh or csh (if in doubt type 'echo $SHELL'), do the
+
    following:
+
    > nano $HOME/.cshrc (this open a text-editor in your command window)
+
    In the end of the file you type:
+
    source $HOME/OpenFOAM/OpenFOAM-1.4.1/.OpenFOAM-1.4.1/cshrc
+
    Press 'CTRL-X' to quit nano and agree to save changes.
+
 
+
- Open a new command-window. This will read $HOME/.bashrc and set all the necessary environmental variables. To check the installation do:
+
  > cd ~/OpenFOAM/OpenFOAM-1.4.1/bin
+
  > sh foamInstallationTest
+
 
+
- On single-machine setups, the installation test will probably produce a report which looks like this in the last couple of lines:
+
+
  ==============================================================================
+
  Checking networking...
+
 
+
  -------------------------------------------------------------------------------
+
  Action                  Result                                      Crit
+
  -------------------------------------------------------------------------------
+
  Pinging_ngj-ubuntu      Successful                                  yes
+
  Pinging_localHost        Successful                                  yes
+
  Test_rsh:                Unsuccessful_connection_refused*            yes
+
  Test_ssh:                Unsuccessful_connection_refused*            yes
+
  FATAL ERROR: No remote shell available.
+
              Foam1.4.1 enviroment requires either ssh and/or rsh.
+
              Contact your system administrator.
+
+
+
  -------------------------------------------------------------------------------
+
+
  The system test has evoked 1 fatal error(s).
+
+
  Critical systems ok.
+
+
  Review the output for warning messages and consult
+
  the installation guide for trouble shooting.
+
  ==============================================================================
+
 
+
  This fatal error is due the test_rsh and test_ssh critiria, though they are
+
  irrelevant on single-machine installations, i.e. only relevant for parallel-
+
  processing on multiple machine.
+
 
+
- To setup the a working directory, follow step 6 in the ~/OpenFOAM/OpenFOAM-1.4.1/README file.
+
 
+
- You are now ready to begin working with OpenFOAM.
+
 
+
- Have fun:)
+
 
+
== OpenCFD binaries ==
+
{{VersionInfo}} {{Version1.6}}
+
 
+
Installing OpenFOAM from binary files is very good if you are a first time user.  You can quickly install the software with minimal complications.  The process consists of five simple steps:
+
 
+
# Download the binary files
+
# Unpack the binary files to your home directory
+
# Add environmental variables
+
# Test the installation
+
# Getting Started
+
 
+
This assumes that you will be installing openFOAM in your home directory.  There are many possible variations on this installation procedure (for example, you don't need to install to your home directory.)  But you should probably go with the simplest method first time around.
+
 
+
=== Download the Binary Files ===
+
These files are all compiled and ready to go.  All you have to do is download them.  Go to:  http://www.opencfd.co.uk/openfoam/download.html
+
 
+
# At the top of the page is a pull down menu.  Select whether you want binaries for Linux 32 bit or Linux 64 bit.
+
# Create a directory in your home directory.  Open up a console window and type the following in at the command line:
+
<pre>
+
mkdir $HOME/OpenFOAM
+
</pre>
+
 
+
# Download the following files into this directory.  These will install the compiled binary files, the source code, documentation, example files, necessary supporting libraries, etc.  Everything you would expect in a program.  It just comes in four separate packages
+
## OpenFOAM-1.6.General.gtgz 
+
## OpenFOAM-1.6.linux64GccDPOpt.gtgz
+
## ThirdParty-1.6.General.gtgz
+
## ThirdParty-1.6.linux64Gcc.gtgz
+
 
+
=== Unpack the Binary Files ===
+
 
+
You have downloaded all four files.  Now unpack all the files to the same OpenFOAM directory that you created before.  That is the $HOME/OpenFOAM directory.  Use whatever tool you prefer to unpack the files.  I prefer to use a graphical interface that does the work for me.  You can also use the command line by typing
+
 
+
<pre>
+
tar xzf OpenFOAM-1.6.General.gtgz
+
tar xzf OpenFOAM-1.6.linux64GccDPOpt.gtgz
+
tar xzf ThirdParty-1.6.General.gtgz
+
tar xzf ThirdParty-1.6.linux64Gcc.gtgz
+
</pre>
+
 
+
Congratulations.  You now have the binary files unpacked.  That was most of the work.  Next, you just need to add the environmental variables.
+
 
+
=== Environmental Variables ===
+
 
+
The environmental variables will allow the linux system to understand the various OpenFOAM commands.  Fortunately, you don't need to add the environmental variables.  All you need to do is add one line which will point the system to a file in OpenFOAM that has all the environmental variables.
+
 
+
The environment variable settings for openFOAM are contained in files in an etc/ directory in the OpenFOAM release. e.g. in $HOME/OpenFOAM/OpenFOAM-1.6/etc/
+
 
+
'''EITHER'''
+
if running bash or ksh, source the etc/bashrc file by adding the following line to the end of your $HOME/.bashrc file:
+
 
+
<pre>. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc </pre>
+
 
+
Then update the environment variables by sourcing the $HOME/.bashrc file by typing in the terminal:
+
 
+
<pre>. $HOME/.bashrc </pre>
+
 
+
Notice the periods at the beginning of the line and before the .bashrc filename.
+
 
+
'''OR'''
+
if running tcsh or csh, source the etc/cshrc file by adding the following line to the end of your $HOME/.cshrc file:
+
 
+
<pre>source $HOME/OpenFOAM/OpenFOAM-1.6/etc/cshrc</pre>
+
 
+
Then update the environment variables by sourcing the $HOME/.cshrc file by typing in the terminal:
+
 
+
<pre>source $HOME/.cshrc</pre>
+
 
+
'''Note''' If you are in doubt about which shell you are running, type:
+
 
+
<pre> echo $SHELL </pre>
+
 
+
You will know you have done it correctly if you don't get any return from the command line when you source your .bashrc file.  See this example:
+
 
+
<pre>
+
> . $HOME/.bashrc
+
>
+
</pre>
+
 
+
=== Test the Installation ===
+
 
+
To check your installation setup, execute the <code>foamInstallationTest</code> script (in the bin/ directory of the OpenFOAM installation). If no problems are reported, proceed to getting started with OpenFOAM; otherwise, go back and check you have installed the software correctly and/or contact your system administrator.  Type the following code in the command line to navigate to the location of the <code>foamInstallationTest</code> script and execute it:
+
 
+
<pre>
+
> cd ~/OpenFOAM/OpenFOAM-1.4.1/bin
+
> foamInstallationTest
+
</pre>
+
 
+
That will execute the script.  A successful test will produce output that looks like this:
+
 
+
<pre>
+
Checking basic setup...
+
-------------------------------------------------------------------------------
+
Shell:              bash                                                     
+
Host:              linux-hhqc                                               
+
OS:                Linux version 2.6.27.7-9-default                         
+
-------------------------------------------------------------------------------
+
 
+
 
+
Checking main OpenFOAM env variables...
+
-------------------------------------------------------------------------------
+
Environment_variable Set_to_file_or_directory                Valid      Crit 
+
-------------------------------------------------------------------------------
+
$WM_PROJECT_INST_DIR /home/nicholas/OpenFOAM                  yes      yes   
+
$WM_PROJECT_USER_DIR /home/nicholas/OpenFOAM/nicholas-1.6    yes      no   
+
$WM_THIRD_PARTY_DIR  /home/nicholas/OpenFOAM/ThirdParty-1.6  yes      yes   
+
-------------------------------------------------------------------------------
+
 
+
 
+
Checking the OpenFOAM env variables set on the PATH...
+
-------------------------------------------------------------------------------
+
Environment_variable Set_to_file_or_directory                Valid Path Crit 
+
-------------------------------------------------------------------------------
+
$WM_PROJECT_DIR      /home/nicholas/OpenFOAM/OpenFOAM-1.6    yes  yes  yes   
+
 
+
$FOAM_APPBIN        ...1.6/applications/bin/linux64GccDPOpt  yes  yes  yes
+
$FOAM_SITE_APPBIN    ...penFOAM/site/1.6/bin/linux64GccDPOpt  no        no
+
$FOAM_USER_APPBIN    ...1.6/applications/bin/linux64GccDPOpt  no        no
+
$WM_DIR              ...nicholas/OpenFOAM/OpenFOAM-1.6/wmake  yes  yes  yes
+
-------------------------------------------------------------------------------
+
 
+
 
+
Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH...
+
-------------------------------------------------------------------------------
+
Environment_variable Set_to_file_or_directory                Valid Path Crit
+
-------------------------------------------------------------------------------
+
$FOAM_LIBBIN        ...OAM/OpenFOAM-1.6/lib/linux64GccDPOpt  yes  yes  yes
+
$FOAM_SITE_LIBBIN    ...penFOAM/site/1.6/lib/linux64GccDPOpt  no        no
+
$FOAM_USER_LIBBIN    ...OAM/nicholas-1.6/lib/linux64GccDPOpt  no        no
+
$MPI_ARCH_PATH      ...nmpi-1.3.3/platforms/linux64GccDPOpt  yes  yes  yes
+
-------------------------------------------------------------------------------
+
 
+
 
+
Third party software
+
-------------------------------------------------------------------------------
+
Software Version  Location
+
-------------------------------------------------------------------------------
+
gcc      4.3.3    ...OAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux64/bin/gcc
+
gzip    1.3.12    /usr/bin/gzip
+
tar      1.20      /bin/tar
+
icoFoam  1.6      .../OpenFOAM-1.6/applications/bin/linux64GccDPOpt/icoFoam
+
-------------------------------------------------------------------------------
+
 
+
 
+
Summary
+
-------------------------------------------------------------------------------
+
Base configuration ok.
+
 
+
Critical systems ok.
+
 
+
 
+
done.
+
</pre>
+
 
+
The important part are the last lines which state the basic configuration and critical systems are both good.  If these two lines do not say OK, you need to look through the details of the test results to see what went wrong.
+
 
+
If these two lines do say OK, congratulations!  You have successfully installed OpenFOAM.  The last step is to setup the files for using OpenFOAM and run a simple test case.
+
 
+
=== Getting Started ===
+
 
+
We will setup a project directory that all subsequent projects can be run from.  And then we will run a simple test case to ensure everything works.  Create a project directory within the $HOME/OpenFOAM directory named $LOGNAME-1.6 (e.g. ‘chris-1.6’ for user chris and OpenFOAM version 1.6)
+
 
+
<pre>
+
>cd $HOME/OpenFOAM
+
>mkdir $LOGNAME-1.6
+
</pre>
+
 
+
and create a directory named <code>run</code> within it, e.g. by typing:
+
 
+
<pre>
+
mkdir -p $FOAM_RUN/run
+
</pre>
+
 
+
Copy the tutorial examples directory in the OpenFOAM distribution to the run directory. If the OpenFOAM environment variables are set correctly, then the following command will be correct:
+
 
+
<pre>
+
cp -r $WM_PROJECT_DIR/tutorials $FOAM_RUN
+
</pre>
+
 
+
Run the first example case of incompressible laminar flow in a cavity.  Type the following into the command line:
+
 
+
<pre>
+
>cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
+
>blockMesh
+
>icoFoam
+
>paraFoam
+
</pre>
+
 
+
[[Image:paraview_test.jpg|thumb|right|Your screen should look like this]]
+
When you have executed all four commands, the paraview post-processor should start. 
+
 
+
It doesn't look like much, but notice the bottom left corner.  The list for '''Mesh Parts''' has four items in it.  And the list for '''Volume Fields''' has two items in it.  This tells you that paraview successfully read the data file.  You can now happily use OpenFOAM.
+
 
+
==OpenFOAM-dev subversion repository==
+
 
+
=System specific tips and experiences=
+
 
+
==OpenSuSE==
+
{{VersionInfo}}{{Version1.6}} [[User:Hoogs/Installation#1.6.x|1.6.x on 11.1, x86_64]] |
+
 
+
==Gentoo==
+
{{VersionInfo}}{{Version1.6}}
+
 
+
OpenFOAM and Paraview are now both in the main portage tree. For installation just type
+
 
+
<bash>
+
emerge openfoam
+
</bash>
+
 
+
In order to get OpenFOAM running, add the following line to your ~/.bashrc
+
 
+
  alias startOF16="source /usr/lib/OpenFOAM/OpenFOAM-1.6/etc/bashrc"
+
 
+
And each time you want to use OpenFOAM just type '''''startOF16''''' in the active terminal.
+
 
+
==Ubuntu/Debian==
+
 
+
===OpenFOAM-1.6.x on Ubuntu 8.04 or higher (including 10.04 LTS)===
+
 
+
For that distributions an automatic installer is available to download under GPLv3 in http://code.google.com/p/openfoam-ubuntu
+
The script takes into account several fixes needed in Ubuntu, like PV3FoamReader build, Qt build, library linking and bash calls.
+
 
+
===Ubuntu Intrepid 8.10 ===
+
{{VersionInfo}}{{Version1.5}}
+
 
+
You have to add the following line to /etc/apt/sources.list either with your preferred text editor or package manager.
+
 
+
  deb http://ppa.launchpad.net/cae-team/ppa/ubuntu intrepid main
+
 
+
Then you have to update your repository list, for example with
+
 
+
<bash>
+
sudo apt-get update
+
</bash>
+
 
+
After that you can install openfoam and paraview just by typing
+
 
+
<bash>
+
sudo apt-get install openfoam paraview
+
</bash>
+
 
+
In order to get OpenFOAM running, add the following line to your ~/.bashrc
+
 
+
  alias startOF15="source /usr/lib/OpenFOAM-1.5/etc/bashrc"
+
 
+
And each time you want to use OpenFOAM just type '''''startOF15''''' in the active terminal.
+
 
+
===OpenFOAM-dev-1.5 under Ubuntu Lucid 10.04 LTS ===
+
{{VersionInfo}}{{Version1.5}}
+
 
+
In order to install the OpenFOAM-dev-1.5 version as debian package under Ubuntu Lucid 10.04 LTS you have to add the PPA repository from the CAE-Team:
+
 
+
<bash>
+
sudo add-apt-repository ppa:cae-team/ppa
+
</bash>
+
 
+
Then you have to update your repository list, for example with
+
 
+
<bash>
+
sudo apt-get update
+
</bash>
+
 
+
After that you can install the openfoam-dev-1.5 package just by typing
+
 
+
<bash>
+
sudo apt-get install openfoam-dev-1.5
+
</bash>
+
 
+
In order to get OpenFOAM running, add the following line to your ~/.bashrc
+
 
+
  alias startOF15dev="source /usr/lib/OpenFOAM-1.5-dev/etc/bashrc"
+
 
+
And each time you want to use OpenFOAM just type '''''startOF15dev''''' in the active terminal.
+
 
+
===Debian===
+
 
+
You can check, if you can install the openfoam binaries, like with Ubuntu Intrepid 8.10. If this not applies, e.g. due to dependency problems, then you have to add the following line to the /etc/apt/sources.list
+
 
+
  deb-src http://ppa.launchpad.net/cae-team/ppa/ubuntu intrepid main
+
 
+
Update you repository list
+
 
+
<bash>
+
sudo apt-get update
+
</bash>
+
 
+
After adding this line, you have to compile the debian source package of openfoam and/or paraview at your own by typing
+
 
+
<bash>
+
apt-get -b source openfoam
+
</bash>
+
 
+
and/or
+
 
+
<bash>
+
apt-get -b source openfoam-dev-1.5
+
</bash>
+
 
+
and/or
+
 
+
<bash>
+
apt-get -b source parafoam
+
</bash>
+
 
+
For further information about debian source packages, follow [http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html these guidlines].
+
 
+
In order to get OpenFOAM running, add the following line to your ~/.bashrc
+
 
+
  alias startOF15="source /usr/lib/OpenFOAM-1.5/etc/bashrc"
+
 
+
And each time you want to use OpenFOAM just type '''''startOF15''''' in the active terminal.
+
 
+
 
+
===Debian Etch in Server Mode===
+
{{VersionInfo}}{{Version1.6}}
+
The following description is to compile and install OpenFOAM 1.6 on Debian Etch in server mode without parafoam. This is useful for clusters and remote computers.
+
====Needed Packages====
+
The following packages need to be installed in order to start compiling.
+
* '''bison'''
+
* '''flex'''
+
* '''git''' (only if installing OpenFOAM 1.6.x)
+
* '''git-core''' (only if installing OpenFOAM 1.6.x)
+
* '''python-dev'''
+
* '''libqt4-dev'''
+
* '''libreadline5-dev'''
+
* '''build-essential'''
+
* '''zlib1g-dev'''
+
* '''texinfo'''
+
* '''byacc'''
+
* '''cmake'''
+
* '''gcc-multilib''' (only if installing 32bit)
+
 
+
The next thing to download are the general packages for openfoam, meaning OpenFOAM-1.6.General.gtgz and ThirdParty-1.6.General.gtgz from the OF website. Unpack both packages into a OpenFOAM folder in the your home directory.
+
 
+
Following, find out which openmpi version is run on the computer by running
+
mpirun -version
+
Get the appropriate version from http://www.open-mpi.org/. The old versions are available. Unpack that one as well into your home folder.
+
 
+
====Building====
+
In order to build OF, the '''settings.sh''' in '''OpenFOAM/OpenFOAM-1.6/etc/''' must be edited.
+
 
+
The compiler must read OpenFOAM as in
+
# Select compiler installation
+
# compilerInstall = OpenFOAM | System
+
compilerInstall=OpenFOAM
+
 
+
At the part for the openmpi it should read
+
 
+
mpi_version=openmpi-1.1.4 #put your mpi version here
+
#    export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
+
      export MPI_HOME=/path/to/downloaded/mpi/$mpi_version
+
      export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS
+
 
+
The correct path should be included here.
+
 
+
After setting the correct settings, gcc needs to be compiled. This works with the gcc that is provided. But the following must be done to the file makeGCC in the folder OpenFOAM/ThirdPart-1.6/. Replace the content with this tweaked version from the forum (http://www.cfd-online.com/Forums/openfoam/69915-compilation-error-openfoam-1-6-a.html#post239968)
+
 
+
#---------------------------------*- sh -*-------------------------------------
+
# =========                |
+
# \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
+
#  \\    /  O peration    |
+
#  \\  /    A nd          | Copyright (C) 1991-2009 OpenCFD Ltd.
+
#    \\/    M anipulation  |
+
#------------------------------------------------------------------------------
+
# License
+
#    This file is part of OpenFOAM.
+
#
+
#    OpenFOAM is free software; you can redistribute it and/or modify it
+
#    under the terms of the GNU General Public License as published by the
+
#    Free Software Foundation; either version 2 of the License, or (at your
+
#    option) any later version.
+
#
+
#    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+
#    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+
#    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+
#    for more details.
+
#
+
#    You should have received a copy of the GNU General Public License
+
#    along with OpenFOAM; if not, write to the Free Software Foundation,
+
#    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#
+
# Script
+
#    makeGcc
+
#
+
# Description
+
#    Build script for gmp, mpfr and gcc-4.3.? and gcc-4.4.?
+
#
+
#------------------------------------------------------------------------------
+
usage() {
+
    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
+
    cat<<USAGE
+
 
+
usage: ${0##*/} <gcc-4.?.?> ...
+
 
+
* build gmp, mpfr and gcc-4.3.? and gcc-4.4.?
+
 
+
USAGE
+
    exit 1
+
}
+
 
+
if [ $# -ne 1 ]
+
then
+
    usage "gcc version not provided"
+
fi
+
 
+
 
+
#
+
# Set the number of cores to build on
+
#
+
WM_NCOMPPROCS=1
+
 
+
if [ -r /proc/cpuinfo ]
+
then
+
    WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
+
    [ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
+
fi
+
 
+
echo "Building on " $WM_NCOMPPROCS " cores"
+
 
+
GMP_DIR=$WM_THIRD_PARTY_DIR/gmp-4.2.4
+
MPFR_DIR=$WM_THIRD_PARTY_DIR/mpfr-2.4.1
+
GCC_DIR=$WM_THIRD_PARTY_DIR/$1
+
 
+
GMPROOT=${GMP_DIR}/platforms/$WM_ARCH$WM_COMPILER$WM_COMPILER_ARCH
+
MPFRROOT=${MPFR_DIR}/platforms/$WM_ARCH$WM_COMPILER$WM_COMPILER_ARCH
+
GCCROOT=${GCC_DIR}/platforms/$WM_ARCH$WM_COMPILER$WM_COMPILER_ARCH
+
 
+
#
+
# Build GMP
+
#
+
if [ ! -d $GMPROOT ]
+
then
+
    (
+
      if [ ! -d "$GMP_DIR/build" ]; then mkdir $GMP_DIR/build; fi \
+
    && cd $GMP_DIR/build \
+
    && if [ -e Makefile ]; then make distclean; fi \
+
    && ../configure ABI=$ABI --prefix=$GMPROOT \
+
    && make -j $WM_NCOMPPROCS \
+
    && make install
+
    )
+
    echo "    Finished building gmp."
+
else
+
    echo "    gmp already built."
+
fi
+
 
+
export LD_LIBRARY_PATH="$GMPROOT/lib:$LD_LIBRARY_PATH"
+
 
+
#
+
# Build MPFR
+
#
+
if [ ! -d $MPFRROOT ]
+
then
+
    (
+
      if [ ! -d "$MPFR_DIR/build" ]; then mkdir $MPFR_DIR/build; fi \
+
    && cd $MPFR_DIR/build \
+
    && if [ -e Makefile ]; then make distclean; fi \
+
    && ../configure ABI=$ABI --prefix=$MPFRROOT --with-gmp=$GMPROOT \
+
    && make -j $WM_NCOMPPROCS  \
+
    && make install
+
    )
+
    echo "    Finished building mpfr."
+
else
+
    echo "    mprf already built."
+
fi
+
 
+
export LD_LIBRARY_PATH="$MPFRROOT/lib:$LD_LIBRARY_PATH"
+
 
+
#
+
# Build GCC
+
#
+
if [ ! -d $GCCROOT ]
+
then
+
    (
+
      if [ ! -d "$GCC_DIR/build" ]; then mkdir $GCC_DIR/build; fi \
+
    && cd $GCC_DIR/build \
+
    && if [ -e Makefile ]; then make distclean; fi \
+
    && ../configure --enable-languages=c,c++ --with-pkgversion='OpenFOAM' \
+
      --enable-__cxa_atexit --enable-libstdcxx-allocator=new \
+
      --with-system-zlib --prefix=$GCCROOT \
+
      --with-mpfr=$MPFRROOT --with-gmp=$GMPROOT \
+
    && make -j $WM_NCOMPPROCS \
+
    && make install
+
    )
+
    echo "    Finished building gcc."
+
else
+
    echo "    gcc already built."
+
fi
+
 
+
# ----------------------------------------------------------------- end-of-file
+
 
+
=Paraview and paraFoam=
+
 
+
==Troubleshooting paraFoam==
+
{{VersionInfo}}{{Version1.5}}
+
 
+
If you have problems with paraFoam and the dev version you might have to recompile paraFoam (see http://www.opencfd.co.uk/openfoam/doc/README.html#Paraview). If paraFoam loads, but doesn't know which reader to use to display your OpenFoam results, recompiling the PV3FoamReader should suffice.
+
 
+
To do so, first make sure the environment variable $ParaView_INST_DIR contains the correct path (in my version of OF-1.5-dev there was a typo, a wrong "-"). If not, correct it in ~/OpenFOAM/OpenFOAM-1.5-dev/etc/apps/paraview3/bashrc and re-source ~/.bashrc. Then proceed with ./Allwclean and ./Allwmake in ~/OpenFOAM/OpenFOAM-1.5-dev/applications/utilities/postProcessing/graphics/PV3FoamReader.
+

Latest revision as of 12:11, 26 July 2015

The old instructions are still available here: Installation/Installation (old monolithic version)



1 Introduction

This page aims to gather all possible instructions for installing as many versions, forks and variants of OpenFOAM technology and in as many Operating Systems as possible, for example:


This is where this Installation page steps in: provides a community based effort for documenting how to install OpenFOAM related technology (OpenFOAM, foam-extend, etc...) on any and all Operating Systems, along with more detailed instructions where possible. Keep in mind that this effort is constantly ongoing and may be slower than desired. If you want to help, please refer to the chapter How to help.

Since installing OpenFOAM related technology can be a rather extensive subject, specially due to the many OSes and respective versions, it has been divided into categories listed in the following Table of Contents:

2 Installing OpenFOAM

This is the tree of the categories and respective sub-categories about installing OpenFOAM technology:


Notes:

  • Click the + symbols for expanding the branches on the tree, the - symbols for collapsing expanded branches.
  • You'll find two types of branches:
    1. Branches that list sub-categories.
    2. Branches that list pages themselves.
  • The tree list is automatically generated and probably is not complete, since it's constantly ongoing.


3 Installing Third-Party software

This is the tree of the categories and respective sub-categories about installing Third-Party software which is meant for using with OpenFOAM:


4 Other Details

This is the tree of the pages with other details related to installing OpenFOAM and other third-party applications:


5 Outdated Instructions

This is the tree of outdated pages related to installing OpenFOAM and other third-party applications:


6 How to help

The effort for this new page structure is being talked about on this thread: [Discussion] Restructuring the Installation page at openfoamwiki.net - this is where you can ask questions on how the structure for this section of the openfoamwiki.net is kept.

On each main OS page you should find instructions on how to add new pages and what is the structure to be respected. Said OS pages are:


For the other 2 sets of category pages, here are the instructions for each one:

  • Other Details: these pages are to be added directly in the Installation sub-pages section.
    For example, for a page about the Shell Environment, the page should be Installation/Shell Environment.
    The category marker given in these pages should be:
    [[Category:Installing OpenFOAM - Other Details]]
  • Outdated Instructions : these pages are also to be added directly in the Installation sub-pages section.
    For example, for a page about installing FoamX, the page should be Installation/FoamX.
    The category marker given in these pages should be:
    [[Category:Installing OpenFOAM - Outdated Instructions]]