diff --git a/third_party/gpus/cuda/hermetic/BUILD.tpl b/third_party/gpus/cuda/hermetic/BUILD.tpl index 103465b..8ff4d66 100644 --- a/third_party/gpus/cuda/hermetic/BUILD.tpl +++ b/third_party/gpus/cuda/hermetic/BUILD.tpl @@ -326,10 +326,9 @@ selects.config_setting_group( ], ) -cc_library( - # This is not yet fully supported, but we need the rule - # to make bazel query happy. +alias( name = "nvptxcompiler", + actual = "@cuda_nvcc//:nvptxcompiler", ) alias( diff --git a/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl b/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl index e311c43..249cb31 100644 --- a/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl +++ b/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl @@ -84,6 +84,14 @@ cuda_nvcc_feature( ], ) +%{multiline_comment} +cc_import( + name = "nvptxcompiler_static_library", + hdrs = ["include/nvPTXCompiler.h"], + static_library = "lib/libnvptxcompiler_static.a", +) +%{multiline_comment} + cc_library( name = "headers", %{comment}hdrs = glob([ @@ -99,3 +107,10 @@ cc_library( strip_include_prefix = "include", visibility = ["@local_config_cuda//cuda:__pkg__"], ) + +cc_library( + name = "nvptxcompiler", + %{comment}deps = [":nvptxcompiler_static_library"], + visibility = ["@local_config_cuda//cuda:__pkg__"], +) + diff --git a/third_party/gpus/cuda/hermetic/cuda_nvjitlink.BUILD.tpl b/third_party/gpus/cuda/hermetic/cuda_nvjitlink.BUILD.tpl index 5ca20a2..79ba79b 100644 --- a/third_party/gpus/cuda/hermetic/cuda_nvjitlink.BUILD.tpl +++ b/third_party/gpus/cuda/hermetic/cuda_nvjitlink.BUILD.tpl @@ -14,10 +14,16 @@ cc_import( hdrs = [":headers"], shared_library = "lib/libnvJitLink.so.%{libnvjitlink_version}", ) + +cc_import( + name = "nvjitlink_compiler", + hdrs = ["include/nvJitLink.h"], + static_library = "lib/libnvJitLink_static.a", +) %{multiline_comment} cc_library( name = "nvjitlink", - %{comment}deps = [":nvjitlink_shared_library"], + %{comment}deps = [":nvjitlink_shared_library", ":nvjitlink_compiler"], %{comment}linkopts = if_cuda_newer_than( %{comment}"13_0", %{comment}if_true = cuda_rpath_flags("nvidia/cu13/lib"),