-
Notifications
You must be signed in to change notification settings - Fork 206
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
[REVIEW] Refine CMakeLists.txt to make it easy to be imported by external projects #541
Conversation
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
OK to test |
Please update the changelog in order to start CI tests. View the gpuCI docs here. |
@gigony in order for our CI tests to run, you will need to add an entry to CHANGELOG.md. |
@germasch since I know you are helping modernize RMM's cmake, can you take a look at this PR? |
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.
Looks good to me (the warnings about missing project
had annoyed me as well ;)
Me too, but I had wrongly assumed they stemmed from the underlying googletest cmake! |
- Change CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR - Change CMAKE_BINARY_DIR to CMAKE_CURRENT_BINARY_DIR - Add 'project' statement to suppress warning messages
- Use generator expression to refer the include folder depending on the case (build or install)
BTW, @gigony: Since you're starting to do |
Thanks for sharing the information! I am happy to discuss it though merging this pull request would satisfy my need in the project I am currently working on. In the recent revision of this pull request, I have addressed another issue (4. in #540) found while importing rmm in my project. Please help review it. |
Okay, that's good, so we're basically working on orthogonal things, you want to use rmm via
Whereas I'm not too familiar with what exactly happens there, I think it'll be fixed by #538 as that gets rid of the need to patch in the first place. |
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.
LGTM but I would like @kkraus14 to take a look.
@@ -155,8 +155,8 @@ SET_TARGET_PROPERTIES(rmm PROPERTIES BUILD_RPATH "\$ORIGIN") | |||
target_include_directories(rmm PUBLIC | |||
"${THRUST_INCLUDE_DIR}" |
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.
Should really move to using a target for this instead of CMake variables. This path likely won't resolve properly on the importing machine.
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.
@gigony's goal here is to have a consuming project use rmm via add_subdirectory(rmm)
. For that purpose, I think this will work, since the consuming project will be built at the same time, so the include path will still be there.
You're right that this isn't going to work for a installed version of rmm -- which is my goal (in future PRs). thrust is going to be particularly hasslesome for this, since there may could be three ways of using thrust (from the cudatoolkit, installed elsewhere externally, or included via FetchContent. And in addition, thrust
doesn't quite support the usual find_package()
way of pulling it in :(
But for now, I believe this PR supports @gigony's use case and shouldn't break anything.
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.
And in addition,
thrust
doesn't quite support the usualfind_package()
way of pulling it in :(
I believe this was changed as of Thrust 1.9.10, where there's now a nicer CMake target and the like: https://github.com/thrust/thrust/blob/main/thrust/cmake/README.md
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.
Yeah, I've seen that, but the "not quite the usual" thing is the thrust_create_target(...)
(which does exist for good reasons, though).
I think we'll be able to work with it, but the thing about it is that a find_package(rmm)
would pull in thrust
and would have to do a thrust_create_target()
internally, not exactly knowing what thrust variant the consuming application actually wants. It might not be a problem in the typical use case, but I think I can dream up issues where the application also makes a thrust target and one ends up pulling in thrust twice via different target names and with different configurations...
…t cugraph as an external project and other tech debt removal (#1367) This PR makes cuGraph's cmake files more consistent with other RAPIDS libs by matching the minimum required cmake version, adding `project()` statements to cugraph's thirdparty modules, and using `CMAKE_CURRENT_SOURCE_DIR` appropriately so paths are relative to the CMakeLists.txt file rather than the top-level cmake dir of the project (since that may not be the cugraph cpp dir in the case of cugraph being used as an external project by another application). This also adds a `CUDA_ARCHITECTURES=OFF` setting to suppress the warning printed for each test target. This setting may be replaced/changed once the findcudatoolkit feature is used in a future cmake version. This also removes the Arrow and GTest cmake files since Arrow is not a direct dependency and those files were not being used, and GTest is now a build requirement in the conda dev environment and does not need to be built from source (the conda dev env files have been updated accordingly). This PR also addresses much of #1075 , but not completely since gunrock is still using `ExternalProject` due to (I think) updates that need to be made to their cmake files to support this. This was tested by observing a successful clean build, however it was **not** tested by creating a separate cmake application to simulate cugraph being used as a 3rd party package. Note: the changes in this PR were modeled after rapidsai/rmm#541 closes #1137 closes #1266 Authors: - Rick Ratzel (@rlratzel) Approvers: - Chuck Hastings (@ChuckHastings) - AJ Schmidt (@ajschmidt8) - Brad Rees (@BradReesWork) URL: #1367
fix #540