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

Ensure cuco export set is installed in cmake build #11147

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

jlowe
Copy link
Member

@jlowe jlowe commented Jun 24, 2022

Fixes #11146

Adds the cuco dependency information to the install exports for cudf. Verified this change fixes the spark-rapids-jni build.

@jlowe jlowe added bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue non-breaking Non-breaking change labels Jun 24, 2022
@jlowe jlowe requested a review from a team as a code owner June 24, 2022 16:17
@jlowe jlowe self-assigned this Jun 24, 2022
Copy link
Contributor

@jbrennan333 jbrennan333 left a comment

Choose a reason for hiding this comment

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

+1 this looks good to me

@@ -15,7 +15,7 @@
# This function finds cuCollections and performs any additional configuration.
function(find_and_configure_cucollections)
include(${rapids-cmake-dir}/cpm/cuco.cmake)
rapids_cpm_cuco(BUILD_EXPORT_SET cudf-exports)
rapids_cpm_cuco(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports)
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense, but I am confused why the below rapids_export_package is not having the same effect. The error is definitely occurring for you when BUILD_SHARED_LIBS=OFF, right? So the rapids_export_package call should be happening?

Copy link
Member Author

@jlowe jlowe Jun 24, 2022

Choose a reason for hiding this comment

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

Verified via CMakeCache file that BUILD_SHARED_LIBS is indeed OFF. No idea why the original code isn't installing the cuco cmake files as it should.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with this change since it seems like we should be doing it anyway (we should probably remove the manual rapids_export_package logic below since it's redundant now, at least in theory), but I'm just going to play with the build a little to try to understand why this is happening to make sure that we have the right fix and aren't breaking the shared lib use case in some surprising way.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should only be added when BUILD_SHARED_LIBS is a false value.

Copy link
Member Author

Choose a reason for hiding this comment

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

If the cuco cmake files are only installed when building static libraries, how does rapids_find_package(cudf) work in the shared library case? Or is cuco not listed as a dependency of libcudf in that case?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also curious about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

It isn't listed as a dependency in those cases as the headers aren't exposed as part of the public API.

We only need to expose it for static linking.

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

I experimented this morning but wasn't able to track down the underlying issue here, or why this wasn't necessary prior to #11139. Chatted with @jlowe offline and we're going to wait for @robertmaynard to take a look on Monday to confirm that there aren't concerns that we're missing here before we merge.

@robertmaynard
Copy link
Contributor

I experimented this morning but wasn't able to track down the underlying issue here, or why this wasn't necessary prior to #11139. Chatted with @jlowe offline and we're going to wait for @robertmaynard to take a look on Monday to confirm that there aren't concerns that we're missing here before we merge.

The reason we some new logic is that rapids_cpm_cuco doesn't install the headers when it isn't part of an INSTALL_EXPORT_SET ( https://github.com/rapidsai/rapids-cmake/blob/branch-22.08/rapids-cmake/cpm/cuco.cmake#L77 ). Previously get_cucollections would install the files when BUILD_SHARED_LIBS was disabled ( via EXCLUDE_FROM_ALL ).

We need to remove cuco from the foreach(METADATA_KIND IN LISTS METADATA_KINDS) logic in the root CMakeLists.txt, and only have INSTALL_EXPORT_SET set for cuco when BUILD_SHARED_LIBS is OFF.

@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.08@93d912b). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff               @@
##             branch-22.08   #11147   +/-   ##
===============================================
  Coverage                ?   86.33%           
===============================================
  Files                   ?      144           
  Lines                   ?    22751           
  Branches                ?        0           
===============================================
  Hits                    ?    19641           
  Misses                  ?     3110           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93d912b...3943c7a. Read the comment docs.

@vyasr
Copy link
Contributor

vyasr commented Jun 27, 2022

The reason we some new logic is that rapids_cpm_cuco doesn't install the headers when it isn't part of an INSTALL_EXPORT_SET ( https://github.com/rapidsai/rapids-cmake/blob/branch-22.08/rapids-cmake/cpm/cuco.cmake#L77 ). Previously get_cucollections would install the files when BUILD_SHARED_LIBS was disabled ( via EXCLUDE_FROM_ALL ).

I tried changing EXCLUDE_FROM_ALL manually in the definition of rapids_cpm_cuco to test this possibility, and it had no effect. In hindsight, perhaps my changes were being overwritten by new pulls of rapids-cmake. I was using the container for the Spark JNI and maybe that triggers a re-pull of rapids-cmake every time, erasing any local changes?

When EXCLUDE_FROM_ALL is set, is it still be possible to install cuco if a user manually did make cuco (or something analogous, I don't know if a corresponding target is automatically created for dependencies)?

@robertmaynard
Copy link
Contributor

When EXCLUDE_FROM_ALL is set, is it still be possible to install cuco if a user manually did make cuco (or something analogous, I don't know if a corresponding target is automatically created for dependencies)?

When EXCLUDE_FROM_ALL is defined to True it won't be part of the make install / ninja install target, and requesting installation of the specifc files in other ways is considered undefined behavior.

@robertmaynard
Copy link
Contributor

I tried changing EXCLUDE_FROM_ALL manually in the definition of rapids_cpm_cuco to test this possibility, and it had no effect. In hindsight, perhaps my changes were being overwritten by new pulls of rapids-cmake.

I expect that is exactly what is happening.

@razajafri
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit b5a59cf into rapidsai:branch-22.08 Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CMake CMake build issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] libcudf install references missing cuco dependency
5 participants