From 92ab334fea1c6541d32fd684e73ab0d9c942f876 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Mon, 4 Jul 2016 23:28:01 +0000 Subject: [PATCH] Fix build if libcuda is found but nvcc is not We require nvcc to be found by find_package, so this commit makes that explicit. Otherwise the code doesn't understand CUDA_MAJOR_VERSION, nor why we are setting cache variables that have no value to advanced. Change-Id: Id7ebde308d268bf225f4b1220bc2b20c0e3e6da1 --- cmake/gmxManageGPU.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/gmxManageGPU.cmake b/cmake/gmxManageGPU.cmake index 208b47f96d..a6b5439303 100644 --- a/cmake/gmxManageGPU.cmake +++ b/cmake/gmxManageGPU.cmake @@ -232,6 +232,10 @@ include(CMakeDependentOption) include(gmxOptionUtilities) macro(gmx_gpu_setup) if(GMX_GPU) + if(NOT CUDA_NVCC_EXECUTABLE) + message(FATAL_ERROR "nvcc is required for a CUDA build, please set CUDA_TOOLKIT_ROOT_DIR appropriately") + endif() + # set up nvcc options include(gmxManageNvccConfig) -- 2.11.4.GIT