Build ClickHouse with various configurations (Release, Debug, ASAN, TSAN, etc.). Use when the user wants to compile ClickHouse.
View on GitHub.claude/skills/build/SKILL.md
February 2, 2026
Select agents to install to:
npx add-skill https://github.com/codacy-open-source-projects-scans/clickhouse/blob/d9eec838c19294e5f06e025db4c92ced33e9e10e/.claude/skills/build/SKILL.md -a claude-code --skill buildInstallation paths:
.claude/skills/build/# ClickHouse Build Skill
Build ClickHouse in `build/${buildType}` directory (e.g., `build/Debug`, `build/ASAN`, `build/RelWithDebInfo`).
## Arguments
- `$0` (optional): Build type - one of: `Release`, `Debug`, `RelWithDebInfo`, `ASAN`, `TSAN`, `MSAN`, `UBSAN`. Default: `RelWithDebInfo`
- `$1` (optional): Target - specific target to build (e.g., `clickhouse-server`, `clickhouse-client`, `clickhouse`). Default: `clickhouse`
- `$2+` (optional): Additional cmake/ninja options
## Build Types
| Type | Description | CMake Flags |
|------|-------------|-------------|
| `Release` | Optimized production build | `-DCMAKE_BUILD_TYPE=Release` |
| `Debug` | Debug build with symbols | `-DCMAKE_BUILD_TYPE=Debug` |
| `RelWithDebInfo` | Optimized with debug info | `-DCMAKE_BUILD_TYPE=RelWithDebInfo` |
| `ASAN` | AddressSanitizer (memory errors) | `-DCMAKE_BUILD_TYPE=Debug -DSANITIZE=address` |
| `TSAN` | ThreadSanitizer (data races) | `-DCMAKE_BUILD_TYPE=Debug -DSANITIZE=thread` |
| `MSAN` | MemorySanitizer (uninitialized reads) | `-DCMAKE_BUILD_TYPE=Debug -DSANITIZE=memory` |
| `UBSAN` | UndefinedBehaviorSanitizer | `-DCMAKE_BUILD_TYPE=Debug -DSANITIZE=undefined` |
## Common Targets
- `clickhouse` - Main all-in-one binary
- `clickhouse-server` - Server component
- `clickhouse-client` - Client component
- `clickhouse-local` - Local query processor
- `clickhouse-benchmark` - Benchmarking tool
## Build Process
**IMPORTANT:** This skill assumes the build directory is already configured with CMake. Do NOT run `cmake` or create build directories - only run `ninja`.
1. **Determine build configuration:**
- Build type: `$0` or `RelWithDebInfo` if not specified
- Target: `$1` or `clickhouse` if not specified
- Build directory: `build/${buildType}` (e.g., `build/RelWithDebInfo`, `build/Debug`, `build/ASAN`)
2. **Create log file and start the build:**
**Step 2a: Create temporary log file first:**
```bash
mktemp /tmp/build_clickhouse_XXXXXX.log
```
- This will