Build OPM Flow as a pure native Windows binary (MSVC PE — no WSL, Cygwin, or MSYS), both serial and parallel (MPI + Zoltan).
This repo is just the build harness: scripts, the detailed guide, the small
Windows compatibility shims, the DUNE patches, and a CI workflow. It does not
contain the OPM / DUNE / Trilinos sources — build-all.ps1 clones those into
src/, deps/, and vcpkg/ (all git-ignored) when you run it.
Status: validated end-to-end from a clean checkout — serial and 2-rank MPI runs of SPE1 pass (see VALIDATION.md).
The bundled flow-gui workbench (Windows / Linux / macOS), here on the Norne benchmark case:
| Run queue with live progress | Summary plotting & case comparison |
|---|---|
![]() |
![]() |
| 3D results viewer | Deck editor |
![]() |
![]() |
- Windows 10/11 x64;
gitandwingeton PATH; ~15 GB free disk; internet. - Toolchain (one-time) — VS 2022 C++ build tools + Windows SDK + CMake + Ninja
(approve the UAC prompt):
winget install --id Microsoft.VisualStudio.2022.BuildTools -e ` --accept-package-agreements --accept-source-agreements ` --override "--quiet --wait --norestart ` --add Microsoft.VisualStudio.Workload.VCTools ` --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ` --add Microsoft.VisualStudio.Component.Windows11SDK.22621 ` --add Microsoft.VisualStudio.Component.VC.CMake.Project ` --includeRecommended"
- For MPI builds only — Microsoft MPI runtime + SDK:
winget install --id Microsoft.msmpi -e winget install --id Microsoft.msmpisdk -e
From a clone of this repo:
.\build-all.ps1Clones vcpkg + DUNE (v2.10.0) + OPM, applies the DUNE patches, installs deps, and
builds in order. Result: build\opm-simulators\bin\flow_blackoil.exe. Run it:
.\build\opm-simulators\bin\flow_blackoil.exe <deck>.DATA --output-dir=<dir>.\build-all.ps1 -Mpi
mpiexec -n 4 .\build-mpi\opm-simulators\bin\flow_blackoil.exe <deck>.DATA --output-dir=<dir>Builds Zoltan (from a Trilinos clone) + the MPI modules into separate
build-mpi\ / install-mpi\ trees (the serial build is untouched). See
BUILD_WINDOWS.md §13.
An alternative to MS-MPI, built into its own build-impi\ / install-impi\
trees so the MS-MPI build is untouched. Two reasons to prefer it:
- It needs no administrator rights. Its runtime installs into your own profile, where installing MS-MPI needs an administrator — which is what otherwise stops OPM Flow running at all on a managed work laptop, since the simulator links an MPI library even for serial runs.
- It measured faster — on a cool machine. On Norne, 4 ranks × 2 threads: 125 s of simulation time against 157 s for MS-MPI, with identical iteration counts. Note that the assembly time fell by about as much as the linear solve did, and assembly is local compute — so some of that gain is likely Intel MPI's default process pinning rather than faster message passing. The measurement is only reproducible when the laptop starts cold: after an hour of builds the same binaries ranged from 170 s to 253 s run to run, MS-MPI and Intel MPI overlapping, and an eight-minute idle did not restore the cold-start pace. On the charger but already warm (CPU clocks 68-83 % of base under the 8-thread load), a same-day pair gave 272 s for MS-MPI and 258 s for Intel MPI: the same ordering, 5 % apart, far off the cold pace. Measure before relying on the difference.
python -m pip install --user impi-rt impi-devel # no administrator needed
.\build-intelmpi.ps1 -Jobs 8pip installs the runtime under %APPDATA%\Python\Library, which Windows does
not search, so anything using it has to put that directory on PATH first —
flow-gui does so for the simulators it launches, and the packaged
bin\flow-impi.cmd does it for terminal use.
The Intel MPI runtime is not redistributed in the packages: OPM Flow is
GPLv3 and Intel MPI is proprietary, so shipping them together raises a
licensing question this project does not try to answer. Users install it
themselves with the one pip command above — the same posture the MS-MPI
package takes by shipping Microsoft's installer rather than msmpi.dll.
The Windows/MSVC fixes to opm-common/opm-grid/opm-simulators (and opm-upscaling,
with -Upscaling) must be present in the sources. They are maintained on the
windows branch of each fork below, rebased onto upstream master as it moves,
so point the build there (the DUNE patches in patches/ are applied
automatically regardless):
.\build-all.ps1 -Mpi -OpmOrg GitPaean -OpmBranch windows.\build-all.ps1 -Mpi # parallel build (MPI + Zoltan)
.\build-all.ps1 -OpenMP # OpenMP threading (/openmp:llvm)
.\build-all.ps1 -Mpi -OpenMP # hybrid MPI + OpenMP
.\build-all.ps1 -SimTarget all # build every flow_* variant (full suite), not just flow_blackoil
.\build-all.ps1 -Upscaling # also clone + build opm-upscaling (upscale_* / cpchop tools)
.\build-all.ps1 -SkipClone # sources already cloned
.\build-all.ps1 -SkipDeps # vcpkg packages already installed (still installs any that are missing)
.\build-all.ps1 -Jobs 6 # parallel compile jobs per module (default 4; raise on a high-RAM machine)
.\build-all.ps1 -DuneVersion v2.10.0
.\build-all.ps1 -OpmOrg <user> -OpmBranch <branch>-Mpi and -OpenMP are independent and compose. For hybrid runs use
mpiexec -n <ranks> flow_blackoil <deck> --threads-per-process=<threads>.
Intel MPI is selected per module rather than through build-all.ps1, since it
uses its own build trees:
.\build-intelmpi.ps1 -Jobs 8 # the whole chain, Zoltan included
.\build-module.ps1 opm-simulators -IntelMpi -OpenMP -Target flow -Jobs 8
.\package-flow.ps1 -IntelMpi -Zip # package that build (runtime not bundled)The weekly Windows workflow builds opm-common, opm-grid and opm-simulators against both MPI implementations. It runs Norne with 4 MS-MPI ranks x 1 OpenMP thread and 2 Intel MPI ranks x 2 OpenMP threads. The two decompositions exercise MPI and hybrid MPI/OpenMP execution; the workflow does not compare output arrays with a Linux reference.
Each run records the harness commit and each OPM module's cloned fork commit,
fetched upstream commit and resolved commit after any rebase in
source-revisions.json. Download it from the opm-source-revisions artifact;
it is also included with a successful flow-windows-x64 binary artifact. Once
source resolution has completed, the revision artifact is uploaded even if a
rebase conflict or later build failure prevents a binary from being produced.
| Path | Purpose |
|---|---|
build-all.ps1 |
One-shot driver — the entry point (serial or -Mpi) |
build-module.ps1 |
Configure/build/install one module with the MSVC flags (-Mpi, -IntelMpi, -OpenMP) |
build-intelmpi.ps1 |
The whole chain against Intel MPI, into build-impi\ — no administrator rights needed |
setup-env.ps1 |
Loads MSVC (vcvars64) + vcpkg (+ MS-MPI) into the shell |
compat/include/ |
POSIX/Fortran shim headers MSVC lacks (getopt, unistd, sys/*, FCMacros) |
patches/ |
DUNE Windows patches, auto-applied after the DUNE checkout |
probes/ |
Stand-alone programs that each settle one question about the build (MS-MPI spawning, autodiff constants, C++-only package consumption); see its README |
build-clang.ps1 |
Build one module with clang-cl instead of MSVC, against the same DUNE/vcpkg tree; what the forks' smaller windows_clang branches are built with |
flow-gui/ |
The Qt 6 graphical workbench for flow (Windows/Linux/macOS): run/monitor with live progress, summary plotting & case comparison, 3D results viewer, deck editor, projects (see its README) |
package-flow.ps1 |
Stage a redistributable package (bin + runtimes + prerequisites) and zip it |
installer/ |
Inno Setup script producing OPM-Flow-<ver>-Setup.exe (see PACKAGING.md) |
packaging/ |
MSIX build script for sideloading / Microsoft Store (see PACKAGING.md) |
PACKAGING.md |
Distribution guide: portable zip, installer, MSIX/Store, licensing notes |
release-notes/ |
Per-release notes shown on the GitHub Releases page (e.g. v2026.10-pre.md); published with gh release edit --notes-file (see PACKAGING.md) |
ci/windows.yml |
GitHub Actions workflow |
.github/workflows/windows-weekly.yml |
Weekly build and Norne runs against both MPI implementations, with source revision records |
BUILD_WINDOWS.md |
Full step-by-step guide (§1–14): toolchain, deps, flags, MPI, patches, CI |
PATCHES.md |
Record of every source-level Windows/MSVC fix |
VALIDATION.md |
Clean-room validation walkthrough + results |
Ignored (cloned sources or generated build/packaging output): src/, deps/,
vcpkg/, build*/, install*/, dist/ (packaging output — staged trees, the
downloaded VC++/MS-MPI runtime installers, and the built Setup.exe/.zip/.msix),
and *.log.
The published Setup.exe / .zip are not code-signed, so Microsoft
SmartScreen shows a reputation warning (not a virus detection) — and it is
dismissible:
- Downloading (Edge/Chrome): if it says "isn't commonly downloaded", open the download's ⋯ menu → Keep, then Keep anyway.
- First launch: if "Windows protected your PC" appears, click More info → Run anyway.
The .exe installer only warns; the MSIX package, by contrast, is
blocked unless its signing certificate is already trusted on the target
machine — so prefer the Setup.exe (or the portable zip) for general use.
Code-signing the installer with an OV/EV certificate removes the warnings
altogether (see PACKAGING.md).
Copyright (C) 2026 SINTEF Digital, Mathematics & Cybernetics.
This repository (build scripts, documentation, compatibility shims, and the
flow-gui application) is licensed under the
GNU General Public License, version 3 or later — see LICENSE —
matching the OPM project it builds. The files in
patches/ modify DUNE sources and are therefore available under the licenses
of the respective DUNE modules (GPL-2 with runtime exception).
- The default target is
flow_blackoil(far less RAM/link time). Fullflow— the single exe with every model variant, which the release packages ship — comes with-SimTarget flow(or-SimTarget allfor the whole suite); linking it is memory-hungry, so keep-Jobsmodest. - The produced
.exeis native Win64 (PE32+); for distribution it needs the VC++ redistributable and, for MPI binaries, the MS-MPI runtime. See BUILD_WINDOWS.md §11.package-flow.ps1stages exactly these prerequisites next to the binaries automatically (see PACKAGING.md). - OpenMP is off by default; enable it with
-OpenMP(uses MSVC/openmp:llvm, independent of-Mpi). Threaded runs needlibomp140.x86_64.dllnext to the.exe; see BUILD_WINDOWS.md §11 / §13. Note that an OpenMP-enabledflowdefaults to 2 threads per process unless--threads-per-processis passed explicitly (flow-gui always passes it for this reason).



