Skip to main content

rdc-build-install

Build and install RDC from source. Use when: building locally, installing before tests, pre-review build verification, build + install + verify. Requires GRPC_ROOT to be set.

来源信息

仓库
ROCm/rocm-systems
最近来源活动
2026年6月24日 21:35
检测到的 SKILL.md 语言
英语
星标
516
分支
423

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
rdc-build-install
description
Build and install RDC from source. Use when: building locally, installing before tests, pre-review build verification, build + install + verify. Requires GRPC_ROOT to be set.
# Build & Install RDC Builds RDC from source, packages it, and installs locally. Used by the review agent as a pre-step before dispatching subagents, and can be invoked independently. ## Prerequisites - CMake 3.15+, GCC 5.4+, and a C/C++ toolchain installed - gRPC 1.78.1 pre-built at `$GRPC_ROOT` (required for `BUILD_STANDALONE=ON`) - AMDSMI installed at `/opt/rocm` (required at runtime) - `sudo` access for package install - Working directory must be the rdc workspace root (`projects/rdc/`) ## Build Commands All commands assume `$WORKSPACE` is the rdc workspace root (where `CMakeLists.txt` lives). ### Step 1: Clean ```bash cd "$WORKSPACE" sudo rm -rf build ``` ### Step 2: Configure & Build ```bash mkdir -p build && cd build cmake .. \ -DCMAKE_INSTALL_PREFIX=/opt/rocm \ -DCMAKE_PREFIX_PATH=/opt/rocm \ -DGRPC_ROOT="${GRPC_ROOT:-/opt/grpc}" \ -DBUILD_TESTS=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo make -j "$(nproc)" make package ``` If `GRPC_ROOT` is not set or gRPC is not available, build without standalone mode: ```bash cmake .. \ -DCMAKE_INSTALL_PREFIX=/opt/rocm \ -DCMAKE_PREFIX_PATH=/opt/rocm \ -DBUILD_STANDALONE=OFF \ -DBUILD_TESTS=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo ``` ### Step 3: Uninstall Previous ```bash sudo dpkg --remove --force-depends rdc-tests 2>/dev/null || true sudo dpkg --remove --force-depends rdc 2>/dev/null || true ``` ### Step 4: Install ```bash # Detect package format PKG_FMT=$(command -v dpkg >/dev/null && echo deb || echo rpm) if [ "$PKG_FMT" = "deb" ]; then sudo dpkg -i build/rdc*99999-local_amd64.deb 2>/dev/null || \ sudo dpkg -i build/rdc*.deb else sudo rpm -Uvh --force build/rdc*99999-local*x86_64.rpm 2>/dev/null || \ sudo rpm -Uvh --force build/rdc*.rpm fi ``` ### Step 5: Verify ```bash /opt/rocm/bin/rdci --version 2>/dev/null || rdci --version ``` ## One-Shot Command For use in scripts or as a single terminal command (DEB systems with gRPC): ```bash cd "$WORKSPACE" && \ sudo rm -rf build && \ mkdir -p build && cd build && \ cmake .. \ -DCMAKE_INSTALL_PREFIX=/opt/rocm \ -DCMAKE_PREFIX_PATH=/opt/rocm \ -DGRPC_ROOT="${GRPC_ROOT:-/opt/grpc}" \ -DBUILD_TESTS=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo && \ make -j "$(nproc)" && \ make package && \ sudo dpkg --remove --force-depends rdc-tests 2>/dev/null || true && \ sudo dpkg --remove --force-depends rdc 2>/dev/null || true && \ sudo dpkg -i rdc*99999-local_amd64.deb && \ rdci --version ``` ## Output On success, capture and report: - **Build time** (cmake + make duration) - **Package files** produced (names + sizes) - **Installed version** (output of `rdci --version`) - **Any warnings** from cmake or make (even if build succeeded) — pass these to the build and tests subagents On failure, capture and report: - **Which step failed** (configure, build, package, install) - **Full error output** from the failing command - **This is ❌ BLOCKING** — a build failure stops the review ## RPM Variant On RPM-based systems: ```bash # Uninstall sudo rpm -e rdc-tests 2>/dev/null || true sudo rpm -e rdc 2>/dev/null || true # Install sudo rpm -Uvh --force build/rdc*99999-local*x86_64.rpm ``` Detect which to use: `command -v dpkg >/dev/null && echo deb || echo rpm` ## Notes - `BUILD_STANDALONE=OFF` skips rdcd/rdci but still builds librdc.so — useful when gRPC is not available - gRPC compilation is slow — strongly recommend ccache: `cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ...` - If AMDSMI is not installed at `/opt/rocm`, set `-DCMAKE_PREFIX_PATH` to the AMDSMI install prefix
在 GitHub 查看