agentleFS
ROCmROCm/rocprofiler-systems-skills/skills/rocprofsys-configure/SKILL.md

rocprofsys-configure

Skill5 starsChanged 17 days agoMITView on GitHub

Configure rocprofiler-systems build with CMake presets and custom options

  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. About 0 are common, 20 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 12
  2. Distinctive:

    Check if current directory is inside the project

    line 40
  3. Distinctive:

    Search common worktree locations

    line 41
  4. Distinctive:

    Ask user for location

    line 42
  5. Very specific:

    Must be the projects/rocprofiler-systems/ directory (not monorepo root)

    line 58
  6. Very specific:

    Must contain CMakeLists.txt and CMakePresets.json

    line 59
  7. Distinctive:

    Ask user what type of build they want:

    line 63
  8. Distinctive:

    Use AskUserQuestion to present options:

    line 73
  9. Distinctive:

    If no, use preset default

    line 104
  10. Distinctive:

    If yes, ask for custom path

    line 105
  11. Distinctive:

    If missing, build from source

    line 120
  12. Distinctive:

    If "Build from source" selected, set:

    line 136
  13. Distinctive:

    Ask about optional features:

    line 147
  14. Distinctive:

    After CMake runs, check for:

    line 184
  15. Distinctive:

    Should see "Build files have been written to..."

    line 188
  16. Distinctive:

    Check CMake output for enabled features

    line 191
  17. Distinctive:

    Verify dependencies found or built

    line 192
  18. Distinctive:

    Read error message carefully

    line 303
  19. Distinctive:

    Check for missing system dependencies

    line 304
  20. Distinctive:

    Check compiler version (GCC 7+)

    line 306
  21. Distinctive:

    Remove build directory and try again

    line 307
  22. Very specific:

    Monorepo awareness: Always verify you're in projects/rocprofiler-systems/, not the monorepo root

    line 319
  23. Distinctive:

    Clean slate: When changing major options (build type, dependencies), safer to remove build directory first

    line 324

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Configure ROCm Systems Profiler Build

Configures the rocprofiler-systems project using CMake with presets or custom options.

When to Use

Use this skill when:

  • User wants to configure rocprofsys build
  • Setting up build for first time
  • Switching between debug/release builds
  • Changing CMake options (dependencies, features)
  • User asks "how do I configure rocprofsys?"

Before You Start

Prerequisites:

  • CMake 3.21 or higher
  • GCC 7+ compiler (or Clang if Dyninst is pre-installed)
  • Ninja or Make build system

Check prerequisites:

cmake --version    # Should be >= 3.21
gcc --version      # Should be >= 7.0
ninja --version    # Optional but recommended

Process

Phase 1: Find Project Location

Since rocprofiler-systems is in a monorepo and may use git worktrees, find it dynamically.

Strategy:

  1. Check if current directory is inside the project
  2. Search common worktree locations
  3. Ask user for location
# Check current directory
if [ -f "CMakeLists.txt" ] && grep -q "rocprofiler-systems" CMakeLists.txt; then
    PROJECT_DIR="."
# Search worktrees
elif [ -d "/home/amd/worktree/rocm-systems" ]; then
    PROJECT_DIR=$(find /home/amd/worktree/rocm-systems -type d -name "rocprofiler-systems" | grep "projects/rocprofiler-systems$" | head -1)
# Ask user
else
    # Use AskUserQuestion to get path
fi

Validation:

  • Must be the projects/rocprofiler-systems/ directory (not monorepo root)
  • Must contain CMakeLists.txt and CMakePresets.json

Phase 2: Choose Configuration Strategy

Ask user what type of build they want:

OptionPresetUse For
DebugdebugDevelopment with debugging symbols
ReleasereleaseProduction, optimized build
Debug-Optimizeddebug-optimizedDebug symbols + optimizations
CIciCI/CD builds with all features
CustomNoneUser specifies all options manually

Use AskUserQuestion to present options:

header: "Build Type"
question: "Which build configuration do you want?"
options:
  - label: "Debug (Recommended for development)"
    description: "Debug build with tests enabled"
  - label: "Release"
    description: "Optimized production build"
  - label: "Debug-Optimized"
    description: "Optimized with debug symbols"
  - label: "CI"
    description: "Full CI build configuration"
  - label: "Custom"
    description: "Specify options manually"

Phase 3: Select Build Directory

Options:

  1. Use preset default (recommended)
    • Debug → build/debug
    • Release → build/release
    • Debug-Optimized → build/debug-optimized
    • CI → build/ci
  2. Custom directory
    • User specifies (e.g., build/my-build)

Ask user if they want to change default:

  • If no, use preset default
  • If yes, ask for custom path

Phase 4: Configure Dependencies

The project has complex dependencies. Determine which to build from source:

Key dependencies:

  • Dyninst (required for instrumentation)
  • TBB (required by Dyninst)
  • Boost (required by Dyninst)
  • Elfutils (required by Dyninst)
  • Libiberty (required by Dyninst)

Strategy:

  1. Try system packages first (faster)
  2. If missing, build from source

Use AskUserQuestion:

header: "Dependencies"
question: "How should dependencies be handled?"
options:
  - label: "Auto-detect (Recommended)"
    description: "Use system packages if available, build from source if missing"
  - label: "Build all from source"
    description: "Build Dyninst and all dependencies from source (slower but reliable)"
  - label: "Use system packages only"
    description: "Fail if system packages are missing"

If "Build from source" selected, set:

-DROCPROFSYS_BUILD_DYNINST=ON
-DROCPROFSYS_BUILD_TBB=ON
-DROCPROFSYS_BUILD_BOOST=ON
-DROCPROFSYS_BUILD_ELFUTILS=ON
-DROCPROFSYS_BUILD_LIBIBERTY=ON

