In the following sections, text in boxes should be entered into your shell window.
Ensure that the system requirements are satisfied as described here, and make sure to source the correct OpenFOAM environment e.g. for version OpenFOAM-v1612+
A new build guide for third party libraries can be found in $WM_PROJECT_DIR/ThirdParty-v1612+/BUILD.md
Several build issues related to specific compiler and VTK library versions can be found in $WM_PROJECT_DIR/BuildIssues.txt
OpenFOAM is shipped with ParaView for post-processing OpenFOAM field results. This requires a separate compilation which can be omitted if using other post-processing software. To compile ParaView:
For most systems, CGAL is not normally installed or is likely to be an older version. We therefore recommend using CGAL from the ThirdParty source pack. This corresponds to the shipped settings in the etc/config.sh/CGAL file
In most cases, the system boost libraries can be used for OpenFOAM and for building CGAL. This corresponds to the shipped settings in the etc/config.sh/CGAL file
If, however, the system boost libraries are either not installed, too old, or are missing some components e.g. threaded support, it is recommended to switch to using boost from the ThirdParty source pack.
Combining a ThirdParty boost with a system CGAL is neither supported by the OpenFOAM build process, nor is it recommended.
The compilation process is self-contained and will compile and install all OpenFOAM code and dependencies.
- Test the system readiness foamSystemCheck
- Change to the main OpenFOAM directory ($WM_PROJECT_DIR). If this
fails, the environment is not configured correctly foam
- Compile OpenFOAM ./Allwmake
- In case you need to stop the compilation, continue later by running Allwmake again
For faster compilation, users can take advantage of multi-processor machines to build the code in parallel by setting the environment variable WM_NCOMPPROCS, e.g.
export WM_HOSTS="box1:4 box2:8"
export WM_NCOMPPROCS$($WM_SCHEDULER -count)
- WM_SCHEDULER - flag to use the scheduler
- WM_HOSTS - names of hosts and number of their CPUs to use
- WM_NCOMPPROCS - number of parallel processes
Note that the wmakeScheduler requires the lockfile utility. This can be installed using, e.g. on Ubuntu:
- Open a new shell and source the OpenFOAM environment to see all changes (refer to top of page)
- Validate the build by running foamInstallationTest
- Create the user run directory: mkdir -p $FOAM_RUN
- Test the installation with a simple tutorial: run
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily ./