mirror of
https://github.com/NVIDIA/nccl-tests.git
synced 2026-10-14 04:47:25 +00:00
Add a portable OS abstraction and CMake build entry points so the tests can build on Windows with MSVC and CUDA. Update the perf and verifiable sources to avoid POSIX-only APIs and compiler extensions where needed. Signed-off-by: Unmesh Deodhar <[email protected]>
36 lines
653 B
Makefile
36 lines
653 B
Makefile
#
|
|
# Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
|
|
#
|
|
# See LICENSE.txt for license information
|
|
#
|
|
|
|
include ../src/common.mk
|
|
|
|
.PHONY: build clean
|
|
|
|
BUILDDIR ?= ../build
|
|
DST_DIR := $(BUILDDIR)/os
|
|
|
|
ifneq ($(OS),Windows_NT)
|
|
OS_SRC := linux.cc
|
|
else
|
|
OS_SRC := windows.cc
|
|
endif
|
|
|
|
OBJ_FILES := $(OS_SRC:%.cc=${DST_DIR}/%.o)
|
|
|
|
build: ${DST_DIR}/libnccl_test_os.a
|
|
|
|
clean:
|
|
rm -rf ${DST_DIR}
|
|
|
|
${DST_DIR}/%.o: %.cc os.h
|
|
@printf "Compiling %-35s > %s\n" $< $@
|
|
@mkdir -p ${DST_DIR}
|
|
$(CXX) $(CXXFLAGS) -I../src -o $@ -c $<
|
|
|
|
${DST_DIR}/libnccl_test_os.a: $(OBJ_FILES)
|
|
@printf "Creating archive %-35s > %s\n" $^ $@
|
|
@mkdir -p ${DST_DIR}
|
|
ar rcs $@ $^
|