1st May 2016

OpenFOAM Repo: 1. Software for Compilation

The following supporting software is required to download, compile and run OpenFOAM from one of the source repositories.

  • Compiler: either GCC version 5.4 or above; or LLVM Clang version 3.6 or above; or the Intel oneAPI DPC++/C++ Compiler version 2021.3.0 or above. GCC is most commonly available and the version can be checked by typing
    gcc --version
  • FLEX fast lexical analyser, used by OpenFOAM for reading files of third-party formats.
  • cmake build software for compiling ParaView, the third-party visualisation toolkit
  • QT cross-platform application software, version 5.6 or above, used by ParaView.
  • Git distributed version control software used for the OpenFOAM source repositories.
  • OpenMPI message passing interface for parallel computation.

Installing dependent packages on Ubuntu (versions 18.04 or above, earlier versions not supported)

  • Install packages for repositories and compilation
    sudo apt-get install build-essential cmake git ca-certificates
  • Install general packages for OpenFOAM
    sudo apt-get install flex libfl-dev bison zlib1g-dev libboost-system-dev libboost-thread-dev libopenmpi-dev openmpi-bin gnuplot libreadline-dev libncurses-dev libxt-dev
  • Install packages for ParaView
    sudo apt-get install libqt5x11extras5-dev libxt-dev qt5-default qttools5-dev curl

Installing on SuSE (OpenSuSE/SLES v12 or above, or Tumbleweed)

  • Install general packages for OpenFOAM
    sudo zypper install -t pattern devel_C_C++
    sudo zypper install git-core cmake boost-devel gnuplot mpfr-devel openmpi-devel glu-devel
  • Install packages for ParaView
    sudo zypper install libQtWebKit-devel libqt4-devel qt4-assistant-adp-devel qt4-x11-tools
  • Either log out and log in again, or source the script by typing in the terminal
    source /etc/profile.d/

Installing on RedHat Enterprise Linux (RHEL)

The RHEL distribution generally contains old versions of software packages.  For example,  the latest version of RHEL 7 contains GCC version 4.8.5.  This cannot compile OpenFOAM which requires at least version 5.4+ of GCC, released in 2017.  An upgrade may be available under a support subscription, otherwise the instructions to upgrade RHEL from packages in unofficial repositories may enable compilation and running of OpenFOAM on RHEL.

Up: Main Page ↑ | Next: 2. Downloading the OpenFOAM Source Code