Skip to content

Commit 8274cb4

Browse files
authored
Merge pull request #96 from NVIDIA/nersc-linkage-fix
Add option to statically link cudart
2 parents 7130fa6 + de3ddbe commit 8274cb4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ DEBUG ?= 0
1212
CUDA_LIB ?= $(CUDA_HOME)/lib64
1313
CUDA_INC ?= $(CUDA_HOME)/include
1414
NVCC = $(CUDA_HOME)/bin/nvcc
15+
CUDARTLIB ?= cudart
1516

1617
CUDA_VERSION = $(strip $(shell which $(NVCC) >/dev/null && $(NVCC) --version | grep release | sed 's/.*release //' | sed 's/\,.*//'))
1718
CUDA_MAJOR = $(shell echo $(CUDA_VERSION) | cut -d "." -f 1)
@@ -36,7 +37,7 @@ endif
3637
NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -std=c++11
3738

3839
LDFLAGS := -L${CUDA_LIB} -lcudart -lrt
39-
NVLDFLAGS := -L${CUDA_LIB} -lcudart -lrt
40+
NVLDFLAGS := -L${CUDA_LIB} -l${CUDARTLIB} -lrt
4041

4142
ifeq ($(DEBUG), 0)
4243
NVCUFLAGS += -O3 -g
@@ -68,7 +69,7 @@ ifeq ($(MPI_IBM),1)
6869
NVCUFLAGS += -DMPI_SUPPORT
6970
NVLDFLAGS += -lmpi_ibm
7071
endif
71-
LIBRARIES += curand nccl nvToolsExt
72+
LIBRARIES += nccl
7273
NVLDFLAGS += $(LIBRARIES:%=-l%)
7374

7475
DST_DIR := $(BUILDDIR)

src/common.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <stdio.h>
1111
#include <cstdint>
1212
#include <algorithm>
13-
#include <curand.h>
1413
#ifdef MPI_SUPPORT
1514
#include "mpi.h"
1615
#endif
@@ -46,7 +45,6 @@ typedef enum {
4645
testInternalError = 1,
4746
testCudaError = 2,
4847
testNcclError = 3,
49-
testCuRandError = 4
5048
} testResult_t;
5149

5250
// Relay errors up and trace

0 commit comments

Comments
 (0)