Docs & Packaging - streamline rocAL dependency documentation and fix CPack metadata - #509
Draft
levxn wants to merge 3 commits into
Draft
Docs & Packaging - streamline rocAL dependency documentation and fix CPack metadata#509levxn wants to merge 3 commits into
levxn wants to merge 3 commits into
Conversation
Contributor
|
Update |
sruthi0107
reviewed
Aug 17, 2026
| # (e.g. libprotobuf23 on Ubuntu 22.04, libprotobuf32t64 on Ubuntu 24.04), so resolve it from the | ||
| # actual library dpkg found on the build machine instead of hardcoding one version. | ||
| set(PROTOBUF_DEBIAN_PACKAGE_NAME "") | ||
| if(EXISTS ${DPKG_EXE} AND PROTOBUF_LIBRARY) |
Contributor
There was a problem hiding this comment.
PROTOBUF_LIBRARY is not defined at this scope so the dpkg auto-lookup path most likely does not execute and falls back to the hard-coded alternate. Also, FindProtobuf sets Protobuf_LIBRARY_RELEASE. Recommend either removing this block as dead code or adding find_package(Protobuf QUIET) before this block and modifying the variable name to Protobuf_LIBRARY_RELEASE.
| set(ROCAL_DEBIAN_DEV_PACKAGE_LIST "half, hip-dev, openmp-extras-dev, mivisionx-dev, libprotobuf-dev, libturbojpeg0-dev") | ||
| set(ROCAL_RPM_DEV_PACKAGE_LIST "half, hip-devel, openmp-extras-devel, mivisionx-devel, protobuf-devel") | ||
|
|
||
| # Protobuf is a hard-required core dependency, but its runtime .so was previously only declared |
Contributor
There was a problem hiding this comment.
@levxn not sure what this section is trying to achieve. @kiritigowda can you take a look. Seems like it's touching packaging
levxn
marked this pull request as draft
August 18, 2026 17:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Progress to issue #348
The issue's
readelf -d/ldddumps didn't match either the README's documented prerequisites or the current build's realNEEDEDlist. Auditing the CMakefind_package/BUILD_ROCALgating logic showed:rocAL_pybindlinks the system Python3 runtime into the corelibrocal.sotarget itself (not just the pybind module), which is whylibpython3.12.soshows up in the library'sNEEDEDlist even for users who only care about the C++ API..deb/.rpmDepends:/Requires:lists were hand-maintained strings inCMakeLists.txtthat had drifted from actual linkage: Protobuf's runtime.so(a hard-required dependency) was only declared in the-devpackage lists, and LMDB/FFmpeg/libsndfile/hipFile were never declared even when found and linked at build time.FFMPEG_FOUNDandhipFile_FOUNDwere never cached asCACHE INTERNAL, so the rootCMakeLists.txtcouldn't see them afteradd_subdirectory(rocAL)to drive any conditional packaging logic.libopencv_*entries) but is notfind_package'd or used anywhere in the currentrocAL/rocAL/{include,source}tree (only a stale comment inturbo_jpeg_decoder.cpp) — confirmed viareadelf -dthat the current build has zero OpenCV entries, so the issue's dump was captured against an older build/config. Left as a follow-up to clean up the Dockerfiles, which still build OpenCV from source unnecessarily.Technical Details
README.md: split the "Libraries" prerequisites into Required and Optional (feature-enabling) sections; moved FFMPEG/rocDecode/rocJPEG into Optional; added libsndfile, Libtar (with from-source build steps, since no distro package exists), DLPack, and hipFile, none of which were previously documented; added a note about the pybind-into-core Python3 linkage; mirrored the same required/optional split in the "Install prerequisites" and "Package install" sections.cmake/FindFFmpeg.cmake: addedset(FFMPEG_FOUND ${FFMPEG_FOUND} CACHE INTERNAL "")at the end of the module, matching the pattern already used byFindLMDB.cmake/FindSndFile.cmake/FindLibTar.cmake, so the rootCMakeLists.txtcan see whether FFmpeg was actually linked.rocAL/CMakeLists.txt: added the equivalentset(hipFile_FOUND ${hipFile_FOUND} CACHE INTERNAL "")right after thefind_package(hipFile CONFIG QUIET)/ legacyhipfilefallback block.CMakeLists.txt(root):CPACK_DEBIAN_PACKAGE_SHLIBDEPS(+ per-componentCPACK_DEBIAN_RUNTIME_PACKAGE_SHLIBDEPS/_DEV_/_ASAN_) and flippedCPACK_RPM_PACKAGE_AUTOREQPROVfrom"no"to"yes", sodpkg-shlibdeps/ rpmbuild's auto-Requires:derive the real, versioned dependency list fromlibrocal.so's actualNEEDEDentries going forward.ROCAL_DEBIAN_PACKAGE_LIST/ROCAL_RPM_PACKAGE_LIST, resolved dynamically viadpkg -Sagainst the actual linked.so(falling back to a versioned alternation across Ubuntu 22.04/24.04 SONAMEs if that lookup fails, e.g. a from-source Protobuf build)._FOUNDvariables, as a fallback safety net in case shlibdeps/autoreq isn't reliable in a given CI/packaging environment.Affected files:
README.md,CMakeLists.txt,cmake/FindFFmpeg.cmake,rocAL/CMakeLists.txt.Test Plan
Reconfigured the existing HIP-backend build and built the actual
.debpackages to confirm the packaging metadata reflects real linkage:
Test Result
Before fix:
FFMPEG_FOUND/hipFile_FOUNDwere invisible to the rootCMakeLists.txt, soffmpeg/hipfilenever appeared in the DEB Depends: list despite being linked intolibrocal.so; Protobuf's runtime.sohad no runtime package declared at all.After fix:
cmake ..configure log now showsffmpeg, libsndfile1, hipfilepresent in the printedAMD ROCm rocAL DEB RunTime Packageline, and the generatedrocal_2.5.0-local_amd64.deb's Depends: field includes both the manual fallback entries and automatically-detected, correctly-versioned entries derived bydpkg-shlibdeps, includinglibavcodec60 (>= 7:6.0), liblmdb0 (>= 0.9.7), libprotobuf32t64 (>= 3.21.12), libsndfile1 (>= 1.0.20), andlibpython3.12t64 (>= 3.12.1)(the pybind-into-core-library finding) — all of which cross-check against the realNEEDEDentries from readelf -d. RPM Requires: auto-detection was not locally verifiable (rpmbuildis not installed in this environment) and should be confirmed in a RHEL/SLES-based CI job before merge.