From 78313a6d216486efebdba96a3c367fe763b26d26 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 26 Aug 2022 15:00:18 -0700 Subject: [PATCH] Use compatibility shim only with static cudart Closes issue 658 --- src/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index d658c35..1539e14 100644 --- a/src/Makefile +++ b/src/Makefile @@ -9,7 +9,7 @@ include ../makefiles/version.mk ##### src files INCEXPORTS := nccl.h nccl_net.h -LIBSRCFILES := init.cc channel.cc bootstrap.cc transport.cc enqueue.cc group.cc debug.cc proxy.cc enhcompat.cc net.cc \ +LIBSRCFILES := init.cc channel.cc bootstrap.cc transport.cc enqueue.cc group.cc debug.cc proxy.cc net.cc \ misc/cudawrap.cc misc/nvmlwrap.cc misc/ibvwrap.cc misc/gdrwrap.cc \ misc/utils.cc misc/argcheck.cc misc/socket.cc misc/shmutils.cc misc/profiler.cc misc/param.cc misc/strongstream.cc \ transport/p2p.cc transport/shm.cc transport/net.cc transport/net_socket.cc transport/net_ib.cc transport/coll_net.cc \ @@ -29,6 +29,12 @@ OBJDIR := $(BUILDDIR)/obj PKGDIR := $(BUILDDIR)/lib/pkgconfig ##### target files CUDARTLIB ?= cudart_static + +ifeq ($(CUDARTLIB), cudart_static) + # Use compatibility shim only with static cudart; see https://github.com/NVIDIA/nccl/issues/658 + LIBSRCFILES += enhcompat.cc +endif + INCTARGETS := $(INCEXPORTS:%=$(INCDIR)/%) LIBSONAME := $(LIBNAME:%=%.$(NCCL_MAJOR)) LIBTARGET := $(LIBNAME:%=%.$(NCCL_MAJOR).$(NCCL_MINOR).$(NCCL_PATCH))