Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
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".
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".
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Build and run ROSE-based source code analysis tools using ROSE installed in a container.
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
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
# 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
Always use Makefile to build ROSE tools. Never use ad-hoc scripts. # Inside container make # Build all tools make check # Build and test
./build/my_tool -c input.c
Create Makefile for your tool: 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)
Minimal ROSE tool that parses and unparses code: // tools/identity.cpp #include "rose.h" int main(int argc, char* argv[]) { SgProject* project = frontend(argc, argv); if (!project) return 1; AstTests::runAllTests(project); return backend(project); } Build and run: make ./build/identity -c tests/hello.c # Output: rose_hello.c (unparsed)
// tools/callgraph.cpp #include "rose.h" #include <CallGraph.h> int main(int argc, char* argv[]) { ROSE_INITIALIZE; SgProject* project = new SgProject(argc, argv); CallGraphBuilder builder(project); builder.buildCallGraph(); AstDOTGeneration dotgen; dotgen.writeIncidenceGraphToDOTFile( builder.getGraph(), "callgraph.dot"); return 0; }
// tools/ast_stats.cpp #include "rose.h" #include <map> class NodeCounter : public AstSimpleProcessing { public: std::map<std::string, int> counts; void visit(SgNode* node) override { if (node) counts[node->class_name()]++; } }; int main(int argc, char* argv[]) { SgProject* project = frontend(argc, argv); NodeCounter counter; counter.traverseInputFiles(project, preorder); for (auto& [name, count] : counter.counts) std::cout << name << ": " << count << "\n"; return 0; }
HeaderPurposerose.hMain header (includes most things)CallGraph.hCall graph constructionAstDOTGeneration.hDOT output for AST/graphssageInterface.hAST manipulation utilities
class MyTraversal : public AstSimpleProcessing { void visit(SgNode* node) override { // Process each node } }; MyTraversal t; t.traverseInputFiles(project, preorder);
class MyTraversal : public AstTopDownProcessing<int> { int evaluateInheritedAttribute(SgNode* node, int depth) override { return depth + 1; // Pass to children } };
class MyTraversal : public AstBottomUpProcessing<int> { int evaluateSynthesizedAttribute(SgNode* node, SynthesizedAttributesList childAttrs) override { int sum = 0; for (auto& attr : childAttrs) sum += attr; return sum + 1; // Return to parent } };
# Run from host docker exec -w /work rose-tools-dev make check # Or interactively docker exec -it rose-tools-dev bash cd /work make && make check
# Check include path echo $ROSE/include/rose ls $ROSE/include/rose/rose.h
# Check library path ls $ROSE/lib/librose.so
# Set library path export LD_LIBRARY_PATH=$ROSE/lib:$LD_LIBRARY_PATH
# Increase stack size ulimit -s unlimited
PathContents/rose/installROSE installation (headers, libs, bins)/rose/install/include/roseHeader files/rose/install/liblibrose.so and dependencies/rose/install/binROSE tools (identityTranslator, etc.)/workMounted workspace (your code)
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.