rocprofsys-build
Skill5 starsChanged 17 days agoMITView on GitHub
Build, test, and install rocprofiler-systems after configuration
In this repository50 other files it gives its agents.
- analyze-pr-commentsSkill
- architecture-analyzeSkill
- architecture-tradeoffSkill
- askSkill
- code-smellsSkill
- debugging-rocprof-sysSkill
- exploration-explore-codeSkill
- git-commitSkill
- git-gh-clientSkill
- git-prepare-pull-requestSkill
- git-pull-request-statusSkill
- gitSkill
- grill-meSkill
- library-amd-smiSkill
- notify-meSkill
- planning-architectureSkill
- planning-baseSkill
- planning-bugfixSkill
- planning-docsSkill
- planning-featureSkill
- planning-refactorSkill
- programming-cmake-best-practicesSkill
- programming-cpp-constexprSkill
- programming-cpp-design-patternsSkill
- programming-cpp-naming-rulesSkill
- programming-cpp-policy-based-diSkill
- programming-cppSkill
- programming-cpp-stl-algorithmsSkill
- programming-pythonSkill
- pr-review-interactiveSkill
- pr-reviewSkill
- radisha-create-skillSkill
- radisha-helpSkill
- radisha-improve-skillSkill
- radisha-skillsSkill
- radisha-updateSkill
- refactoring-techniquesSkill
- review-architectureSkill
- rocprofsys-configureSkill
- rocprofsysSkill
- static-analysisSkill
- testing-gtest-gmockSkill
- testing-pytestSkill
- testing-testplanSkill
- therock-build-to-commitSkill
- therock-commit-in-buildSkill
- therock-first-build-with-commitSkill
- update-pr-descriptionSkill
- verify-pmc-metricsSkill
- watchSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 15 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when:
- Very specific: line 44
Must be in projects/rocprofiler-systems/
- Very specific: line 47
Check for standard locations: build/debug, build/release, etc.
- Very specific: line 52
Check for build system files (build.ninja or Makefile)
- Very specific: line 53
If missing → invoke rocprofsys-configure first
- Distinctive: line 62
Ask user what they want to build:
- Distinctive: line 156
If build fails, diagnose and help user:
- Distinctive: line 169
Read error message (usually at end of output)
- Distinctive: line 171
Check if dependency issue or code issue
- Distinctive: line 177
Verify compiler version (GCC 7+)
- Distinctive: line 183
If user selected "Build and test" or explicitly wants to run tests:
- Distinctive: line 203
Test output for failures
- Distinctive: line 206
Test summary (X/Y passed)
- Distinctive: line 212
If user selected "Build and install":
- Very specific: line 226
Default: /opt/rocprofiler-systems (usually needs sudo)
- Distinctive: line 257
Test results (if run)
- Very specific: line 336
Test logs in build/debug/Testing/
- Distinctive: line 371
Cause: Not in configured build directory or wrong command
- Very specific: line 406
Run single test with verbose output: ctest -R <test-name> -V
- Very specific: line 407
Check test log: cat build/debug/Testing/Temporary/LastTest.log
- Very specific: line 408
Run test binary directly: ./build/debug/tests/<test-binary>
- Distinctive: line 409
Check for missing runtime dependencies
- Distinctive: line 410
Check test environment (GPU available, etc.)
- Distinctive: line 456
Clean build: Use when switching branches or changing major options
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Build ROCm Systems Profiler
Builds the rocprofiler-systems project after configuration, optionally runs tests and installs.
When to Use
Use this skill when:
- Project is already configured (CMake cache exists)
- User wants to compile rocprofsys
- User wants to run tests
- User wants to install rocprofsys
- User asks "build rocprofsys" or "compile rocprofiler-systems"
Prerequisites
Before using this skill:
- Project must be configured (use
rocprofsys-configurefirst) - Build directory must exist with CMakeCache.txt
- Build system (Ninja or Make) must be available
Check if configured:
# Look for CMakeCache.txt in build directory
if [ -f build/debug/CMakeCache.txt ]; then
echo "Configured with debug preset"
elif [ -f build/release/CMakeCache.txt ]; then
echo "Configured with release preset"
else
echo "Not configured - run rocprofsys-configure first"
fiProcess
Phase 1: Verify Configuration
- Find project directory
- Same logic as
rocprofsys-configure - Must be in
projects/rocprofiler-systems/
- Same logic as
- Find build directory
- Check for standard locations:
build/debug,build/release, etc. - Or ask user which build directory to use
- Check for standard locations:
- Validate build is configured
- Check for
CMakeCache.txt - Check for build system files (
build.ninjaorMakefile) - If missing → invoke
rocprofsys-configurefirst
- Check for
Report to user:
- Build directory found
- Build type (Debug, Release, etc.)
- Configuration details (enabled features)
Phase 2: Determine Build Scope
Ask user what they want to build:
Use AskUserQuestion:
header: "Build Scope"
question: "What do you want to build?"
options:
- label: "Full build (Recommended)"
description: "Build all targets"
- label: "Specific target"
description: "Build a specific library or executable"
- label: "Build and test"
description: "Build everything and run tests"
- label: "Build and install"
description: "Build, test, and install to prefix"Phase 3: Determine Parallelism
Building rocprofsys can be memory-intensive. Determine parallel job count:
Strategy:
- Check available memory
- Suggest job count based on memory/cores
- Let user override
# Check system memory (GB)
TOTAL_MEM=$(free -g | awk '/^Mem:/{print $2}')
# Check CPU cores
TOTAL_CORES=$(nproc)
# Heuristic: ~4GB per parallel job for rocprofsys
SAFE_JOBS=$((TOTAL_MEM / 4))
MAX_JOBS=$((SAFE_JOBS > TOTAL_CORES ? TOTAL_CORES : SAFE_JOBS))
# Suggest to user
echo "Recommended: -j${MAX_JOBS}"Use AskUserQuestion:
header: "Parallel Jobs"
question: "How many parallel build jobs?"
options:
- label: "Auto (Recommended: -j8)"
description: "Based on system memory and cores"
- label: "Conservative (-j4)"
description: "Safer for systems with limited memory"
- label: "Maximum (-j$(nproc))"
description: "Use all CPU cores (may run out of memory)"
- label: "Custom"
description: "Specify job count manually"Phase 4: Build
Build command:
cmake --build <build-dir> -j <jobs> [--target <target>]Examples:
# Full build with 8 jobs
cmake --build build/debug -j8
# Build specific target
cmake --build build/debug -j8 --target rocprof-sys-run
# Verbose output (for debugging build issues)
cmake --build build/debug -j8 --verbose
# Clean and rebuild
cmake --build build/debug -j8 --clean-firstShow build progress:
- Ninja shows progress by default:
[123/456] Building CXX object... - Make needs
-jfor parallel build
Monitor for issues:
- Compiler errors
- Linker errors
- Out of memory errors
- Missing dependencies
Phase 5: Handle Build Errors (if any)
If build fails, diagnose and help user:
Common build errors:
| Error Type | Symptoms | Solution |
| Out of memory | c++: fatal error: Killed | Reduce parallel jobs: -j2 or -j4 |
| Missing headers | fatal error: xyz.h: No such file | Missing dependency, reconfigure with BUILD_<DEP>=ON |
| Linker errors | undefined reference to | Dependency issue, rebuild dependencies |
| Template errors | Long C++ template errors | Usually code issue, read error carefully |
| External dependency failure | Error in external/dyninst/ | Clean build, try again, or use system package |
Steps to diagnose:
- Read error message (usually at end of output)
- Identify which source file/target failed
- Check if dependency issue or code issue
- Suggest fix based on error type
If build fails repeatedly:
- Try clean rebuild: remove build directory, reconfigure
- Check system dependencies
- Verify compiler version (GCC 7+)
- Check disk space
- Reduce parallelism
Phase 6: Run Tests (Optional)
If user selected "Build and test" or explicitly wants to run tests:
# Run all tests
cd <build-dir>
ctest --output-on-failure
# Run tests in parallel
ctest -j8 --output-on-failure
# Run specific test
ctest -R <test-name> --output-on-failure
# Verbose test output
ctest -VMonitor test results:
- How many passed/failed
- Which tests failed
- Test output for failures
Report to user:
- Test summary (X/Y passed)
- Failed tests with output
- Next steps if tests fail
Phase 7: Install (Optional)
If user selected "Build and install":
# Install to prefix (may need sudo)
cmake --install <build-dir>
# Install to custom prefix
cmake --install <build-dir> --prefix /custom/path
# Install specific component
cmake --install <build-dir> --component <component>Check install prefix:
- Default:
/opt/rocprofiler-systems(usually needs sudo) - Can be changed during configure:
-DCMAKE_INSTALL_PREFIX=...
Verify installation:
# Check installed binaries
ls <install-prefix>/bin/rocprof-sys-*
# Check installed libraries
ls <install-prefix>/lib/librocprof-sys*
# Check setup script
cat <install-prefix>/share/rocprofiler-systems/setup-env.shSetup environment:
# Option 1: Source setup script
source /opt/rocprofiler-systems/share/rocprofiler-systems/setup-env.sh
# Option 2: Manual
export PATH=/opt/rocprofiler-systems/bin:$PATH
export LD_LIBRARY_PATH=/opt/rocprofiler-systems/lib:$LD_LIBRARY_PATHPhase 8: Report Results
On success:
- Build completed successfully
- Build time
- Number of targets built
- Test results (if run)
- Install location (if installed)
- Next steps (how to use rocprofsys)
On failure:
- What failed (build/test/install)
- Error summary
- Suggested fixes
- Whether to retry
Build Examples
Example 1: Quick Build
cd /path/to/projects/rocprofiler-systems
cmake --build build/debug -j8Example 2: Build with Tests
cd /path/to/projects/rocprofiler-systems
cmake --build build/debug -j8
cd build/debug
ctest --output-on-failureExample 3: Build and Install
cd /path/to/projects/rocprofiler-systems
cmake --build build/release -j8
sudo cmake --install build/releaseExample 4: Incremental Build (after code changes)
cd /path/to/projects/rocprofiler-systems
cmake --build build/debug -j8
# Only rebuilds changed filesExample 5: Clean Rebuild
cd /path/to/projects/rocprofiler-systems
cmake --build build/debug -j8 --clean-firstExample 6: Build Specific Target
cd /path/to/projects/rocprofiler-systems
cmake --build build/debug -j8 --target rocprof-sys-runOutput
This skill produces:
Build artifacts:
projects/rocprofiler-systems/
└── build/
└── debug/ # Or release, etc.
├── source/
│ ├── bin/
│ │ └── rocprof-sys-run/
│ │ └── rocprof-sys-run # Executable
│ └── lib/
│ └── rocprof-sys/
│ └── librocprof-sys.so # Library
└── ...Test results:
- CTest output
- Test logs in
build/debug/Testing/
Installation (if installed):
/opt/rocprofiler-systems/
├── bin/
│ ├── rocprof-sys-run
│ ├── rocprof-sys-instrument
│ └── ...
├── lib/
│ ├── librocprof-sys.so
│ └── ...
├── include/
│ └── rocprofiler-systems/
└── share/
└── rocprofiler-systems/
└── setup-env.shCommon Mistakes
| Mistake | Fix |
| Building without configuring | Run rocprofsys-configure first |
| Too many parallel jobs | Reduce to -j4 or -j2 if out of memory |
| Building in wrong directory | Must be in project root, build dir is specified with -B or --build |
| Not running tests | Always run tests after build, especially for changes |
| Installing without sudo | Use sudo cmake --install if prefix is /opt |
| Not checking test results | Review failed tests before proceeding |
| Ignoring build warnings | Some warnings indicate real issues |
Troubleshooting
Issue: "make: *** No targets specified"
Cause: Not in configured build directory or wrong command
Solution:
# Use cmake --build, not make directly
cmake --build build/debugIssue: "c++: fatal error: Killed signal terminated program"
Cause: Out of memory
Solution:
# Reduce parallel jobs
cmake --build build/debug -j2
# Or add swap spaceIssue: "ninja: error: loading 'build.ninja': No such file"
Cause: Build directory not configured
Solution:
# Run configure first
cmake --preset debug
# Then build
cmake --build build/debugIssue: Tests failing
Steps:
- Run single test with verbose output:
ctest -R <test-name> -V - Check test log:
cat build/debug/Testing/Temporary/LastTest.log - Run test binary directly:
./build/debug/tests/<test-binary> - Check for missing runtime dependencies
- Check test environment (GPU available, etc.)
Issue: Install fails with permission denied
Solution:
# Use sudo for system paths
sudo cmake --install build/release
# Or configure with user prefix
cmake -B build/release -DCMAKE_INSTALL_PREFIX=$HOME/rocprofsys
cmake --install build/release # No sudo neededIntegration with Other Skills
| After Build | Use |
| Build successful | Test the installation, run examples |
| Build failed | Review errors, reconfigure if needed |
| Tests failed | Debug failed tests, fix code |
| Ready to commit | git-commit to commit changes |
| Ready for PR | git-prepare-pull-request |
Build Targets Reference
Common targets:
all(default) - Build everythingrocprof-sys-run- Main profiler executablerocprof-sys-instrument- Binary instrumentation toolrocprof-sys-avail- Available metrics tooltests- Build all tests (without running)
To see all targets:
cmake --build build/debug --target helpNotes
- Incremental builds: CMake tracks dependencies, only rebuilds changed files
- Build cache: Object files cached in build directory for fast rebuilds
- Parallel builds: Ninja is faster than Make for parallel builds
- Memory usage: Building with all cores can use 20-30GB RAM
- Build time: Full build: 10-30 minutes (depends on parallelism, dependencies)
- Incremental build: Usually < 1 minute for small changes
- Clean build: Use when switching branches or changing major options
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

