OpenFOAM® v1706: New and updated build system


Updated wmake build tool

This version includes refinements to the wmake build system.

Intermediate targets are now built into a separate build/ directory instead of bundled into the platforms/ directory. This eases the task of, e.g. packaging various binary platforms, or building packages for installation via modules etc.. i]Intermediate build targets can be removed with a simple rm command or by using the wcleanBuild script.

In addition, it is now possible to use wmake and wclean using a file name as a target. This convenience means that

wmake some/path/filename.C

will behave similarly to

wmake some/path

The default action for the wcleanBuild and wcleanPlatform scripts is to ‘do nothing’ rather than removing the currently active platform. This helps to avoid removing files accidentally. Both of these scripts can also be executed from the top-level ThirdParty directory.


OpenCFD has added support for building OpenFOAM with the spack system — an open source tool that provides a simple interface to manage different versions and dependencies in a robust manner.

Spack resembles a Linux package manager except that it has been designed to manage different combinations of package variants and versions. More detailed reading and source code is available from:

Once installed, it is straightforward to query which versions and variants are available for a particular software package, e.g.:

spack info openfoam-com

And then just install it using:

spack install openfoam-com@1706

To see how spack resolves dependencies and which optional packages need to be installed, use one of these commands:

spack spec openfoam-com
spack spec openfoam-com@1706
spack spec -I openfoam-com@develop

Variants can be selected with a + or deselected with a ~. It is also possible to specify which version of dependencies should be used, e.g.

spack install openfoam-com@1706 +int64 ~paraview ~source ^openmpi@1.10.6

Would build and install OpenFOAM with 64-bit labels, without ParaView plugins, without the OpenFOAM source code and use openmpi 1.10.6.

Once OpenFOAM has been installed, the spack find command can be used to locate it:

$ spack find openfoam-com
==> 3 installed packages.
-- linux-opensuse13-x86_64 / gcc@4.8 ----------------------------

$ spack find -v openfoam-com@develop

==> 1 installed packages.
-- linux-opensuse13-x86_64 / gcc@4.8 ----------------------------

The spack modules support for OpenFOAM is in early development, and will be enhanced in the future. Currently it is possible to locate the OpenFOAM package and source as usual:

spack find --paths openfoam-com


VTK, ParaView versioning

Versioning has been added to VTK and ParaView libraries to allow better switching between versions without library symbol conflicts. This results in a build process that is now more robust to changes in the location of the ThirdParty directory.

Library paths

Improvements for the handling of lib/ vs lib64/ in more places.


The new foamCreateModuleInclude script in the feature-scripts community repository assists when creating a module for OpenFOAM.