Documentation access will be interrupted from time to time due to some bug correction.

Page tree
Skip to end of metadata
Go to start of metadata

This document gathers various pieces from the official documentation to help you compile swak4Foam on the SCITAS clusters.

Prepare the ground

  1. Load the required modules:

    module load gcc python mvapich2 openblas mercurial openfoam-com
  2. Then, create a folder to host the swak4Foam source code. For example,

    mkdir $HOME/OpenFoam
    cd $HOME/OpenFoam

    and get the source:

    git clone swak4Foam
    cd swak4Foam

Get m4 and Bison

Even though both m4 and bison are already installed, swak4Foam requires specific versions of them. To avoid any problem, we will download and compile them. The following assumes that you are in the $HOME/OpenFoam/swak4Foam folder.

  1. Download, unpack, compile and install m4:

    tar -xf m4-1.4.17.tar.gz
    cd m4-1.4.17
    ./configure --prefix $PWD/../m4
    make install
    cd ..
  2. Now, we need to prepend the path to the newly compiled m4 to the PATH variable to make sure we use the correct version:

    export PATH=$PWD/m4/bin:$PATH
  3. swak4Foam comes with a script that will check the version of bison and download it if necessary. Simply run (still in the swak4Foam folder):


Make sure OpenFoam is correctly loaded

The following is a known issue, see the official installation documentation for more information.

  1. Make sure OpenFoam is loaded:

    module load openfoam-com
  2. Run the following commands to create a directory and a file that exports a few path variables:

    mkdir $HOME/.OpenFOAM
    echo 'export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin' >> $HOME/.OpenFOAM/
    echo 'export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib'  >> $HOME/.OpenFOAM/
    echo 'export PATH=$PATH:$FOAM_USER_APPBIN'  >> $HOME/.OpenFOAM/
    source $HOME/.OpenFOAM/
  3. Please note that now, whenever you load the OpenFoam module to use swak4Foam, you will need to source the file. For example:

    module load openfoam-com
    source $HOME/.OpenFOAM/

Compile swak4Foam

  1. Go in the swak4Foam folder and create a link to the configuration file:

    ln -s swakConfiguration.automatic swakConfiguration
  2. Execute Allwmake to compile (this will be long):

  3. Now to check the compilation, go to your home folder where there should be a new OpenFoam directory in which you will find the bin folder containing various swak4Foam binaries. Try to execute:


    This ends with an error message, but below the usual OpenFOAM banner you will find the version of swak4Foam and the release date.