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

Use rapids_cpm_libcudacxx to support installed libcudacxx #114

Merged
merged 2 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ add_library(cuco::cuco ALIAS cuco)
target_include_directories(cuco INTERFACE
INTERFACE $<BUILD_INTERFACE:${CUCO_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(cuco INTERFACE libcudacxx CUDA::toolkit $<BUILD_INTERFACE:cuco::Thrust>)
target_link_libraries(cuco INTERFACE libcudacxx::libcudacxx CUDA::toolkit $<BUILD_INTERFACE:cuco::Thrust>)
target_compile_features(cuco INTERFACE cxx_std_17 cuda_std_17)

###################################################################################################
Expand Down Expand Up @@ -108,7 +108,7 @@ endif(BUILD_EXAMPLES)
###################################################################################################
# - Install targets -------------------------------------------------------------------------------

install(TARGETS cuco libcudacxx EXPORT cuco-exports)
install(TARGETS cuco EXPORT cuco-exports)
install(DIRECTORY include/cuco/ DESTINATION include/cuco)
install(FILES ${CUCO_BINARY_DIR}/include/cuco/version_config.hpp DESTINATION include/cuco)

Expand All @@ -131,7 +131,7 @@ structures tailored for efficient use with GPUs.
rapids_export(
INSTALL cuco
EXPORT_SET cuco-exports
GLOBAL_TARGETS cuco libcudacxx
GLOBAL_TARGETS cuco
NAMESPACE cuco::
DOCUMENTATION doc_string)

Expand All @@ -146,7 +146,7 @@ endif()
rapids_export(
BUILD cuco
EXPORT_SET cuco-exports
GLOBAL_TARGETS cuco libcudacxx
GLOBAL_TARGETS cuco
NAMESPACE cuco::
DOCUMENTATION doc_string
FINAL_CODE_BLOCK code_string)
24 changes: 7 additions & 17 deletions cmake/thirdparty/get_libcudacxx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,12 @@
# =============================================================================

# Use CPM to find or clone thrust
function(find_and_configure_libcudacxx VERSION)
rapids_cpm_find(
libcudacxx ${VERSION}
CPM_ARGS
GIT_REPOSITORY https://github.com/NVIDIA/libcudacxx.git
GIT_TAG ${VERSION}
GIT_SHALLOW TRUE
DOWNLOAD_ONLY TRUE
)
# TODO: Once libcu++ exports a target, use that instead
add_library(libcudacxx INTERFACE)
target_include_directories(libcudacxx
INTERFACE $<BUILD_INTERFACE:${libcudacxx_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/cuco/libcudacxx>)
install(DIRECTORY ${libcudacxx_SOURCE_DIR}/include/ DESTINATION include/cuco/libcudacxx)
install(DIRECTORY ${libcudacxx_SOURCE_DIR}/libcxx/include/ DESTINATION include/cuco/libcxx/include)
function(find_and_configure_libcudacxx)
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)

rapids_cpm_libcudacxx(BUILD_EXPORT_SET cuco-exports
INSTALL_EXPORT_SET cuco-exports)

endfunction()

find_and_configure_libcudacxx(1.4.0)
find_and_configure_libcudacxx()
Copy link
Collaborator

Choose a reason for hiding this comment

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

How do we specify a version or git hash now?

Copy link
Member

Choose a reason for hiding this comment

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