OpenFOAM uses wmake to perform compilation (building, linking) of its C++ source code into local assembly code.
- all invocations can have an optional directory:
wmake $FOAM_UTILITIES/mesh/manipulation/checkMesh wmake libso $FOAM_SRC/finiteVolume
- wmake all
wmake all <dir>
will recursively build all applications in current or specified directory.
- wmake <target>, e.g.
will build just that taget
- distributed building: wmake comes with a simple scheduler, wmakeScheduler, which spawns a job on a free machine. It is currently set up to distribute only compilation of c,c++. Dependency building and linking gets done on the local machine.
It is set up with environment variables:
WM_SCHEDULER : the name of the scheduler to use
WM_HOSTS : the list of cores to use
WM_NCOMPROCS : the number of parallel builds (usually the size of WM_HOSTS)
WM_COLOURS : Optional : per entry in WM_HOSTS the colour to use. This is used in 'setterm -foreground XXX' ; for this to work I have to set my TERM environment variable to 'linux'.
Example to build on 1 processor of dm and 4 processors of noisy:
export WM_HOSTS="dm:1 noisy:4"
export WM_NCOMPPROCS=$($WM_SCHEDULER -count)
export WM_HOSTS="(dm:0 noisy:1 noisy:2 noisy:3 noisy:4)"