OpenFOAM depends to a certain extent on third-party libraries (opensource only). It also provides some interfaces to opensource or proprietary libraries. This third-party package contains configurations and scripts for building third-party packages. It should normally only be used in conjunction with the corresponding OpenFOAM version.
For most of the build scripts, the default software version
is provided by an appropriate OpenFOAM etc/config.sh/... entry.
This approach avoids duplicate entries for the default versions and
ensures the best overall consistency between the OpenFOAM installation
and its corresponding third-party installation.
Nonethess, the distributed make scripts can generally be used for a variety of versions of the third-party libraries, with the software version specified on the command-line.
- Review the system requirements
and decide on the following:
- compiler type/version (you may need a third-party compiler installation).
 - MPI type/version.
 - ParaView type/version.
 - CMake type/version, ...
 
 - Adjust the OpenFOAM 
etc/bashrc,etc/config.sh/...or equivalentprefs.shfiles to reflect your preferred configuration. - Source the updated OpenFOAM environment
 
Many components of ThirdParty are optional or are invoked
automatically as part of the top-level OpenFOAM Allwmake.
Nonetheless it may be necessary or useful to build particular
ThirdParty components prior to building OpenFOAM itself.
makeGccormakeLLVM(optional)makeCmake(optional)Allwmake- This will be automatically invoked by the top-level OpenFOAM 
Allwmake. 
- This will be automatically invoked by the top-level OpenFOAM 
 makeParaView(optional)- Any other additional optional components
 
If the Allwmake is being invoked directly (not from the OpenFOAM Allwmake),
it may be necessary to bootstrap the binary parts of the wmake toolchain
manually before proceeding. This is done with the following command:
$WM_PROJECT_DIR/wmake/src/Allmake
It normally advisable to skip the ParaView compilation initially.
Building ParaView from source tends to be the most difficult part of any third-party compilation.
For general functionality, the paraview version distributed with the operating system or a binary package may be sufficient for your needs.
- More details can be found the ThirdParty BUILD.md information.
 - Some configuration details can be found in the OpenFOAM doc/Config.md information.
 
When building other libraries directly, with autoconfig or cmake, it
will be useful or necessary to use the same compiler and compiler
settings as are used by OpenFOAM itself. These are obtained from the
wmake show options and can be used to set corresponding environment
variables. For example,
CC="$(wmake -show-c)" CFLAGS="$(wmake -show-cflags)" ./configure
Here is the correspondence to commonly used environment variables
| Env variable | Obtaining from wmake | Meaning | 
|---|---|---|
| CC | wmake -show-c | 
C compiler | 
| CFLAGS | wmake -show-cflags | 
C compiler flags | 
| CXX | wmake -show-cxx | 
C++ compiler | 
| CXXFLAGS | wmake -show-cxxflags | 
C++ compiler flags | 
wmake -show-cflags-arch | 
Architecture information when linking | |
wmake -show-cxxflags-arch | 
Architecture information when linking | 
In some situations it can also be useful to have the compiler and flags
together (similar to mpicc -show and mpicxx -show):
wmake -show-compile-c
wmake -show-compile-cxx
Copyright 2016-2019 OpenCFD Ltd