-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcpp.toml
More file actions
291 lines (281 loc) · 12.9 KB
/
Copy pathmcpp.toml
File metadata and controls
291 lines (281 loc) · 12.9 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
[package]
name = "llamacpp"
version = "0.1.0"
description = "C++23 module package for llama.cpp b10069"
license = "MIT"
standard = "c++23"
[build]
c_standard = "c11"
include_dirs = [
"third_party/llama.cpp/include",
"third_party/llama.cpp/ggml/include",
"third_party/llama.cpp/ggml/src",
"third_party/llama.cpp/ggml/src/ggml-cpu",
"third_party/llama.cpp/ggml/src/ggml-metal",
"third_party/llama.cpp/src",
"generated",
]
sources = [
"third_party/llama.cpp/ggml/src/ggml.c",
"generated/ggml_cpp.cpp",
"third_party/llama.cpp/ggml/src/ggml-alloc.c",
"third_party/llama.cpp/ggml/src/ggml-backend.cpp",
"third_party/llama.cpp/ggml/src/ggml-backend-meta.cpp",
"third_party/llama.cpp/ggml/src/ggml-opt.cpp",
"third_party/llama.cpp/ggml/src/ggml-threading.cpp",
"third_party/llama.cpp/ggml/src/ggml-quants.c",
"third_party/llama.cpp/ggml/src/gguf.cpp",
"third_party/llama.cpp/ggml/src/ggml-backend-dl.cpp",
"third_party/llama.cpp/ggml/src/ggml-backend-reg.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c",
"generated/ggml-cpu_cpp.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/binary-ops.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/hbm.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/ops.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/quants.c",
"third_party/llama.cpp/ggml/src/ggml-cpu/repack.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/traits.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/unary-ops.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/vec.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/amx/amx.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/amx/mmq.cpp",
"third_party/llama.cpp/ggml/src/ggml-cpu/llamafile/sgemm.cpp",
"src/llamacpp.cppm",
"third_party/llama.cpp/src/llama.cpp",
"third_party/llama.cpp/src/llama-adapter.cpp",
"third_party/llama.cpp/src/llama-arch.cpp",
"third_party/llama.cpp/src/llama-batch.cpp",
"third_party/llama.cpp/src/llama-chat.cpp",
"third_party/llama.cpp/src/llama-context.cpp",
"third_party/llama.cpp/src/llama-cparams.cpp",
"third_party/llama.cpp/src/llama-grammar.cpp",
"third_party/llama.cpp/src/llama-graph.cpp",
"third_party/llama.cpp/src/llama-hparams.cpp",
"third_party/llama.cpp/src/llama-impl.cpp",
"third_party/llama.cpp/src/llama-io.cpp",
"third_party/llama.cpp/src/llama-kv-cache.cpp",
"third_party/llama.cpp/src/llama-kv-cache-iswa.cpp",
"third_party/llama.cpp/src/llama-kv-cache-dsa.cpp",
"third_party/llama.cpp/src/llama-kv-cache-dsv4.cpp",
"third_party/llama.cpp/src/llama-memory.cpp",
"third_party/llama.cpp/src/llama-memory-hybrid.cpp",
"third_party/llama.cpp/src/llama-memory-hybrid-iswa.cpp",
"third_party/llama.cpp/src/llama-memory-recurrent.cpp",
"third_party/llama.cpp/src/llama-mmap.cpp",
"third_party/llama.cpp/src/llama-model-loader.cpp",
"third_party/llama.cpp/src/llama-model-saver.cpp",
"third_party/llama.cpp/src/llama-model.cpp",
"third_party/llama.cpp/src/llama-quant.cpp",
"third_party/llama.cpp/src/llama-sampler.cpp",
"third_party/llama.cpp/src/llama-vocab.cpp",
"third_party/llama.cpp/src/unicode-data.cpp",
"third_party/llama.cpp/src/unicode.cpp",
"third_party/llama.cpp/src/models/afmoe.cpp",
"third_party/llama.cpp/src/models/apertus.cpp",
"third_party/llama.cpp/src/models/arcee.cpp",
"third_party/llama.cpp/src/models/arctic.cpp",
"third_party/llama.cpp/src/models/arwkv7.cpp",
"third_party/llama.cpp/src/models/baichuan.cpp",
"third_party/llama.cpp/src/models/bailingmoe.cpp",
"third_party/llama.cpp/src/models/bailingmoe2.cpp",
"third_party/llama.cpp/src/models/bert.cpp",
"third_party/llama.cpp/src/models/bitnet.cpp",
"third_party/llama.cpp/src/models/bloom.cpp",
"third_party/llama.cpp/src/models/chameleon.cpp",
"third_party/llama.cpp/src/models/chatglm.cpp",
"third_party/llama.cpp/src/models/codeshell.cpp",
"third_party/llama.cpp/src/models/cogvlm.cpp",
"third_party/llama.cpp/src/models/cohere2.cpp",
"third_party/llama.cpp/src/models/cohere2moe.cpp",
"third_party/llama.cpp/src/models/command-r.cpp",
"third_party/llama.cpp/src/models/dbrx.cpp",
"third_party/llama.cpp/src/models/deci.cpp",
"third_party/llama.cpp/src/models/deepseek.cpp",
"third_party/llama.cpp/src/models/deepseek2.cpp",
"third_party/llama.cpp/src/models/deepseek2ocr.cpp",
"third_party/llama.cpp/src/models/deepseek32.cpp",
"third_party/llama.cpp/src/models/deepseek4.cpp",
"third_party/llama.cpp/src/models/delta-net-base.cpp",
"third_party/llama.cpp/src/models/dflash.cpp",
"third_party/llama.cpp/src/models/dots1.cpp",
"third_party/llama.cpp/src/models/dream.cpp",
"third_party/llama.cpp/src/models/eagle3.cpp",
"third_party/llama.cpp/src/models/ernie4-5-moe.cpp",
"third_party/llama.cpp/src/models/ernie4-5.cpp",
"third_party/llama.cpp/src/models/eurobert.cpp",
"third_party/llama.cpp/src/models/exaone-moe.cpp",
"third_party/llama.cpp/src/models/exaone.cpp",
"third_party/llama.cpp/src/models/exaone4.cpp",
"third_party/llama.cpp/src/models/falcon-h1.cpp",
"third_party/llama.cpp/src/models/falcon.cpp",
"third_party/llama.cpp/src/models/gemma-embedding.cpp",
"third_party/llama.cpp/src/models/gemma.cpp",
"third_party/llama.cpp/src/models/gemma2.cpp",
"third_party/llama.cpp/src/models/gemma3.cpp",
"third_party/llama.cpp/src/models/gemma3n.cpp",
"third_party/llama.cpp/src/models/gemma4-assistant.cpp",
"third_party/llama.cpp/src/models/gemma4.cpp",
"third_party/llama.cpp/src/models/glm-dsa.cpp",
"third_party/llama.cpp/src/models/glm4-moe.cpp",
"third_party/llama.cpp/src/models/glm4.cpp",
"third_party/llama.cpp/src/models/gpt2.cpp",
"third_party/llama.cpp/src/models/gptneox.cpp",
"third_party/llama.cpp/src/models/granite-hybrid.cpp",
"third_party/llama.cpp/src/models/granite-moe.cpp",
"third_party/llama.cpp/src/models/granite.cpp",
"third_party/llama.cpp/src/models/grok.cpp",
"third_party/llama.cpp/src/models/grovemoe.cpp",
"third_party/llama.cpp/src/models/hunyuan-dense.cpp",
"third_party/llama.cpp/src/models/hunyuan-moe.cpp",
"third_party/llama.cpp/src/models/hunyuan-vl.cpp",
"third_party/llama.cpp/src/models/hy-v3.cpp",
"third_party/llama.cpp/src/models/internlm2.cpp",
"third_party/llama.cpp/src/models/jais.cpp",
"third_party/llama.cpp/src/models/jais2.cpp",
"third_party/llama.cpp/src/models/jamba.cpp",
"third_party/llama.cpp/src/models/jina-bert-v2.cpp",
"third_party/llama.cpp/src/models/jina-bert-v3.cpp",
"third_party/llama.cpp/src/models/kimi-linear.cpp",
"third_party/llama.cpp/src/models/lfm2.cpp",
"third_party/llama.cpp/src/models/lfm2moe.cpp",
"third_party/llama.cpp/src/models/llada-moe.cpp",
"third_party/llama.cpp/src/models/llada.cpp",
"third_party/llama.cpp/src/models/llama-embed.cpp",
"third_party/llama.cpp/src/models/llama.cpp",
"third_party/llama.cpp/src/models/llama4.cpp",
"third_party/llama.cpp/src/models/maincoder.cpp",
"third_party/llama.cpp/src/models/mamba-base.cpp",
"third_party/llama.cpp/src/models/mamba.cpp",
"third_party/llama.cpp/src/models/mamba2.cpp",
"third_party/llama.cpp/src/models/mellum.cpp",
"third_party/llama.cpp/src/models/mimo2.cpp",
"third_party/llama.cpp/src/models/minicpm.cpp",
"third_party/llama.cpp/src/models/minicpm3.cpp",
"third_party/llama.cpp/src/models/minimax-m2.cpp",
"third_party/llama.cpp/src/models/mistral3.cpp",
"third_party/llama.cpp/src/models/mistral4.cpp",
"third_party/llama.cpp/src/models/modern-bert.cpp",
"third_party/llama.cpp/src/models/mpt.cpp",
"third_party/llama.cpp/src/models/nemotron-h-moe.cpp",
"third_party/llama.cpp/src/models/nemotron-h.cpp",
"third_party/llama.cpp/src/models/nemotron.cpp",
"third_party/llama.cpp/src/models/neo-bert.cpp",
"third_party/llama.cpp/src/models/nomic-bert-moe.cpp",
"third_party/llama.cpp/src/models/nomic-bert.cpp",
"third_party/llama.cpp/src/models/olmo.cpp",
"third_party/llama.cpp/src/models/olmo2.cpp",
"third_party/llama.cpp/src/models/olmoe.cpp",
"third_party/llama.cpp/src/models/openai-moe.cpp",
"third_party/llama.cpp/src/models/openelm.cpp",
"third_party/llama.cpp/src/models/orion.cpp",
"third_party/llama.cpp/src/models/paddleocr.cpp",
"third_party/llama.cpp/src/models/pangu-embed.cpp",
"third_party/llama.cpp/src/models/phi2.cpp",
"third_party/llama.cpp/src/models/phi3.cpp",
"third_party/llama.cpp/src/models/phimoe.cpp",
"third_party/llama.cpp/src/models/plamo.cpp",
"third_party/llama.cpp/src/models/plamo2.cpp",
"third_party/llama.cpp/src/models/plamo3.cpp",
"third_party/llama.cpp/src/models/plm.cpp",
"third_party/llama.cpp/src/models/qwen.cpp",
"third_party/llama.cpp/src/models/qwen2.cpp",
"third_party/llama.cpp/src/models/qwen2moe.cpp",
"third_party/llama.cpp/src/models/qwen2vl.cpp",
"third_party/llama.cpp/src/models/qwen3.cpp",
"third_party/llama.cpp/src/models/qwen35.cpp",
"third_party/llama.cpp/src/models/qwen35moe.cpp",
"third_party/llama.cpp/src/models/qwen3moe.cpp",
"third_party/llama.cpp/src/models/qwen3next.cpp",
"third_party/llama.cpp/src/models/qwen3vl.cpp",
"third_party/llama.cpp/src/models/qwen3vlmoe.cpp",
"third_party/llama.cpp/src/models/refact.cpp",
"third_party/llama.cpp/src/models/rnd1.cpp",
"third_party/llama.cpp/src/models/rwkv6-base.cpp",
"third_party/llama.cpp/src/models/rwkv6.cpp",
"third_party/llama.cpp/src/models/rwkv6qwen2.cpp",
"third_party/llama.cpp/src/models/rwkv7-base.cpp",
"third_party/llama.cpp/src/models/rwkv7.cpp",
"third_party/llama.cpp/src/models/seed-oss.cpp",
"third_party/llama.cpp/src/models/smallthinker.cpp",
"third_party/llama.cpp/src/models/smollm3.cpp",
"third_party/llama.cpp/src/models/stablelm.cpp",
"third_party/llama.cpp/src/models/starcoder.cpp",
"third_party/llama.cpp/src/models/starcoder2.cpp",
"third_party/llama.cpp/src/models/step35.cpp",
"third_party/llama.cpp/src/models/t5.cpp",
"third_party/llama.cpp/src/models/t5encoder.cpp",
"third_party/llama.cpp/src/models/talkie.cpp",
"third_party/llama.cpp/src/models/wavtokenizer-dec.cpp",
"third_party/llama.cpp/src/models/xverse.cpp",
]
cflags = ["-w", "-include", "ggml_build_info.h", "-DGGML_USE_CPU_REPACK"]
cxxflags = ["-w", "-include", "ggml_build_info.h", "-DGGML_USE_CPU_REPACK"]
flags = [
{ glob = "third_party/llama.cpp/ggml/src/ggml-backend-reg.cpp", defines = ["GGML_USE_CPU"] },
{ glob = "third_party/llama.cpp/ggml/src/ggml-cpu/**", defines = ["GGML_USE_LLAMAFILE"] },
{ glob = "generated/ggml-cpu_cpp.cpp", defines = ["GGML_USE_LLAMAFILE"] },
{ glob = "third_party/llama.cpp/src/models/t5.cpp", cxxflags = ["-std=c++20"] },
{ glob = "third_party/llama.cpp/src/models/eagle3.cpp", cxxflags = ["-std=c++20"] },
{ glob = "third_party/llama.cpp/src/models/dflash.cpp", cxxflags = ["-std=c++20"] },
{ glob = "third_party/llama.cpp/src/models/hunyuan-dense.cpp", cxxflags = ["-std=c++20"] },
{ glob = "third_party/llama.cpp/src/models/llama-embed.cpp", cxxflags = ["-std=c++20"] },
{ glob = "third_party/llama.cpp/src/models/minimax-m2.cpp", cxxflags = ["-std=c++20"] },
]
[targets.llama]
kind = "lib"
[generated_files]
"generated/ggml_cpp.cpp" = "#include \"ggml.cpp\"\n"
"generated/ggml-cpu_cpp.cpp" = "#include \"ggml-cpu.cpp\"\n"
"generated/ggml_metal_device_m.m" = "#include \"ggml-metal-device.m\"\n"
"generated/ggml_build_info.h" = """
#pragma once
#define GGML_VERSION "b10069"
#define GGML_COMMIT "178a6c44937154dc4c4eff0d166f4a044c4fceba"
"""
[target.'cfg(arch = "x86_64")'.build]
sources = [
"third_party/llama.cpp/ggml/src/ggml-cpu/arch/x86/quants.c",
"third_party/llama.cpp/ggml/src/ggml-cpu/arch/x86/repack.cpp",
]
[target.'cfg(arch = "aarch64")'.build]
sources = [
"third_party/llama.cpp/ggml/src/ggml-cpu/arch/arm/quants.c",
"third_party/llama.cpp/ggml/src/ggml-cpu/arch/arm/repack.cpp",
]
[target.linux.build]
cflags = ["-D_GNU_SOURCE"]
cxxflags = ["-D_GNU_SOURCE"]
ldflags = ["-ldl", "-lpthread", "-lm"]
[target.macos.build]
cflags = ["-D_DARWIN_C_SOURCE"]
cxxflags = ["-D_DARWIN_C_SOURCE"]
ldflags = [
"-lpthread",
"-lm",
"-framework", "Foundation",
"-framework", "Metal",
"-framework", "MetalKit",
]
[target.windows.build]
cflags = ["-D_CRT_SECURE_NO_WARNINGS", "-DWIN32_LEAN_AND_MEAN"]
cxxflags = ["-D_CRT_SECURE_NO_WARNINGS", "-DWIN32_LEAN_AND_MEAN"]
ldflags = ["-ladvapi32"]
[features]
default = { implies = ["backend-cpu"] }
backend-cpu = {}
[features.backend-metal]
sources = [
"third_party/llama.cpp/ggml/src/ggml-metal/ggml-metal.cpp",
"generated/ggml_metal_device_m.m",
"third_party/llama.cpp/ggml/src/ggml-metal/ggml-metal-device.cpp",
"third_party/llama.cpp/ggml/src/ggml-metal/ggml-metal-common.cpp",
"third_party/llama.cpp/ggml/src/ggml-metal/ggml-metal-context.m",
"third_party/llama.cpp/ggml/src/ggml-metal/ggml-metal-ops.cpp",
]
defines = ["LLAMACPP_METAL_TEST=1"]
flags = [
{ glob = "generated/ggml_metal_device_m.m", cflags = ["-fno-objc-arc"] },
{ glob = "third_party/llama.cpp/ggml/src/ggml-metal/ggml-metal-context.m", cflags = ["-fno-objc-arc"] },
{ glob = "third_party/llama.cpp/ggml/src/ggml-metal/ggml-metal.cpp", cxxflags = ["-include", "memory"] },
{ glob = "third_party/llama.cpp/ggml/src/ggml-backend-reg.cpp", defines = ["GGML_USE_METAL"] },
]