This guide describes how to compile OpenFOAM v2512 natively on Apple Silicon macOS without Docker. The build described here produced native arm64 OpenFOAM binaries using Homebrew GCC and OpenMPI.
The main macOS-specific issue is that OpenFOAM should be built on a case-sensitive filesystem. The default macOS APFS volume is normally case-insensitive, which can cause include collisions such as OpenFOAM's wchar.H versus the system wchar.h.
The approach is: