[PATCH] D55269: [CUDA][OpenMP] Fix nvidia-cuda-toolkit detection on Debian/Ubuntu

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 4 14:47:27 PST 2018


jdenny added a comment.

In D55269#1319252 <https://reviews.llvm.org/D55269#1319252>, @tra wrote:

> It appears that what you're trying to do is to add "/usr/lib/cuda" on Ubuntu and Debian when --cuda-path=/usr is specified.
>  This is a rather odd thing to do.


My real goal is to get clang and openmp working out of the box on Ubuntu.  Treating --cuda-path=/usr as a special case was just a way to get there.  It's odd apparently because nvidia-cuda-toolkit is odd.

> In the end only one of those paths will be in effect and that's the path that should be specified via --cuda-path. The fact that you want to add /usr/cuda/lib in this case suggests that /usr is the wrong path and /usr/lib/cuda is the correct one. It sounds like you need to change your build system and tell clang the correct path.
> 
> I do not think that changing clang to work around an issue in cmake files of one project is something we want to do.

I don't have a separate project using cmake.  The cmake files I'm referring to are clang's.  I'm just trying to make it easy to build clang and openmp and call clang on the command line under Ubuntu.

> There is also an easy workaround. Just download CUDA SDK, install it into a local directory and point your build system there. This will work on any linux distribution.

An easier workaround is to specify CUDA_TOOLKIT_ROOT_DIR when building llvm, but my goal is make building on Ubuntu work without special configuration.  D40453 <https://reviews.llvm.org/D40453> was my hint that people already agreed that's a worthwhile pursuit.

I'm not adamant that handling --cuda-path=/usr is the right solution.  But just adding IsUbuntu() is not a full solution, so I'm looking for advice on how to proceed.

Thanks for your responses.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55269/new/

https://reviews.llvm.org/D55269





More information about the cfe-commits mailing list