Replies: 1 comment 3 replies
-
        Installation Notes for OpenFOAM and AdditiveFoam on HPC systemsThese notes provide a guide for compiling OpenFOAM from the source code, with specific instructions for configuring it with a system-installed MPI library and preparing it for use on a High-Performance Computing (HPC) system. First, the source code for OpenFOAM and its third-party packages need to be cloned into an  # make the OpenFOAM directory
mkdir -p /home/OpenFOAM
cd /home/OpenFOAM
# download source code
git clone https://github.com/OpenFOAM/OpenFOAM-10.git
git clone https://github.com/OpenFOAM/ThirdParty-10.git1. OpenFOAM Third-Party DependenciesWhen compiling OpenFOAM, it's important to manage its third-party package (TPL) dependencies. The necessary source files and build scripts are located in the  While the OpenFOAM documentation often mentions ParaView for visualization, it is not a mandatory dependency for compiling and running the software, especially on remote compute-only resources. Other essential packages like Scotch/PT-Scotch for domain decomposition are typically compiled automatically from the  2. Configuring OpenFOAM with a System-Installed MPITo ensure OpenFOAM uses a system-installed MPI library such as MPICH, you will need to modify the shell environment. While you can directly edit the  MPICH ExampleAdd the following configuration to your  # Set mpi root directory
export MPI_ROOT=$MPICH_DIR
# To prevent conflicts with the C++ compiler bindings,
# it is recommended to set the following flag for MPICH-based MPIs.
export MPI_ARCH_FLAGS="-DMPICH_SKIP_MPICXX"
# Set the include and library paths to your system's MPI installation.
# The $MPI_ROOT environment variable should point to the base directory of your MPI installation.
export MPI_ARCH_INC="-I$MPI_ROOT/include"
export MPI_ARCH_LIBS="-L$MPI_ROOT/lib -lmpich -lrt"
# Instruct OpenFOAM to use the system-installed MPI library.
export WM_MPLIB=SYSTEMMPINote: The paths and library names ( 3. Managing Floating-Point ExceptionsOpenFOAM includes a feature to trap floating-point exceptions (FPE), which can be useful for debugging but may cause simulations to terminate unexpectedly. This is controlled by the  export FOAM_SIGFPE=unset4. Platform-Specific Compiler Configuration (OLCF Frontier)On certain HPC systems with specialized programming environments, such as OLCF Frontier which uses the Cray Programming Environment, you may need to modify the compiler flags and specify the compiler toolchain. First, set the  # Use the Clang compiler toolchain
export WM_COMPILER=ClangSetting this variable ensures that OpenFOAM's build system ( Next, you should edit the following files within that directory to add flags required by the Cray compiler wrappers: 
 These changes ensure that the Cray compiler wrappers are invoked correctly for the Frontier architecture. 5. Compiling OpenFOAM in ParallelThe standard  For a parallel build, use the following command: ./Allwmake -j -q6. Configuring AdditiveFoam for HPC EnvironmentsWhen running the examples and tutorials for AdditiveFoam on an HPC system, you may need to adapt the run scripts to the specific job scheduler in use (e.g., SLURM, LSF). The tutorial scripts often utilize  On many HPC systems, jobs must be submitted through a scheduler command like   | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion will serve as a centralized place for addressing OpenFOAM-specific build issues, keeping them separate from the main AdditiveFOAM branch, to better support users facing similar challenges.
Beta Was this translation helpful? Give feedback.
All reactions