Skip to content

OpenFoam Installation#

Building openfoam with cray-mpich and gcc#

Instructions for installing OpenFoam are available here.

In the instructions, you will be cloning the OpenFoam folder which we will refer to as $OPENFOAM.

In order to build Openfoam with cray-mpich, 2 files need to be edited.

1- $OPENFOAM/etc/bashrc

In this file, the variable WM_MPLIB will be defined as MPICH. Search for the line where the variable is exported and replace it with


2- $OPENFOAM/etc/

This file defines where mpich is defined on the system. You will search for the Mpich definition block and replace it with

    export MPI_ARCH_PATH=/opt/cray/pe/mpich/8.1.28/ofi/gnu/10.3
    export PATH="${MPI_ARCH_PATH}/bin:${PATH}"
    export FOAM_MPI=mpich-8.1.28
    export MPI_HOME=/opt/cray/pe/mpich/8.1.28/ofi/gnu/10.3
    #export FOAM_MPI=mpich2-1.1.1p1

    _foamAddPath    $MPI_ARCH_PATH/bin

    # 64-bit on OpenSuSE 12.1 uses lib64 others use lib
    _foamAddLib     $MPI_ARCH_PATH/lib

    _foamAddMan     $MPI_ARCH_PATH/share/man

Before you install openfoam, make sure to load Prgenv-gnu. This will load gcc and cray-mpich. Make sure the same module is loaded at runtime.