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

cccl: add package #5978

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions packages/c/cccl/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package("cccl")
set_kind("library", {headeronly = true})
set_homepage("https://nvidia.github.io/cccl/")
set_description("CUDA Core Compute Libraries")
set_license("Apache-2.0")

add_urls("https://github.com/NVIDIA/cccl/archive/refs/tags/$(version).tar.gz",
"https://github.com/NVIDIA/cccl.git")

add_versions("v2.6.1", "993f483a3f8134bd719dc61651c0a0db17ad6007ee22e97f4ac4a3c310834004")

add_configs("cmake", {description = "Use cmake buildsystem", default = false, type = "boolean", readonly = true})

add_deps("cuda", {system = true})

on_load(function (package)
if package:config("cmake") then
package:add("deps", "cmake")
end
end)

on_install(function (package)
if package:config("cmake") then
-- TODO: preset support >= v2.7.0
local configs = {"--preset", "install"}
Copy link
Contributor

Choose a reason for hiding this comment

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

            local configs = {}
            if package:is_debug() then 
                table.insert(configs, "all-dev-debug")
            else
                table.insert(configs, "all-dev")
            end

c.f. https://github.com/NVIDIA/cccl/blob/main/CMakePresets.json

Copy link
Contributor

Choose a reason for hiding this comment

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

(on load?)

table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs)
else
os.vcp("thrust/thrust", package:installdir("include"))
os.vcp("cub/cub", package:installdir("include"))
os.vcp("libcudacxx/include", package:installdir())
os.vcp("cudax/include/cuda/experimental", package:installdir("include/cuda"))
end
end)

on_test(function (package)
assert(package:has_cxxincludes("thrust/version.h", {configs = {languages = "c++14"}}))
assert(package:has_cxxincludes("cub/version.cuh", {configs = {languages = "c++14"}}))
assert(package:has_cxxincludes("cuda/version", {configs = {languages = "c++14"}}))
assert(package:has_cxxincludes("cuda/experimental/version.cuh", {configs = {languages = "c++14"}}))
end)
Loading