一键导入
mtl-build
Build MTL library, format code, and verify compilation. Use when asked to build, verify changes, check formatting, or prepare code for commit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build MTL library, format code, and verify compilation. Use when asked to build, verify changes, check formatting, or prepare code for commit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Author a new MTL test. Use when adding coverage for a bug fix, new feature, regression, or behavior change. Teaches how to pick the right tier (unit / integration / NoCtx / pytest single-host / pytest dual-host) and how to write a test that will survive review. Does NOT cover running existing tests, debugging an existing test failure, host setup, or build infrastructure — see the linked instructions for those.
Stage and commit working-tree changes as atomic, signed-off commits whose message length scales with the change. Use when asked to commit, stage, or finalize changes into git — after the user (not the agent) decides a diff is ready.
| name | mtl-build |
| description | Build MTL library, format code, and verify compilation. Use when asked to build, verify changes, check formatting, or prepare code for commit. |
Run from the repository root:
| Command | Mode | Use when |
|---|---|---|
./build.sh | Release | Default. Optimized build for testing and deployment |
./build.sh debug | Debug + ASAN | Debugging with AddressSanitizer (-O0 -g). Slower but catches memory bugs |
./build.sh debugonly | Debug only | Debug symbols without ASAN. Faster than debug for general development |
./format-coding.sh
clang-format-14 (install via sudo apt install clang-format-14)After building, verify:
build/lib/libmtl.so — shared librarybuild/tests/KahawaiTest — integration test binarybuild/app/RxTxApp — reference application./format-coding.sh and check for any formatting changes| Error | Fix |
|---|---|
Missing meson / ninja | sudo apt install meson ninja-build |
Missing libnuma-dev | sudo apt install libnuma-dev |
Missing libjson-c-dev | sudo apt install libjson-c-dev |
Missing libpcap-dev | sudo apt install libpcap-dev |
Missing libgtest-dev | sudo apt install libgtest-dev |
Missing libssl-dev | sudo apt install libssl-dev |
Missing systemtap-sdt-dev | sudo apt install systemtap-sdt-dev (for USDT probes) |
| DPDK not found / wrong version | Build DPDK first: see build docs |
| Stale build directory | rm -rf build && ./build.sh or use MCP tool mtl_clean_rebuild |
| Permission errors in build/ | sudo rm -rf build && ./build.sh |