Skip to content
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

Updated libcudftestutil CMake linking logic for 24.12 #1475

Merged

Conversation

lamarrr
Copy link
Contributor

@lamarrr lamarrr commented Oct 14, 2024

Description

This merge request fixes the CMake linking logic to cudftestutil for branch-24.12, allowing you to specify which version of GTest/GBench to use as long as the API is source compatible.

Follows up on: rapidsai/cudf#16839

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@lamarrr lamarrr requested a review from a team as a code owner October 14, 2024 21:37
@lamarrr lamarrr requested a review from harrism October 14, 2024 21:37
@github-actions github-actions bot added cmake Related to CMake code or build configuration libcuspatial Relates to the cuSpatial C++ library labels Oct 14, 2024
@lamarrr lamarrr requested a review from a team as a code owner October 14, 2024 21:56
@lamarrr lamarrr requested a review from trxcllnt October 14, 2024 21:56
Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question.

@@ -17,6 +17,25 @@
###################################################################################################
# - compiler function -----------------------------------------------------------------------------

add_library(cuspatial_test_common OBJECT test_common.cpp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why do we need a library with an empty source file that doesn't include anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two-fold:

  • cmake doesn't allow adding an empty list of sources for a library.
  • cudftestutil has been split into cudftestutil and cudftestutil_impl (cmake's INTERFACE sources), and they need to be linked to the executable. if we link to cudftestutil_impl for each test executable, we'll be paying the compilation cost repeatedly for each test compilation (due to source injection). instead, we create an object library called test_common and link to that, paying the compilation cost once.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks. Can you please document this in a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, sure!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Late question: why can't this empty library object just be created at the cudf level, rather than in cuspatial?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cudftestutil depends on gtest and gmock. cudf doesn't intend to ship a gtest binary artifact any longer and we want users to have the freedom to choose whichever gtest versions they intend to use as long as it's source-compatible.

@harrism harrism mentioned this pull request Oct 15, 2024
3 tasks
@harrism harrism added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 15, 2024
Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving so we can get this merged ASAP, but please document the reason for the empty source file / library.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! This all looks good to me. Let's merge when CI passes, to unblock other PRs.

@bdice
Copy link
Contributor

bdice commented Oct 16, 2024

I'm going to queue a merge for this, which will trigger once tests pass. The last commit (before docs) passed, so this one should pass as well.

@bdice
Copy link
Contributor

bdice commented Oct 16, 2024

/merge

@rapids-bot rapids-bot bot merged commit 8314c13 into rapidsai:branch-24.12 Oct 16, 2024
75 checks passed
@lamarrr lamarrr deleted the cuspatial-cudftestutil-link-24.12 branch October 16, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Related to CMake code or build configuration improvement Improvement / enhancement to an existing function libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants