-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcpp.toml
More file actions
179 lines (163 loc) · 8.88 KB
/
Copy pathmcpp.toml
File metadata and controls
179 lines (163 loc) · 8.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
[package]
name = "plugins"
namespace = "mcpp"
version = "0.2.5"
description = "Official mcpp build plugins: rule packages under mcpp.rules.*, build-time utilities under mcpp.tools.*, each member selected by a feature"
license = "Apache-2.0"
authors = ["mcpp-community"]
repo = "https://github.com/mcpp-community/mcpp-plugins"
[language]
standard = "c++23"
modules = true
import_std = true
# The lib root alone is compiled for a consumer that activates no feature. Each
# member of the collection is a module interface unit that one feature adds to
# the source set; mcpp compiles every interface unit among the resolved
# sources as a host module under the name the unit declares (2026.9.5.3+).
[build]
sources = ["src/plugins.cppm"]
[features]
default = []
rules-ascendc = { sources = ["rules/ascendc.cppm"] }
rules-cuda = { sources = ["rules/cuda.cppm"] }
rules-hip = { sources = ["rules/hip.cppm"] }
rules-spirv = { sources = ["rules/spirv.cppm"] }
rules-sycl = { sources = ["rules/sycl.cppm"] }
tools-embed = { sources = ["tools/embed.cppm"] }
# ── The environment each rule needs (mcpp 2026.9.6.6+) ──────────────────────
#
# A RULE OWNS THE LIST OF PACKAGES IT DRIVES. It is the code that runs the
# compiler, reads the headers and puts the library directory on the link line,
# so "which package, and which version of it" is its knowledge. Before this, a
# project repeated the list in its own `[xlings.workspace]` -- a copy that goes
# stale silently, because the rule moves and the projects do not.
#
# TWO GATES, AND BOTH MUST OPEN BEFORE A BYTE IS DOWNLOADED. The feature says
# whether this rule is wanted at all; `cfg(accelerator = ...)` says whether this
# particular build compiles for the device. A CPU-only build of a project that
# depends on this package with `features = ["rules-cuda"]` opens the first and
# not the second, and installs nothing -- which is the build CI runs, and the
# one a multi-gigabyte vendor toolkit would otherwise make the most expensive.
#
# THE SHAPE OF EACH DEFAULT IS A JUDGEMENT ABOUT COUPLING, not a style.
#
# - An EXACT version where the payload's version is coupled to something the
# rule cannot see. A CUDA runtime must not be newer than the driver it will
# meet: the 12.9 line reaches every driver from r525 onward, and the 13.x
# line raises that to r580. That is a property of the consumer's machines,
# so the rule offers a line it has verified and the project moves it.
# - A FLOOR (`>=`) where no such coupling exists and newer is simply newer.
#
# mcpp reads the difference: a bare version is a CHOICE, so a project pinning a
# different one wins and is reported; a `>=` is a REQUIREMENT, so a project
# pinning below it is refused naming both sides. See "One package, one version"
# in mcpp's docs/05.
#
# WHAT IS NOT HERE: anything the produced PROGRAM chooses to run on. A Vulkan
# ICD (`xim:mesa-lavapipe`) is a device, not a build tool, and a rule that
# declared one would force a software renderer onto consumers that have a GPU.
# The rule declares what it needs to COMPILE; the project declares what it needs
# to RUN. The runtime adapters (`compat:cuda-runtime`, `compat:sycl-runtime`,
# `compat:vulkan-runtime`) stay in the project for the same reason and for a
# second one: this package is a `[build-dependencies]` edge, so its own
# `[dependencies]` deliberately do not reach the consumer's target.
[target.'cfg(accelerator = "cuda")'.feature-xlings.rules-cuda]
"xim:cuda-nvcc" = "12.9.86"
"xim:cuda-cudart" = "12.9.79"
# clang's CUDA wrapper includes a cuRAND header for every device unit, and that
# header includes <nv/target> from CCCL. Neither is called by an ordinary
# kernel; on a developer machine the host's /usr/include supplied them silently.
"xim:libcurand" = "10.3.10.19"
"xim:cuda-cccl" = "12.9.27"
# The driver sentinel is Linux-only, and the OS goes in the PREDICATE rather
# than in the value: a value carrying platform keys under an already-predicated
# table would state the condition twice and let the two disagree.
[target.'cfg(all(accelerator = "cuda", linux))'.feature-xlings.rules-cuda]
"xim:libcuda-host-link" = "0.0.1"
# HIP on the NVIDIA platform is a header layer over the CUDA runtime, so this
# list is the CUDA one plus the header package HIP includes at its second line.
[target.'cfg(accelerator = "hip")'.feature-xlings.rules-hip]
"xim:hip-nvidia" = "7.2.4"
"xim:cuda-nvcc" = "12.9.86"
"xim:cuda-cudart" = "12.9.79"
"xim:libcurand" = "10.3.10.19"
"xim:cuda-cccl" = "12.9.27"
"xim:cuda-profiler-api" = "12.9.79"
[target.'cfg(all(accelerator = "hip", linux))'.feature-xlings.rules-hip]
"xim:libcuda-host-link" = "0.0.1"
# A floor: the compiler's version is not coupled to any driver, and the rule
# needs `-fsycl-link` to behave as it does from 7.1.0 onward.
[target.'cfg(accelerator = "sycl")'.feature-xlings.rules-sycl]
"xim:dpcpp" = ">=7.1.0"
# THE SECOND COMPILER MUST BE TOLD WHERE THE C LIBRARY IS. dpcpp's clang is not
# configured with this ecosystem's glibc, so without these its device units
# compile against the host's -- which no command line shows, because an implicit
# include search never appears on one.
[target.'cfg(all(accelerator = "sycl", linux))'.feature-xlings.rules-sycl]
"xim:gcc" = "15.1.0"
"xim:glibc" = ""
"xim:linux-headers" = ""
# Only when the SYCL build actually names an NVIDIA target. `accelerator` is a
# SET, so this is a conjunction of two membership tests rather than a
# contradiction -- and without it every SYCL build would download a CUDA
# toolkit it may have no target for.
#
# `linux` is part of the predicate for a reason that is measured rather than
# stylistic: upstream does not build the CUDA plugin for Windows, and the
# published Windows asset carries Level Zero and OpenCL adapters only. The rule
# refuses that combination on that host, and a refusal that arrives after a
# multi-gigabyte download is a worse refusal -- provisioning runs before the
# rule does.
[target.'cfg(all(accelerator = "sycl", accelerator = "cuda", linux))'.feature-xlings.rules-sycl]
"xim:cuda-nvcc" = "12.9.86"
# ONE COMPILER PER PLATFORM, AND NOT THE SAME ONE EVERYWHERE.
#
# This rule drives both reference compilers and writes the C declaration itself
# on the glslc route, so which one is present is not a difference a consumer
# sees. That is what makes cross-platform parity affordable: it is provided by
# the rule's ability to CHOOSE, not by publishing one compiler three times.
#
# Linux keeps `xim:glslang`, so nothing about an existing Linux build changes.
# macOS and Windows take `xim:shaderc`, which is the compiler this ecosystem
# publishes for them -- glslang has no upstream binary for either, and building
# it three times buys nothing glslc does not already give.
#
# Declaring both on one platform would install both and use one, so each block
# names exactly the compiler that platform will run.
[target.'cfg(all(accelerator = "vulkan", linux))'.feature-xlings.rules-spirv]
"xim:glslang" = ">=15.1.0"
# AN EXACT VERSION HERE, WHERE LINUX HAS A FLOOR, AND THE REASON IS THE
# ENGINE'S COMMAND LINE RATHER THAN THE PACKAGE.
#
# mcpp hands its provisioning request to xlings as a JSON argument on a shell
# command line. On Windows that line is parsed by cmd.exe, whose quoting rules
# are not the ones the JSON is escaped for: the `\"` sequences leave cmd's
# quote state OFF by the time it reaches a `>` in a version constraint, so the
# `>` is read as a REDIRECTION. Measured on windows-2022 with mcpp 2026.9.6.6:
#
# Provisioning [xlings.workspace] entries declared by dependencies
# (xim:shaderc@>=2026.3)
# The filename, directory name, or volume label syntax is incorrect.
# error: ... xlings exited 1
#
# -- cmd's own message about an unusable redirection target, arriving as a
# packaging failure. No declaration reachable on Windows had carried a `>`
# before, which is why the whole `>=` shape had never been exercised there.
#
# An exact version is a legitimate declaration and not a workaround in
# disguise: mcpp reads it as a CHOICE, so a project that wants a different one
# still wins and the override is reported. macOS takes the same value so the
# two platforms that use this compiler agree. Both revert to `>=2026.3` once a
# released engine escapes the argument for cmd.
[target.'cfg(all(accelerator = "vulkan", macos))'.feature-xlings.rules-spirv]
"xim:shaderc" = "2026.3"
[target.'cfg(all(accelerator = "vulkan", windows))'.feature-xlings.rules-spirv]
"xim:shaderc" = "2026.3"
# 8.5.0 is a real floor rather than a preference: the mixed-mode object -- the
# one carrying both the device binary and a host-callable launcher, which is
# what lets it join an ordinary link -- and the 38 SoC simulators are what this
# rule drives, and they are present from that version onward.
[target.'cfg(accelerator = "ascend")'.feature-xlings.rules-ascendc]
"xim:cann-toolkit" = ">=8.5.0"
[targets.plugins]
kind = "lib"