Installation/Linux/OpenFOAM-2.1.x

From OpenFOAMWiki
< Installation‎ | Linux
Revision as of 20:09, 8 September 2015 by Wyldckat (Talk | contribs)

Maintainer
The current maintainer of this page is Wyldckat (talk).


1 Introduction

This page aims to explain how to install OpenFOAM OF Version 21x.png on any Linux Distribution.

In the following chapters and sections is explained how to generally install OpenFOAM 2.1.x and related dependencies, such as ParaView:


2 Dedicated instructions

Currently the following sub-pages exist with complete and/or partial instructions for specific Linux Distributions:

Installation/Linux/OpenFOAM-2.1.x/Ubuntu


3 About the bug fix version

In case you're wondering what is the difference between the versions 2.1.0, 2.1.1 and 2.1.x:

  • The versions 2.1.0 and 2.1.1 are the stable releases that were launched for the main version 2.1. These releases do not change over time.
  • The version 2.1.x is the bug fix version, which is regularly updated overtime, at least until the next major release of OpenFOAM is released.
    • This version is also known as: the git version; the repository version.

So in essence, the version bug fix version 2.1.x allows one to stay the most up-to-date possible of OpenFOAM's latest source code. This enables the following capabilities:

  • Earlier access to new features, before the next stable release is made.
  • Higher probability of having bugs fixed.
  • When a bug is fixed, it's just a matter of updating the local code repository.
  • When reporting a bug, this is the version that is used as a reference. More specifically, the commit hash is used for keeping track of where in time is your code snapshot (for more, read the chapter Installing from source code).
  • Makes it easier to learn how one can keep track of his/her own changes to the OpenFOAM source code.

Nonetheless, there are some downsides of using the bug fix version:

  • Early access to new bugs.
    • Yes, some bug fixes can introduce new bugs.
  • Some features may be removed, since a bug might have been spotted that would indicate that said feature is incorrect.
  • Not advised for using in a cluster or shared machine environment, since global installations of the bug fix version can get a bit onerous over time!


4 Installing from source code

The official instructions are made available here: Repository Release - version 2.1.x

A few details to keep in mind:

  1. As already implied on the chapter About the bug fix version, there are only a few differences in building 2.1.x, 2.1.0 and 2.1.1. The main difference is how the source code is downloaded and how you can keep up with updates that are made to the changes made on OpenFOAM's git repository, namely:
    git clone https://github.com/OpenFOAM/OpenFOAM-2.1.x.git
    • You can also choose to download the ThirdParty-2.1.x folder from the respective repository:
      git clone https://github.com/OpenFOAM/ThirdParty-2.1.x.git
      In which case, you will need to also manually download the packages as listed in the README.html or README.org files in the downloaded folder ThirdParty-2.1.x.
  2. When you need to update your local clone, for getting the latest source code updates, you can follow the instructions provided in the page Installation/Working with git repositories.
  3. For the minimum required GCC version, please check the Installation/Compatibility Matrix page for information on compatible compilers.
  4. When it comes to ParaView, it's possible to avoid the need to build it from source code. If your Linux Distribution provides ParaView 3.12.0 or newer, you don't need to build ParaView from source code. Simply run:
    paraFoam -builtin
    and it will open the case in ParaView.
    • If the previous command worked, you can add the following alias command in your ~/.bashrc file:
      alias paraFoam='paraFoam -builtin'
    • In case you have an old Linux Distribution and still don't want to build ParaView from source code, get the latest binary version for Linux from ParaView's official website. Then add to your ~/.bashrc file the following line (adapt accordingly):
      export PATH=$HOME/Downloads/ParaView-4.2.0/bin:$PATH