leezu edited a comment on issue #17293: [Build] Add a reasonable default for CMAKE_CUDA_COMPILER in *nix URL: https://github.com/apache/incubator-mxnet/pull/17293#issuecomment-575337042 @larroy, yes it's required to check the environment variables (both `CUDACXX` and `PATH`) first before "falling back" to some default path. But it may be hard check both environment variables correctly. So let's just rely on cmake to figure out if it can find nvcc by standard means. Then only if this fails, fall back to the path. Thus I suggest the following approach instead ``` cmake check_language(CUDA) if (NOT CMAKE_CUDA_COMPILER_LOADED AND UNIX AND EXISTS "/usr/local/cuda/bin/nvcc") set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc") message(WARNING "CMAKE_CUDA_COMPILER guessed: ${CMAKE_CUDA_COMPILER}") endif() ``` It should be placed at the same position as the changes done in this PR.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
