Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit ea03ea3

Browse files
committed
only use ccache for nvcc when an alias exists
Older versions of ccache, distributed by many operating systems, may not have a link for nvcc. The build script only checks for ccache presence, and not for the nvcc alias before overwriting CUDA_NVCC_EXECUTABLE cmake variable, which leads to nvcc not being found. Check if nvcc ccache alias is indeed present instead.
1 parent 2cd56da commit ea03ea3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function install_caffe2() {
275275
CMAKE_ARGS+=("-DCUDA_ARCH_NAME='Maxwell'")
276276
fi
277277

278-
if [[ $(which ccache | wc -c) -ne 0 ]]; then
278+
if [[ -L ${CCACHE_WRAPPER_DIR}/nvcc && $($(readlink ${CCACHE_WRAPPER_DIR}/nvcc) --version | grep ccache | wc -c) -ne 0 ]]; then
279279
CMAKE_ARGS+=("-DCUDA_NVCC_EXECUTABLE=${CCACHE_WRAPPER_DIR}/nvcc")
280280
fi
281281

0 commit comments

Comments
 (0)