diff --git a/config/buildSettings.mk b/config/buildSettings.mk index 3f9ea14a06ab33c956c1d52e2a81cd5c959f32f8..f258b829ac8ca71e0e0cc8ac2c15c47b971c1656 100644 --- a/config/buildSettings.mk +++ b/config/buildSettings.mk @@ -151,6 +151,7 @@ ifneq ($(shell which nvcc), ) # Link CUDA libraries statically, if compilation # was invoked with "make CUDA_STATIC=1". + _CUDALIBS = -lcuda ifdef CUDA_STATIC # The cuda/cudart libs are handled by nvcc. Other # components of the CUDA toolkit are provided as @@ -159,11 +160,11 @@ ifneq ($(shell which nvcc), ) # (see vars.mk) # Other CUDA toolkit components will be added here # on an as-needed basis. - NVCCFLAGS += --cudart=static - _CUDALIBS = $(subst -lcublas,-lcublas_static -lcublasLt_static -lculibos, \ + NVCCFLAGS += --cudart=static --cudadevrt=static + _CUDALIBS += $(subst -lcublas,-lcublas_static -lcublasLt_static -lculibos, \ $(subst -lcurand,-lcurand_static,${CUDALIBS})) else - NVCCFLAGS += --cudart=shared - _CUDALIBS = ${CUDALIBS} + NVCCFLAGS += --cudart=shared --cudadevrt=static + _CUDALIBS += ${CUDALIBS} endif endif