From 0cfcdc3ffdeeffbcb588ef0ad63811527fcff045 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 29 Nov 2017 15:03:28 +0000 Subject: [PATCH] Add the nvidia-cuda-toolkit Debian package path to search path Summary: Reported here: http://bugs.debian.org/882505 Patch by Andreas Beckmann Reviewers: Hahnfeld, tra Reviewed By: tra Subscribers: jlebar, cfe-commits Differential Revision: https://reviews.llvm.org/D40453 llvm-svn: 319317 --- clang/lib/Driver/ToolChains/Cuda.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp index 4a5cf3dc6aec..aea409fc2092 100644 --- a/clang/lib/Driver/ToolChains/Cuda.cpp +++ b/clang/lib/Driver/ToolChains/Cuda.cpp @@ -75,6 +75,11 @@ CudaInstallationDetector::CudaInstallationDetector( CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda"); for (const char *Ver : Versions) CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-" + Ver); + + if (Distro(D.getVFS).IsDebian()) + // Special case for Debian to have nvidia-cuda-toolkit work + // out of the box. More info on http://bugs.debian.org/882505 + CudaPathCandidates.push_back(D.SysRoot + "/usr/lib/cuda"); } for (const auto &CudaPath : CudaPathCandidates) {