Phase 5: Optional Features

Ask about optional features:

FeatureCMake OptionDefault
Python supportROCPROFSYS_USE_PYTHONON
MPI supportROCPROFSYS_USE_MPIOFF
PAPI hardware countersROCPROFSYS_USE_PAPION
TestingROCPROFSYS_BUILD_TESTINGON

Only ask if user selected "Custom" or explicitly wants to change features.

Phase 6: Run CMake Configure

With preset:

cd /path/to/projects/rocprofiler-systems
cmake --preset <preset-name>

With custom options:

cd /path/to/projects/rocprofiler-systems
cmake -B <build-dir> \
  -DCMAKE_BUILD_TYPE=<Debug|Release|RelWithDebInfo> \
  -DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems \
  -DROCPROFSYS_BUILD_DYNINST=<ON|OFF> \
  -DROCPROFSYS_BUILD_TBB=<ON|OFF> \
  -DROCPROFSYS_BUILD_BOOST=<ON|OFF> \
  -DROCPROFSYS_USE_PYTHON=<ON|OFF> \
  -DROCPROFSYS_BUILD_TESTING=<ON|OFF> \
  -G Ninja

Show configuration command to user before running.

Phase 7: Validate Configuration

After CMake runs, check for:

  1. Configuration success
    • CMake should exit with code 0
    • Should see "Build files have been written to..."
  2. Expected features enabled
    • Check CMake output for enabled features
    • Verify dependencies found or built
  3. Common warnings
    • Missing optional dependencies (PAPI, MPI)
    • Version mismatches
    • Compiler warnings

Report to user:

  • Configuration status (success/failure)
  • Enabled features
  • Any warnings or issues
  • Build directory location
  • Next step: use rocprofsys-build skill

Configuration Examples

Example 1: Quick Debug Build (Recommended for Development)

cd /path/to/projects/rocprofiler-systems
cmake --preset debug

Example 2: Release Build with All Dependencies from Source

cd /path/to/projects/rocprofiler-systems
cmake --preset release \
  -DROCPROFSYS_BUILD_DYNINST=ON \
  -DROCPROFSYS_BUILD_TBB=ON \
  -DROCPROFSYS_BUILD_BOOST=ON \
  -DROCPROFSYS_BUILD_ELFUTILS=ON \
  -DROCPROFSYS_BUILD_LIBIBERTY=ON

Example 3: Custom Configuration

cd /path/to/projects/rocprofiler-systems
cmake -B build/my-custom-build \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_INSTALL_PREFIX=$HOME/rocprofsys-install \
  -DROCPROFSYS_BUILD_DYNINST=ON \
  -DROCPROFSYS_BUILD_TBB=ON \
  -DROCPROFSYS_BUILD_BOOST=ON \
  -DROCPROFSYS_USE_PYTHON=ON \
  -DROCPROFSYS_USE_MPI=ON \
  -DROCPROFSYS_BUILD_TESTING=ON \
  -G Ninja

Output

This skill produces:

  • Configured build directory with CMake cache
  • build/<preset>/CMakeCache.txt
  • Build system files (Ninja or Makefiles)

Typical output structure:

projects/rocprofiler-systems/
└── build/
    └── debug/                    # Or release, debug-optimized, etc.
        ├── CMakeCache.txt
        ├── CMakeFiles/
        ├── build.ninja           # If using Ninja
        └── ...

Common Mistakes

MistakeFix
Configuring in wrong directoryMust be in projects/rocprofiler-systems/, not monorepo root
Using monorepo build directoryBuild dir must be inside the project, not at monorepo level
Missing dependenciesUse -DROCPROFSYS_BUILD_<DEP>=ON to build from source
CMake version too oldInstall CMake 3.21+: pip install --user cmake
In-source buildAlways use out-of-source: -B build/...
Forgetting generatorSpecify -G Ninja for faster builds
Not checking configuration outputAlways review CMake output for warnings

Troubleshooting

Issue: "Could not find Dyninst"

Solution:

cmake --preset debug -DROCPROFSYS_BUILD_DYNINST=ON \
  -DROCPROFSYS_BUILD_TBB=ON \
  -DROCPROFSYS_BUILD_BOOST=ON \
  -DROCPROFSYS_BUILD_ELFUTILS=ON \
  -DROCPROFSYS_BUILD_LIBIBERTY=ON

Issue: "CMake 3.21 or higher is required"

Solution:

pip install --user cmake==3.21.0
export PATH=$HOME/.local/bin:$PATH

Issue: "Wrong project directory"

Symptom: CMakeLists.txt doesn't mention rocprofiler-systems

Solution: Navigate to projects/rocprofiler-systems/ subdirectory within monorepo

Issue: "Configuration failed with errors"

Steps:

  1. Read error message carefully
  2. Check for missing system dependencies
  3. Try building dependencies from source
  4. Check compiler version (GCC 7+)
  5. Remove build directory and try again

Integration with Other Skills

After ConfigurationUse
Build configuredrocprofsys-build to compile
Need to reconfigureRemove build directory, run this skill again
Configuration failedCheck docs, install deps, try again

Notes

  • Monorepo awareness: Always verify you're in projects/rocprofiler-systems/, not the monorepo root
  • Git worktrees: Support multiple worktrees with different branches
  • Build isolation: Each branch/worktree can have its own build directory
  • Preset modification: Can override preset options with -D flags
  • Incremental changes: Can reconfigure without removing build directory (most of the time)
  • Clean slate: When changing major options (build type, dependencies), safer to remove build directory first

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.