Skip to content

Compiling OpenFOAM.com v2212

This is documentation on building OpenFOAM. To use, see OpenFOAM.

Documentation

Build

  • Errors when compiled with icc
  • Successful build and simple test when compiled with gcc

Intel Composer XE

  • icc/icpc

Build error:

Internal error loop: assertion failed: find_seq_in_lookup_table: seq_number not found (shared/cfe/edgcpfe/il.c, line 4293)

compilation aborted for db/IOstreams/Pstreams/IPBstreams.C (code 4)
make: *** [/ifs/opt/openfoam-com/v2212/OpenFOAM-v2212/wmake/rules/General/transform:38: /ifs/opt/openfoam-com/v2212/OpenFOAM-v2212/build/linux64IccDPInt32Opt/src/OpenFOAM/db/IOstreams/Pstreams/IPBstreams.o] Error 4

GCC

Build success.

NVIDIA Compiler

Use nvhpc/21.2

Fail.

========================================
Compile OpenFOAM libraries
========================================
    ln: OpenFOAM/lnInclude
    ln: OSspecific/POSIX/lnInclude
    found <sys/inotify.h>  --  enabling inotify for file monitoring.
wmake libo (POSIX)
    dep: printStack.C
    dep: fileMonitor.C
    dep: fileStat.C
    dep: regExpPosix.C
    dep: timer.C
    dep: sigWriteNow.C
    dep: sigStopAtWriteNow.C
    dep: sigQuit.C
    dep: sigInt.C
    dep: sigSegv.C
    dep: sigFpe.C
    dep: memInfo.C
    dep: cpuTimePosix.C
    dep: cpuInfo.C
    dep: POSIX.C
    Ctoo: POSIX.C
nvc++-Error-Unknown switch: -iquote.
make: *** [/ifs/opt_cuda/openfoam-com/v2212/OpenFOAM-v2212/wmake/rules/General/transform:38: /ifs/opt_cuda/openfoam-com/v2212/OpenFOAM-v2212/build/linux64NvidiaDPInt32Opt/src/OSspecific/POSIX/POSIX.o] Error 1

Third Party

Mesa

Mesa sources are not distributed along with the Third Party tarball. Download appropriate version (18.3.6) from here:

https://gitlab.freedesktop.org/mesa/mesa/-/tags?search=18&sort=updated_desc

Example script to call wmake is makeMesa.example and makeMesa.picotte. The distributed one refers to mesa 18.3.4.

[juser@picotte001 ThirdParty-xxx]$ module load ninja glslang llvm/15.0.7 picotte-openmpi/gcc/4.1.4 python/gcc/3.10 cmake git
[juser@picotte001 ThirdParty-xxx]$ ./makeMesa.picotte

Use newer Mesa 22.3.7 downloaded manually.

Modify makeMesa:

--- makeMesa.orig       2022-12-20 05:14:11.000000000 -0500
+++ makeMesa    2023-03-15 01:47:03.186851000 -0400
@@ -329,9 +329,13 @@

     cd "$PKG_SOURCE" && set -x && \
     meson "$PKG_BUILD" \
+        --buildtype=release \
         --prefix="$PKG_PREFIX" \
         -Dplatforms=x11 \
-        -Dosmesa=gallium \
+        -Dosmesa=true \
+        -Dopengl=true \
+        -Dllvm=enabled \
+        -Dshared-llvm=enabled \
         -Dgallium-drivers=swrast \
         -Ddri-drivers=[] \
         -Dvulkan-drivers=[] \

Create makeMesa.picotte:

#!/bin/sh

mesa=mesa-22.3.7

set -x
./makeMesa \
    $mesa
    "$@"

#------------------------------------------------------------------------------

ParaView

Cannot make the Qt GUI because it wants Qt 5.12 while we have Qt 5.11.1

Create script makeParaView.picotte:

#!/bin/sh
# An example for building particular combinations of ParaView with
# - mpi (0 = no upper-limit on processes)
# - mesa
# - python (required for Catalyst)
# - has VTK_PYTHON_OPTIONAL_LINK=OFF to avoid
#       undefined symbol: PyExc_ValueError
#
# NOTE: must modify etc/config.*/paraview to use this particular version
# and combination, or use chaining as per etc/config.*/example/paraview

# mesa=mesa-11.2.2
# mesa=mesa-13.0.3
# mesa=mesa-17.1.1
# mesa=mesa-18.3.6
mesa=mesa-22.3.7

set -x
./makeParaView \
    -mpi \
    -mesa-prefix $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa \
    -python \
    -python-include /ifs/opt/python/gcc/3.10/include/python3.10 \
    -python-lib /ifs/opt/python/gcc/3.10/lib \
    -suffix mesa-mpi-py \
    -DPARAVIEW_ENABLE_FFMPEG=OFF \
    -DVTK_PYTHON_OPTIONAL_LINK=OFF \
    "$@"

#------------------------------------------------------------------------------