-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add ability to specify library directories for target rpaths #295
Add ability to specify library directories for target rpaths #295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some minor changes.
I think this is a good starting place but we should change the separation of concerns.
I think we should have create_modules.cmake
just add the ORIGIN
rpath entry, and have a secondary function that you call providing a target, and a set of directories and it will add those as INSTALL_RPATHS.
So instead of having the logic look like:
set_lib_dirs( ..... ) # propagate stuff via side channels to create_modules
create_modules( )
We have
create_modules()
set_rpath_entries(<cython_target> <dirs>)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, have a couple of minor suggestions.
@gpucibot merge |
Description
Python extension modules built using scikit-build and rapids-cmake are typically designed around a model where a C++ library is built and the resulting Cython extension modules must link to it. While it is in principle possible to use both scikit-build and rapids-cmake with only Cython, that is not the case for any of the major RAPIDS packages. When the C++ component is built via scikit-build and installed into the final package, it must also be discoverable by the extension modules. Currently this is accomplished by propagating a variable
RAPIDS_CYTHON_CREATED_MODULES
fromrapids_cython_create_modules
that calling functions can use to get the list of targets whose RPATHs need updating, and setting these RPATHs is the responsibility of the caller. However, this approach is error-prone and frequently results in incorrect RPATH specifications.This PR automates the process by having the calling code provide a set of directories where compiled libraries may be placed. The RPATHs of all extension modules built via
rapids_cython_create_modules
are then automatically updated to include those library directories.Checklist
cmake-format.json
is up to date with these changes.include_guard(GLOBAL)
)