diff --git a/pkgs/by-name/op/openmpi/package.nix b/pkgs/by-name/op/openmpi/package.nix index 719247b58a43..9baf7dd3b6c8 100644 --- a/pkgs/by-name/op/openmpi/package.nix +++ b/pkgs/by-name/op/openmpi/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, removeReferencesTo, gfortran, perl, @@ -47,6 +48,17 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-vUGD/LxDR3wlR5m0Kd8abldsBC50otL4s31Tey/5gVc="; }; + patches = [ + # This patch can be removed with the next openmpi update (>5.0.6) + # See https://github.com/open-mpi/ompi/issues/12784 and https://github.com/open-mpi/ompi/pull/13003 + # Fixes issue where the shared memory backing file cannot be created because directory trees are never created + (fetchpatch { + name = "fix-singletons-session-dir"; + url = "https://github.com/open-mpi/ompi/commit/4d4f7212decd0d0ca719688b15dc9b3ee7553a52.patch"; + hash = "sha256-Mb8qXtAUhAQ90v0SdL24BoTASsKRq2Gu8nYqoeSc9DI="; + }) + ]; + postPatch = '' patchShebangs ./