From 50b652b1815c9babb32b421c9b41ae1eec5c9df2 Mon Sep 17 00:00:00 2001 From: Nicholas Sielicki Date: Wed, 11 Sep 2024 17:08:17 -0700 Subject: [PATCH] fix(rdma): avoid lttng templates under extern "C" On builds where lttng is enabled, the inclusion of nccl_ofi_tracepoint.h pulls in , which defines templates when __cplusplus is defined without restraint. Those templates cannot have C linkage. This file does not really need nccl_ofi_tracepoint.h; it only needs config.h to test for whether NVTX tracing is enabled, and then it needs nvtx3 headers in the case that it is so that it may define storage for the nvtx domain handles. Signed-off-by: Nicholas Sielicki --- include/nccl_ofi_rdma.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/nccl_ofi_rdma.h b/include/nccl_ofi_rdma.h index 5c391b513..79928db72 100644 --- a/include/nccl_ofi_rdma.h +++ b/include/nccl_ofi_rdma.h @@ -9,6 +9,8 @@ extern "C" { #endif +#include "config.h" + #include #include "nccl_ofi.h" @@ -19,8 +21,10 @@ extern "C" { #include "nccl_ofi_deque.h" #include "nccl_ofi_freelist.h" #include "nccl_ofi_idpool.h" -#include "nccl_ofi_tracepoint.h" #include "nccl_ofi_ep_addr_list.h" +#if HAVE_NVTX_TRACING +#include +#endif /* Maximum number of rails supported. This defines the size of * messages exchanged during connection establishment (linear