7
7
AM_CPPFLAGS = -I$(abs_top_srcdir ) /include
8
8
AM_CPPFLAGS += -isystem $(abs_top_srcdir ) /3rd-party
9
9
AM_CPPFLAGS += -isystem $(abs_top_srcdir ) /3rd-party/nccl/$(DEVICE_INTERFACE ) /include
10
- AM_CPPFLAGS += $(CUDA_CPPFLAGS )
10
+ AM_CPPFLAGS += $(CUDA_CPPFLAGS ) $( ROCM_CPPFLAGS )
11
11
AM_CPPFLAGS += -DXML_DIR=\"${pkgdatadir}/xml\"
12
12
13
13
sources = \
@@ -41,15 +41,21 @@ sources += platform-aws.cpp
41
41
endif
42
42
43
43
if ENABLE_NEURON
44
- sources += nccl_ofi_interface_neuron.cpp
45
- else
46
- sources += \
47
- nccl_ofi_cuda.cpp \
48
- nccl_ofi_interface_nvidia.cpp
44
+ sources += nccl_ofi_interface_neuron.cpp
45
+ endif
46
+
47
+ if HAVE_ROCM
48
+ sources += nccl_ofi_rocm.cpp nccl_ofi_interface_nvidia.cpp
49
+ endif
50
+
51
+ if HAVE_CUDA
52
+ sources += nccl_ofi_cuda.cpp nccl_ofi_interface_nvidia.cpp
53
+ endif
49
54
50
- # add the tuner sources into the library
55
+ # add the tuner sources into the library
56
+ if !ENABLE_NEURON
51
57
if WANT_PLATFORM_AWS
52
- sources += \
58
+ sources += \
53
59
tuner/nccl_ofi_regions.cpp \
54
60
tuner/nccl_ofi_tuner.cpp \
55
61
tuner/nccl_ofi_model.cpp
61
67
# us writing dlopen() handlers for simple unit tests.
62
68
noinst_LTLIBRARIES = libinternal_plugin.la
63
69
libinternal_plugin_la_SOURCES = $(sources )
64
- libinternal_plugin_la_LDFLAGS = -static $(CUDA_LDFLAGS )
65
- libinternal_plugin_la_LIBADD = $(CUDA_LIBS )
66
-
70
+ libinternal_plugin_la_LDFLAGS = $(CUDA_LDFLAGS ) $(ROCM_LDFLAGS )
71
+ libinternal_plugin_la_LIBADD = $(CUDA_LIBS ) $(ROCM_LIBS )
67
72
68
73
if ENABLE_NEURON
69
74
lib_LTLIBRARIES = libnccom-net.la
@@ -74,9 +79,9 @@ if ENABLE_NEURON
74
79
else
75
80
lib_LTLIBRARIES = libnccl-net-ofi.la
76
81
libnccl_net_ofi_la_SOURCES =
77
- libnccl_net_ofi_la_LIBADD = libinternal_plugin.la
82
+ libnccl_net_ofi_la_LIBADD = libinternal_plugin.la $( CUDA_LIBS ) $( ROCM_LIBS )
78
83
libnccl_net_ofi_la_LIBTOOLFLAGS = --tag=CXX
79
- libnccl_net_ofi_la_LDFLAGS = -module -avoid-version
84
+ libnccl_net_ofi_la_LDFLAGS = -module -avoid-version -Wl,--no-undefined
80
85
81
86
# We always install libnccl-net-ofi.so. To use the default shared library,
82
87
# either NCCL_NET_PLUGIN=libnccl-net-ofi.so or NCCL_NET_PLUGIN=ofi must be set.
@@ -102,7 +107,7 @@ if ENABLE_NCCL_NET_LIBRARY
102
107
libnccl_net_la_SOURCES =
103
108
libnccl_net_la_LIBADD = libinternal_plugin.la
104
109
libnccl_net_la_LIBTOOLFLAGS = --tag=CXX
105
- libnccl_net_la_LDFLAGS = -module -avoid-version
110
+ libnccl_net_la_LDFLAGS = -module -avoid-version -Wl,--no-undefined
106
111
endif
107
112
if WANT_PLATFORM_AWS
108
113
# NCCL standardized on the libnccl-tuner-<interface> format after we released a
@@ -120,4 +125,14 @@ if WANT_PLATFORM_AWS
120
125
libnccl_tuner_ofi_la_LDFLAGS = -module -avoid-version
121
126
endif
122
127
128
+ if HAVE_ROCM
129
+ install-exec-hook ::
130
+ @$(MKDIR_P ) $(DESTDIR )$(libdir )
131
+ @$(RM ) -f $(DESTDIR )$(libdir ) /librccl-net.so
132
+ @$(LN_S ) libnccl-net-ofi.so $(DESTDIR )$(libdir ) /librccl-net.so
133
+
134
+ uninstall-local ::
135
+ @$(RM ) -f $(DESTDIR )$(libdir ) /librccl-net.so
136
+ endif
137
+
123
138
endif
0 commit comments