Skip to content

Commit

Permalink
Symlink hermetic cuda headers to permit clang cuda version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tchatow committed Sep 14, 2024
1 parent 96b59eb commit 4643e2d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ def _create_libcuda_symlinks(
repository_ctx.symlink(nvidia_driver_path, "lib/libcuda.so.1")
repository_ctx.symlink("lib/libcuda.so.1", "lib/libcuda.so")

def _create_cuda_header_symlinks(repository_ctx):
if repository_ctx.name == "cuda_nvcc":
repository_ctx.symlink("../cuda_cudart/include/cuda.h", "include/cuda.h")

def use_local_path(repository_ctx, local_path, dirs):
# buildifier: disable=function-docstring-args
"""Creates repository using local redistribution paths."""
Expand Down Expand Up @@ -338,6 +342,7 @@ def _use_downloaded_cuda_redistribution(repository_ctx):
repository_ctx,
lib_name_to_version_dict,
)
_create_cuda_header_symlinks(repository_ctx)
repository_ctx.file("version.txt", major_version)

def _cuda_repo_impl(repository_ctx):
Expand Down

0 comments on commit 4643e2d

Please sign in to comment.