CMake install: missing cmake package exports and Python binding install to wrong prefix
@kiritigowda is already working on this.
Since Sep 18, 2026.
- Dominant language
- C++
- Stars
- 25
- Forks
- 26
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 2
Description
Summary
Audit of all install() directives in rocAL as part of the vision-pack aggregator work revealed two gaps: no cmake config files for modern find_package support, and the Python binding installing to lib/ instead of a Python-version-appropriate site-packages path.
Findings
1. No CMake package config files installed
rocAL installs librocal.so and 9 public headers but ships no cmake config files. Downstream projects must use a hand-written FindrocAL.cmake finder (the same pattern MIVisionX suffers from). This makes it impossible to do:
find_package(rocal CONFIG REQUIRED)
target_link_libraries(mylib PRIVATE rocal::rocal)
Fix: Add install(EXPORT rocalTargets ...) with a generated rocalConfig.cmake and rocalConfigVersion.cmake to ${CMAKE_INSTALL_LIBDIR}/cmake/rocal/, matching what rocCV already ships.
2. Python binding installs to lib/ instead of site-packages
rocAL_pybind/CMakeLists.txt installs the pybind extension module to ${CMAKE_INSTALL_LIBDIR} (i.e. /opt/rocm/lib/):
# rocAL_pybind/CMakeLists.txt:272-274
install(TARGETS ${mod_tgt}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT dev)
Installing Python extension modules to /opt/rocm/lib/ means they are not automatically importable — users must manually add /opt/rocm/lib to PYTHONPATH. The correct destination is the Python interpreter's site-packages directory, which can be queried via:
execute_process(
COMMAND "${Python3_EXECUTABLE}" -c
"import site; print(site.getsitepackages()[0])"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
OUTPUT_STRIP_TRAILING_WHITESPACE)
install(TARGETS ${mod_tgt}
LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
COMPONENT dev)
Similarly the amd/ Python package directory installs to ${CMAKE_INSTALL_LIBDIR}/amd which has the same discoverability problem.
Fix: Install pybind .so targets and the amd/ package to the Python site-packages directory. rocPyDecode has the same issue and a coordinated fix across both would be ideal.
Context
Found during vision-pack aggregator repo audit. rocCV already ships proper cmake exports — rocAL should follow suit. The Python install path issue affects all rocAL users on default ROCm installs who would not expect to set PYTHONPATH manually.
References
- vision-pack aggregator: https://github.com/ROCm/vision-pack
- rocCV cmake exports reference:
rocCV/src/CMakeLists.txt - Related: ROCm/MIVisionX#1761 (same cmake exports gap)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.