Linux, Unix-like systems
Older versions use a general build guide webpage, which will be replaced by alternative content in the future.
|openSUSE science||package openfoam, download||Actively maintained by OpenCFD||notes|
|Fedora/CentOS/RedHat copr||package openfoam||In development by OpenCFD||notes|
|Debian science||package openfoam - see debian search and tracker||Maintained independently, with input from OpenCFD||notes|
|spack||package openfoam||Actively maintained by OpenCFD||notes|
|EasyBuild||package OpenFOAM||Maintained independently, with input from OpenCFD|
Package structure (RPM)
To allow smooth installation and use of multiple OpenFOAM versions on the same system, we use the following structure:
|openfoam||The top-level meta package that provides links and requirements for the most recent openfoam release|
|openfoam-selector||Similar to mpi-selector, used to switch active openfoam versions|
|openfoam1906||The maintenance version for 1906|
|openfoam1812||The maintenance version for 1812|
The version-specific packages (eg,
install into distinct directories so that it is possible to have
multiple versions available on your systems.
openfoam package registers which of the
version-specific packages corresponds to the current release.
$ openfoam-selector --list openfoam openfoam1806 openfoam1812 openfoam1906
To set a particular version
$ openfoam-selector --set openfoam1906
To query the current selection:
$ openfoam-selector --query
Most people will find the
openfoam-selector-menu more convenient to
WARNING: Changes made to the openfoam-selector defaults will not be visible until you start a new shell!
NOTE Similar to the behaviour of the mpi-selector, the values
registered via the
openfoam-selector will not be activated until the
next full login. This is to avoid a possible clash of environments
when a parallel job still being launched. Of course, you can still
simply source the corresponding
bashrc file directly. For example,
$ source /opt/openfoam1906/etc/bashrc
Depending on how your packaging system has done things, an
session command may be available as an alternative to the
On the openSUSE installation, for example:
/usr/bin/openfoam -> openfoam-1906 /usr/bin/openfoam-1812 /usr/bin/openfoam-1906 /usr/bin/openfoam-selector /usr/bin/openfoam-selector-menu
openfoam -help displays some useful information.
Calling it without any arguments opens an interactive bash session
with an OpenFOAM environment and your usual
$ openfoam Using: OpenFOAM-1906 (patch=191103) - see www.OpenFOAM.com Arch: linux64GccDPInt32Opt (mpi=openmpi-system) OpenFOAM shell session - use exit to quit OpenFOAM-1906:~/ mark$
If called with arguments, it will setup an OpenFOAM environment before executing a single command. For example,
$ blockMesh -help blockMesh: Command not found. $ openfoam blockMesh -help Usage: blockMesh [OPTIONS] Options: ...
Although the OpenFOAM environment is sourced after your home
~/.bashrc, it is advisable to ensure that there are no circular
references from within your
For openSUSE users, OpenCFD Ltd. is a maintainer on the community Science Portal and provides RPM binary packages for the most recent openfoam versions. The quick access is via the download page: https://software.opensuse.org//download.html?project=science&package=openfoam and follow the instructions there.
If you already have the Science repository registered on your system,
you should be able to install it directly with
sudo zypper install openfoam
Or with a graphical tool such as YaST2:
For RedHat-based system, OpenCFD Ltd. is currently using the copr infrastructure to provide RPM packages. Enable copr for openfoam as per the documentation shown on https://docs.pagure.org/copr.copr/how_to_enable_repo.html
For newer systems:
$ dnf copr enable openfoam/openfoam
$ yum install yum-plugin-copr $ yum copr enable openfoam/openfoam
- https://packages.debian.org/source/unstable/openfoam (unstable meaning newer)
- https://packages.debian.org/source/stable/openfoam (stable meaning newer)
Note that the Debian packages may have been created with applications in
/usr/bin and configuration files under
In this case, you may need to manually define the location of the
OpenFOAM directory as follows:
The installation of openfoam with spack will generally require the latest (development version) of spack. If this is available, you can install openfoam in various configurations and dependencies, but typically can simply install directly:
$ spack install openfoam
To help with RPM-based systems, the following content is provided for reference purposes, and to help when scripting:
The support for Darwin is complete, but is less well tested than Linux.
- The Darwin build (and operation) requires a case-sensitive file system, which is often created as a disk image and mounted (for older systems).
- Compilation uses the system clang compiler.
- ThirdParty CGAL will normally need to be compiled without mpfr/gmp.
This should be done manually prior to building OpenFOAM or other
cd $WM_THIRD_PARTY_DIR ./makeCGAL gmp-none mpfr-none
wmake/rules/darwin64Clang/CGALfile has been adjusted to eliminate references to gmp/mpfr libraries.