diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d08fec6..241fbc1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,11 +96,15 @@ if (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.4) message(FATAL_ERROR "MatX requires CUDA 11.4 or higher. Please update before using.") endif() -# We typically need newer versions libcudacxx than availabled in the toolkit. pull down specific version here -message(STATUS "Need libcuda++. Finding...") -set(LIBCUDACXX_VERSION "2.1.0" CACHE STRING "Version of libcudacxx to use") -include(cmake/FindLibcudacxx.cmake) -target_include_directories(matx INTERFACE "$") +# libcudacxx is now part of CCCL, so grab that repo if needed +message(STATUS "Need CCCL. Finding...") +set(CCCL_VERSION "v2.2.0" CACHE STRING "Version of CCCL to use") +include(cmake/FindCCCL.cmake) + +target_include_directories(matx SYSTEM INTERFACE + $ + $ + $) # Set flags for compiling tests faster set(MATX_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} --threads 0 -ftemplate-backtrace-limit=0) diff --git a/cmake/FindLibcudacxx.cmake b/cmake/FindCCCL.cmake similarity index 67% rename from cmake/FindLibcudacxx.cmake rename to cmake/FindCCCL.cmake index 0bd15102..f6caa755 100644 --- a/cmake/FindLibcudacxx.cmake +++ b/cmake/FindCCCL.cmake @@ -30,31 +30,20 @@ # // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ///////////////////////////////////////////////////////////////////////////////// -function(find_and_configure_libcudacxx version) +function(find_and_configure_cccl version) - list(APPEND CMAKE_MESSAGE_CONTEXT "libcudacxx") + list(APPEND CMAKE_MESSAGE_CONTEXT "cccl") - rapids_cpm_find(libcudacxx ${version} - GLOBAL_TARGETS - libcudacxx libcudacxx::libcudacxx cxx_static - BUILD_EXPORT_SET - ${PROJECT_NAME}-exports - INSTALL_EXPORT_SET - ${PROJECT_NAME}-exports - CPM_ARGS - GIT_REPOSITORY https://github.com/NVIDIA/libcudacxx.git - GIT_TAG ${version} - GIT_SHALLOW TRUE - DOWNLOAD_ONLY TRUE - OPTIONS "LIBCXX_INCLUDE_BENCHMARKS OFF" - "LIBCXX_INCLUDE_TESTS OFF" - "LIBCXX_ENABLE_SHARED OFF" - "LIBCXX_ENABLE_STATIC OFF" - ) + CPMAddPackage( + NAME CCCL + GITHUB_REPOSITORY nvidia/cccl + GIT_TAG ${version} +) - set(LIBCUDACXX_INCLUDE_DIR "${libcudacxx_SOURCE_DIR}/include" PARENT_SCOPE) - set(LIBCXX_INCLUDE_DIR "${libcudacxx_SOURCE_DIR}/libcxx/include" PARENT_SCOPE) + + set(CCCL_INCLUDE_DIR "${cccl_SOURCE_DIR}/include" PARENT_SCOPE) + set(LIBCXX_INCLUDE_DIR "${cccl_SOURCE_DIR}/libcxx/include" PARENT_SCOPE) endfunction() -find_and_configure_libcudacxx(${LIBCUDACXX_VERSION}) +find_and_configure_cccl(${CCCL_VERSION})