Skip to content

Contributing: Building

Zachary Vincze edited this page May 27, 2026 · 2 revisions

Building

All builds happen out-of-source in a build/ directory.

mkdir build && cd build
cmake ../ [options]
cmake --build . --parallel

Build Options

Option Default Purpose
TESTS OFF C++ and Python test suites
BENCHMARKS OFF roccv_bench executable
SAMPLES OFF Example programs in samples/
FULL_BUILD OFF Shortcut: tests + samples
BUILD_PYPACKAGE ON rocpycv Python module
ENHANCED_MESSAGE ON Colorized CMake output
ENABLE_CODE_COVERAGE OFF LLVM coverage instrumentation (Debug only)
CMAKE_BUILD_TYPE Release Release or Debug
GPU_TARGETS (all supported) Semicolon-separated arch list
PYTHON_VERSION_SUGGESTED (auto) Pin a specific Python version
CMAKE_INSTALL_PREFIX /opt/rocm Install destination

Pass options with -D:

cmake -DTESTS=ON -DBENCHMARKS=ON ../

Common Recipes

Development build (tests + debug symbols):

cmake -DTESTS=ON -DCMAKE_BUILD_TYPE=Debug ../

Everything:

cmake -DFULL_BUILD=ON -DBENCHMARKS=ON ../

Target a single GPU (faster builds — only compiles one arch):

cmake -DGPU_TARGETS=gfx1100 ../

Multiple GPUs:

cmake -DGPU_TARGETS="gfx908;gfx1100" ../

Custom ROCm location:

cmake -DROCM_PATH=/opt/rocm-7.0.0 ../

Supported GPU Architectures

Default build targets all of: gfx908, gfx90a, gfx942, gfx950, gfx1030–1032, gfx1100–1102, gfx1200–1201.

Restrict to your hardware with GPU_TARGETS to cut build time significantly.

Build Output

Path Contents
build/lib/ libroccv.so, rocpycv*.so
build/bin/ Sample executables, roccv_bench
build/bin/tests/ Test executables (if TESTS=ON)

Installing

sudo cmake --install .

Installs to CMAKE_INSTALL_PREFIX (default /opt/rocm or $ROCM_PATH if set). Override with:

Rebuilding Cleanly

cmake caches options. To change GPU_TARGETS or build type, either re-pass -D flags or wipe the build dir:

rm -rf build && mkdir build && cd build

Next Steps

Clone this wiki locally