Close

1st May 2016

OpenFOAM Repo: 4. Third Party Software

OpenFOAM relies on third-party software packages for some important tasks:

  • Scotch, PT-Scotch and Zoltan for domain decomposition and redistribution for parallel running. This is essential for non-trivial geometries for which simpler bisection-based methods produce inefficient decompositions.
  • ParaView visualization application. This is essential for interactive pre- and post-processing, but may not be required on a remote compute-only resource.
  • OpenMPI for communicating between processes of a parallel run.

OpenFOAM’s third-party repository, downloaded in 2. Downloading Source Code, contains scripts and source files for compiling these packages.  By default, system packages are used for most software.  Some packages are included as source files in the third-party repository, which are compiled automatically along with OpenFOAM. 

Therefore, for the standard compilation with default options, simply move on to the instructions in 5. Compiling OpenFOAM

If, however, the user wishes to deviate from the default configuration, the following instructions explain how to do so.

Scotch/PT-Scotch and Zoltan

OpenFOAM is configured by default to compile Scotch and Zoltan locally in the third-party directory. Source files for Scotch v6.0.9 and Zoltan v3.90 are included within the third-party repository, and they are built automatically with the rest of OpenFOAM.

If a different version of either of these packages is needed, then the SCOTCH_VERSION and/or ZOLTAN_VERSION environment variables can be set. OpenFOAM can pick up these variables from a prefs.sh file within a $HOME/.OpenFOAM directory, i.e. a .OpenFOAM (Note the dot) sub-directory of the user’s $HOME directory. For example, to build a prefs.sh file which changes the version of both Scotch and Zoltan:

mkdir -p $HOME/.OpenFOAM 
echo "export SCOTCH_VERSION=6.0.6" >> $HOME/.OpenFOAM/prefs.sh 
echo "export ZOLTAN_VERSION=3.83" >> $HOME/.OpenFOAM/prefs.sh

Source packs of the relevant versions will also need to be downloaded and extracted into the third-party directory. Scotch and/or Zoltan will then be compiled as part of step 5. Compiling OpenFOAM.

If a system installation is preferred for either of these packages, then the relevant environment variable,  SCOTCH_TYPE and/or ZOLTAN_TYPE, can be set to system. Many operating systems provide multiple Scotch, PT-Scotch and Zoltan packages, and differentiate between them by placing them in non-standard locations. If that is the case, then the variables SCOTCH_INCLUDE_DIR, SCOTCH_LIB_DIR, PTSCOTCH_INCLUDE_DIR, PTSCOTCH_LIB_DIR, ZOLTAN_INCLUDE_DIR and ZOLTAN_LIB_DIR can be used to specify the exact locations of the headers and libraries needed by OpenFOAM.

Scotch and Zoltan can also be deactivated entirely by setting SCOTCH_TYPE and/or ZOLTAN_TYPE to none.

ParaView

OpenFOAM is configured by default to use the system installation of ParaView, which should already have been installed as part of 1. Software for Compilation, so typically no additional steps are needed.  If a system ParaView is not available, or is unusable for some reason, then OpenFOAM can be configured to use a local build of ParaView within the third-party directory. This is done by setting the ParaView_TYPE environment variable to ThirdParty. As with the decomposition libraries, this this is most conveniently achieved with a prefs.sh file:

mkdir -p $HOME/.OpenFOAM
echo "export ParaView_TYPE=ThirdParty" >> $HOME/.OpenFOAM/prefs.sh

ParaView will then need to be built in the third-party directory. The third-party repository provides a script for doing this. It can be executed as follows, where 5.11.2 is the ParaView version number.

./makeParaView -version 5.11.2

This script will download the sources automatically before compiling. Note that on some systems the path to the qmake executable has a non-standard name and therefore also needs to be explicitly specified; e.g.:

./makeParaView -version 5.11.2 -qmake $(which qmake-qt5)

Following compilation, update the environment by sourcing the .bashrc (or .cshrc) file as described in 3. Setting the Environment, or by typing:

wmRefresh

As with the decomposition libraries, ParaView_TYPE can also be set to none to deactivate use of ParaView entirely. There is also a ParaView_VERSION variable that can be set to control exactly which version in the third-party directory is to be used.

OpenMPI

OpenFOAM is configured by default to use the system installation of OpenMPI, which should already have been installed as part of 1. Software for Compilation, so no additional steps are needed.  OpenMPI can be compiled using the third-party system, but it is set by default to version 2.1.1.  To compile OpenMPI v2.1.1, the WM_MPLIB environment variable should be set to OPENMPI through a prefs.sh file as follows.

echo "export WM_MPLIB=OPENMPI" >> $HOME/.OpenFOAM/prefs.sh

A source pack of OpenMPI v2.1.1 must be downloaded and extracted into the third-party directory.  OpenMPI will then be compiled as part of step 5. Compiling OpenFOAM.

← Back: 3. Setting the OpenFOAM Environment | Up ↑ | Next: 5. Compiling OpenFOAM