TopRank Skills

Home / Claw Skills / Others / rose-container-tools
Official OpenClaw rules 15%

rose-container-tools

Build and run ROSE compiler tools using ROSE installed in a Docker container. Use when developing source-to-source translators, call graph analyzers, AST processors, or any tool that links against librose.so. Triggers on "ROSE tool", "callgraph", "AST traversal", "source-to-source", "build with ROSE", "librose".

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 rose-container-tools 技能。 若已安装,则直接安装 rose-container-tools 技能。

Overview

Skill Key
chunhualiao/rose-container-tools
Author
chunhualiao
Source Repo
openclaw/skills
Version
0.1.0
Source Path
skills/chunhualiao/rose-container-tools
Latest Commit SHA
1f58d79714e9bb78f2ce39102a40c4417bff2611

Extracted Content

SKILL.md excerpt

# ROSE Container Tools

Build and run ROSE-based source code analysis tools using ROSE installed in a container.

## ⚠️ ALWAYS Use Makefile

**Never use ad-hoc scripts or command-line compilation for ROSE tools.**

- Use `Makefile` for all builds
- Enables `make -j` parallelism
- Ensures consistent flags
- Supports `make check` for testing

## Why Container?

ROSE requires GCC 7-10 and specific Boost versions. Most modern hosts don't have these. The container provides:
- Pre-installed ROSE at `/rose/install`
- Correct compiler toolchain
- All dependencies configured

## Quick Start

### 1. Start the Container

```bash
# If container exists
docker start rose-tools-dev
docker exec -it rose-tools-dev bash

# Or create new container
docker run -it --name rose-tools-dev \
  -v /home/liao/rose-install:/rose/install:ro \
  -v $(pwd):/work \
  -w /work \
  rose-dev:latest bash
```

### 2. Build with Makefile

**Always use Makefile to build ROSE tools. Never use ad-hoc scripts.**

```bash
# Inside container
make        # Build all tools
make check  # Build and test
```

### 3. Run the Tool

```bash
./build/my_tool -c input.c
```

## Makefile (Required)

Create `Makefile` for your tool:

```makefile
ROSE_INSTALL = /rose/install

CXX      = g++
CXXFLAGS = -std=c++14 -Wall -g -I$(ROSE_INSTALL)/include/rose
LDFLAGS  = -L$(ROSE_INSTALL)/lib -Wl,-rpath,$(ROSE_INSTALL)/lib
LIBS     = -lrose

BUILDDIR = build
SOURCES  = $(wildcard tools/*.cpp)
TOOLS    = $(patsubst tools/%.cpp,$(BUILDDIR)/%,$(SOURCES))

.PHONY: all clean check

all: $(TOOLS)

$(BUILDDIR)/%: tools/%.cpp
	@mkdir -p $(BUILDDIR)
	$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(LIBS)

check: all
	@for tool in $(TOOLS); do \
		echo "Testing $$tool..."; \
		LD_LIBRARY_PATH=$(ROSE_INSTALL)/lib $$tool -c tests/hello.c; \
	done

clean:
	rm -rf $(BUILDDIR)
```

## Example: Identity Translator

Minimal ROSE tool that parses and unparses code:

```cpp
// tools/identity.cpp
#include "rose.h"

int main(int argc, char* argv[]) {
    SgPro...

Related Claw Skills