diff --git a/mpcdf_common.py b/mpcdf_common.py
index a28a095cdf122049f5901dd774e2f63dd1d6d22d..ea1467e2d9f85c53b0d01cb08609a010ed4119c9 100644
--- a/mpcdf_common.py
+++ b/mpcdf_common.py
@@ -810,9 +810,10 @@ Macros:
                     dependencies = ((project, compiler),)
                     if not parent:
                         dependencies = openmpi_flavor_dependencies(of, distribution) + dependencies
+                    flavor_kind = re.sub("(_[0-9]+)*$", "", of)
                     repo(mpi + "_" + compiler + "_" + of, dependencies, mpi=True,
                          mpi_repository=mpi, mpi_module=mpi_module(mpi),
-                         openmpi_flavor=of)
+                         openmpi_flavor=flavor_kind)
 
     for cuda in cudas:
         for compiler in filter(partial(valid_cuda, cuda), compilers):