diff --git a/mtl-ofi-fix-missing-definition-of-container_of.patch b/mtl-ofi-fix-missing-definition-of-container_of.patch new file mode 100644 index 0000000..231c0b4 --- /dev/null +++ b/mtl-ofi-fix-missing-definition-of-container_of.patch @@ -0,0 +1,24 @@ +commit 75b6dad5959ba75fcba8c64cc0a364d820e03ebc +Author: Nicolas Morey +Date: Fri Dec 20 12:44:38 2024 +0100 + + mtl: ofi: fix missing definition of container_of + + Signed-off-by: Nicolas Morey + +diff --git ompi/mca/mtl/ofi/mtl_ofi_request.h ompi/mca/mtl/ofi/mtl_ofi_request.h +index f68c2a91baa0..6d748fd59bdc 100644 +--- ompi/mca/mtl/ofi/mtl_ofi_request.h ++++ ompi/mca/mtl/ofi/mtl_ofi_request.h +@@ -15,6 +15,11 @@ + + #include "mtl_ofi.h" + ++#ifndef container_of ++#define container_of(ptr, type, field) \ ++ ((type *) ((char *)ptr - offsetof(type, field))) ++#endif ++ + #define TO_OFI_REQ(_ptr_ctx) \ + container_of((_ptr_ctx), struct ompi_mtl_ofi_request_t, ctx) + diff --git a/openmpi4.changes b/openmpi4.changes index a0a0f2a..ea11ff3 100644 --- a/openmpi4.changes +++ b/openmpi4.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Dec 20 11:46:32 UTC 2024 - Nicolas Morey + +- Add mtl-ofi-fix-missing-definition-of-container_of.patch to fix + compilation with libfabric >= 2.0 (jsc#PED-9661, jsc#PED-10668) + ------------------------------------------------------------------- Tue Nov 26 07:12:00 UTC 2024 - Nicolas Morey diff --git a/openmpi4.spec b/openmpi4.spec index 0e59c39..724059e 100644 --- a/openmpi4.spec +++ b/openmpi4.spec @@ -148,6 +148,7 @@ Patch1: orted-mpir-add-version-to-shared-library.patch Patch2: btl-openib-Add-VF-support-for-ConnectX-4-5-and-6.patch Patch3: openmpi4-C99.diff Patch4: test-datatype-partial.c-fix-compiler-warnings.patch +Patch5: mtl-ofi-fix-missing-definition-of-container_of.patch Provides: mpi BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf