From 84eaa68425807a490f363d2e5ddf9bee3d362b0d Mon Sep 17 00:00:00 2001 From: "Allen.Dou" Date: Thu, 21 Mar 2024 00:28:29 +0800 Subject: [PATCH] Abort when nvcc command is not found in the PATH (#3527) --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29a531d4..150fcebe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,12 @@ endif() # append_cmake_prefix_path("torch" "torch.utils.cmake_prefix_path") +# Ensure the 'nvcc' command is in the PATH +find_program(NVCC_EXECUTABLE nvcc) +if (NOT NVCC_EXECUTABLE) + message(FATAL_ERROR "nvcc not found") +endif() + # # Import torch cmake configuration. # Torch also imports CUDA (and partially HIP) languages with some customizations,