Difference between revisions of "Installation/Linux/OpenFOAM-dev"

From OpenFOAMWiki
(Added section "Steps for updating" and updated version instructions for the git.php links)
(Steps for updating: foam3rdParty was deprecated: http://bugs.openfoam.org/view.php?id=2112)
Line 56: Line 56:
  
 
In the bug report [http://www.openfoam.org/mantisbt/view.php?id=1941 #1941], a new (relatively) easy way to update your development build to the latest is as follows:
 
In the bug report [http://www.openfoam.org/mantisbt/view.php?id=1941 #1941], a new (relatively) easy way to update your development build to the latest is as follows:
<bash>foam3rdParty
+
<bash>cd $WM_THIRD_PARTY_DIR
 
git pull
 
git pull
 
foam
 
foam

Revision as of 15:54, 10 June 2016

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


1 Introduction

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

In the following chapters and sections is explained how to generally install OpenFOAM-dev (the development version released by the OpenFOAM Foundation) and related dependencies, such as ParaView:

For dedicated instructions (complete and/or partial) for each Linux Distribution:

Installation/Linux/OpenFOAM-dev/CentOS SL RHELInstallation/Linux/OpenFOAM-dev/CentOS SL RHEL/6.10 (SCL)Installation/Linux/OpenFOAM-dev/CentOS SL RHEL/6.8
Installation/Linux/OpenFOAM-dev/FedoraInstallation/Linux/OpenFOAM-dev/RaspbianInstallation/Linux/OpenFOAM-dev/Ubuntu
Installation/Linux/OpenFOAM-dev/openSUSEInstallation/Linux/OpenFOAM-dev/openSUSE/Leap 15.1

Note: This repository is in constant development, therefore these instructions need to be revised more often than with the stable and bug fix versions.


2 About the development version

In case you're wondering what is the difference between the repository OpenFOAM-dev that is provided by the OpenFOAM Foundation, versus all other versions:

  • For example, starting with the version 2.4.0, this is considered to be a stable release that was launched for the main version 2.4. This specific version won't change over time.
  • The version 2.4.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.
  • In comparison with the previous two versions, the OpenFOAM-dev and ThirdParty-dev repositories provide the development for the next major version of OpenFOAM.

So in essence, the development version is the bleeding edge in the development of OpenFOAM, which allows one to contribute to the next version of OpenFOAM that is in development. This enables the following capabilities:

  • Earlier access to new features, before the next major version is made.
  • Higher probability of having bugs fixed.
  • When there is a new feature in the development repository, it's just a matter of updating the local code repository.
  • When reporting a bug, this is the version that is sometimes used as a reference, although not always. 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.
  • For more details on how to contribute: OpenFOAM Development

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

  • Very early access to a higher probability of new bugs.
  • Things can change a lot more than stable and bug fix versions.
  • Advised only for those who truly need the bleeding edge and/or want to collaborate closer with the development version.


3 Installing from source code

At the time of this writing (14:02, 27 February 2016 (CET)), the closest official instructions for this repository are the ones for the bug fix version: Repository Release - version 3.0.x

A few details to keep in mind:

  1. As already implied on the chapter About the development version, there are probably a lot of differences in building the development versions versus the bug fix version, but the work flow should still be the same. The main difference is that the repository for the source code is usually always the same, namely:
    git clone https://github.com/OpenFOAM/OpenFOAM-dev.git
  2. You should also clone the repository for the ThirdParty-dev folder from the respective repository:
    git clone https://github.com/OpenFOAM/ThirdParty-dev.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-dev.
  3. 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.
  4. As of OpenFOAM 2.2.0, the minimum required GCC version is 4.5.0, but this can easily change in this repository as time passes by. This implies one of the following situations:
    1. You should use a recent Linux Distribution, so that it can provide a recent GCC version.
    2. Or you should get familiar with building GCC from source code.
    3. When in doubt, you can always check the Installation/Compatibility Matrix page for information on compatible compilers.
  5. 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

4 Steps for updating

In the bug report #1941, a new (relatively) easy way to update your development build to the latest is as follows:

cd $WM_THIRD_PARTY_DIR
git pull
foam
git pull
./Allwmake -update -j 4 > log.make 2>&1