rules_cuda icon indicating copy to clipboard operation
rules_cuda copied to clipboard

Add attribute `strip_include_prefix`

Open hofbi opened this issue 2 years ago • 2 comments

Thank you for providing these nice rules for cuda. It would be great if the cuda_library and cuda_object would provide and implement the strip_include_prefix attribute and the rules_cc do: https://bazel.build/reference/be/c-cpp#cc_library.strip_include_prefix

hofbi avatar Aug 03 '23 16:08 hofbi

We were looking into the repo to see how we could implement the strip_include_prefix. Checking how rules_cc does it gave us https://bazel.build/versions/6.2.0/rules/lib/cc_common#compile, which has the strip_include_prefix as attribute. For this repo, it looks like you guys implemented your own compile function in https://github.com/bazel-contrib/rules_cuda/blob/main/cuda/private/actions/compile.bzl, hence I think it would make sense to add this attribute there.

Could you give some advise if we are on the right track here or wheter you would implement this differently?

hofbi avatar Aug 24 '23 09:08 hofbi

Yeah, if we are going to implement it, we should align it with cc_* rules.

For now, you can wrap you cuh headers with a cc_library first to achieve the purpose.

cloudhan avatar Aug 24 '23 10:08 cloudhan