-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cc_deps should use the new Starlark C++ API #31
Comments
@siddharthab Hi Thanks for writing this repo. I am trying to use it to do a Rcpp wrapper around some c++ code. The cc_deps were specified and it was observed that the cc dependencies were compiled when I run If not can you be a bit more explicit about how to use c++ dependencies in the doc? Many thanks. |
@Gawainus Do you have a src directory in your package with some C/C++ code? You will need to have that much for R to actually compile a dynamically linked library for you and include it in your package. |
@siddharthab No. To respect the existing code structure. I just did |
You just need something to trigger the compilation. |
I think this is completely resolved as part of c143bca. I will open a new issue for future API changes when they happen. |
Summary: We used to specify `-fPIC` in all cc builds which were dependencies of R packages because that is a requirement for linking in shared libraries, and bazel did not provide a way to specify a dependency on a PIC .a library. With the resolution of grailbio/rules_r#31, R rules for bazel now explicitly state their preference for a PIC build, and so we don't have to force all builds to be PIC. This also allows us to use the default `cc_proto_library` rules instead of the experimental ones from the protobuf repo. Test Plan: R package builds and tests pass. They used to fail before without `-fPIC`. Reviewers: ysaito Reviewed By: ysaito Maniphest Tasks: T12955 Differential Revision: https://phabricator.grailbio.com/D31313 fbshipit-source-id: caafb4a
See bazelbuild/bazel#4570 for progress on the API.
It is not quite ready yet, but this issue will track work on using the API to solve our long standing problem of obtaining PIC.
The text was updated successfully, but these errors were encountered: