Commit 23119366 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Brad King
Browse files

FindCUDA: Make nvcc configurable via CUDA_NVCC_EXECUTABLE env var



This is useful if, for example, you want ccache to be used
for nvcc.  With the current behavior, cmake always picks up
/usr/local/cuda/bin/nvcc, even if there is a ccache nvcc
stub in the PATH.  Allowing for CUDA_NVCC_EXECUTABLE lets
us work around the problem.
Signed-off-by: default avatarEdward Z. Yang <ezyang@fb.com>
parent 98f23da8
......@@ -733,7 +733,10 @@ endif()
# CUDA_NVCC_EXECUTABLE
cuda_find_host_program(CUDA_NVCC_EXECUTABLE
if(DEFINED ENV{CUDA_NVCC_EXECUTABLE})
set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler")
else()
cuda_find_host_program(CUDA_NVCC_EXECUTABLE
NAMES nvcc
PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
ENV CUDA_PATH
......@@ -741,8 +744,9 @@ cuda_find_host_program(CUDA_NVCC_EXECUTABLE
PATH_SUFFIXES bin bin64
NO_DEFAULT_PATH
)
# Search default search paths, after we search our own set of paths.
cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc)
# Search default search paths, after we search our own set of paths.
cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc)
endif()
mark_as_advanced(CUDA_NVCC_EXECUTABLE)
if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment