Skip to content

Enable building with THEROCK_BUNDLE_SYSDEPS set to OFF#3538

Merged
marbre merged 5 commits into
mainfrom
users/marbre/bundled-deps
Feb 24, 2026
Merged

Enable building with THEROCK_BUNDLE_SYSDEPS set to OFF#3538
marbre merged 5 commits into
mainfrom
users/marbre/bundled-deps

Conversation

@marbre
Copy link
Copy Markdown
Member

@marbre marbre commented Feb 20, 2026

When THEROCK_BUNDLE_SYSDEPS=OFF is set, the therock-* targets for sysdep libraries do not exist. Any component that hardcoded therock-zlib, therock-gmp, etc. as RUNTIME_DEPS or SUBPROJECT_DEPS would fail to configure, and rocgdb would emit fatal errors for each missing bundled staging path.
This makes progress to allow building with with bundles sysdeps disabled. Further work on rocr-debug-agents will be addressed upstream.

This patch

  • replaces all hardcoded therock-* target names in base/, debug-tools/, and third-party/grpc/ with the corresponding THEROCK_BUNDLED_* CMake variables.
  • makes rocGDB buildable with system-provided (non-bundled) sysdeps

@marbre marbre requested a review from lumachad February 20, 2026 15:05
@marbre marbre changed the title Enable building with THEROCK_BUNDLE_SYSDEPS set to OFF Enable building with THEROCK_BUNDLE_SYSDEPS set to OFF Feb 20, 2026
Comment thread debug-tools/rocgdb/CMakeLists.txt Outdated
@marbre marbre force-pushed the users/marbre/bundled-deps branch 2 times, most recently from 4745790 to 3bd7504 Compare February 20, 2026 15:30
Comment thread debug-tools/rocgdb/CMakeLists.txt
Comment thread debug-tools/rocgdb/CMakeLists.txt
@lumachad
Copy link
Copy Markdown
Contributor

@marbre FTR, this is the debug agent fix to allow unbundled sysdeps builds: ROCm/rocm-systems#3451

@marbre
Copy link
Copy Markdown
Member Author

marbre commented Feb 23, 2026

@marbre FTR, this is the debug agent fix to allow unbundled sysdeps builds: ROCm/rocm-systems#3451

Thanks! Left two comments.

marbre and others added 4 commits February 23, 2026 18:08
Replace hardcoded therock-* target names with the corresponding
${THEROCK_BUNDLED_*} variables in all consumer CMakeLists.txt files
outside of third-party/sysdeps. This allows components to build
correctly when THEROCK_BUNDLE_SYSDEPS=OFF, where those targets do
not exist and the build should fall back to system-provided libraries.

Co-Authored-By: Claude <noreply@anthropic.com>
When THEROCK_BUNDLE_SYSDEPS=OFF, rocgdb's CMakeLists.txt previously
issued a fatal error via fetch_library_prefix() for each missing bundled
staging path (gmp, mpfr, expat, ncurses). This blocked any configuration
that uses system-installed libraries.

Changes:
- debug-tools/CMakeLists.txt: forward THEROCK_BUNDLE_SYSDEPS into the
  rocgdb subproject cmake invocation.
- debug-tools/rocgdb/CMakeLists.txt:
  - Declare THEROCK_BUNDLE_SYSDEPS option (default OFF).
  - Make fetch_library_prefix() non-fatal: missing paths now emit
    STATUS and return an empty string instead of SEND_ERROR.
  - Guard fetch_library_prefix calls and ncurses include/rpath setup
    behind if(THEROCK_BUNDLE_SYSDEPS).
  - Conditionalize --with-expat-prefix, --with-gmp, --with-mpfr
    configure flags; when empty, autotools discovers the libraries
    via pkg-config from standard system paths.

Co-Authored-By: Claude <noreply@anthropic.com>
When building with system-provided libraries, the rocm_sysdeps/lib
RPATH entry serves no purpose and adds noise to the binary's RUNPATH.
Conditionalize it alongside the other bundled-sysdep logic.

ROCGDB_SYSDEPS_RPATH_SEGMENT is set to the $ORIGIN-relative segment
when bundling, and to empty string otherwise. CMake expands it into the
install(CODE) strings at configure time; bare $ORIGIN is not a CMake
variable reference so it is preserved literally for patchelf.

Co-Authored-By: Claude <noreply@anthropic.com>
@marbre marbre force-pushed the users/marbre/bundled-deps branch from d1b77b2 to cdf0d90 Compare February 23, 2026 17:09
@marbre marbre requested a review from lumachad February 23, 2026 17:22
@marbre
Copy link
Copy Markdown
Member Author

marbre commented Feb 23, 2026

@lumachad I rebased on the latest main, which also includes the elfutils patch. PTAL.

@marbre
Copy link
Copy Markdown
Member Author

marbre commented Feb 23, 2026

@ScottTodd I would appreciate if you could take a look at the non-rcgdb specific changes.

@marbre marbre requested a review from ScottTodd February 23, 2026 17:24
@marbre marbre marked this pull request as ready for review February 23, 2026 17:24
Comment on lines +209 to +216
${THEROCK_BUNDLED_BZIP2}
${THEROCK_BUNDLED_GMP}
${THEROCK_BUNDLED_MPFR}
${THEROCK_BUNDLED_EXPAT}
${THEROCK_BUNDLED_NCURSES}
${THEROCK_BUNDLED_LIBLZMA}
${THEROCK_BUNDLED_ZLIB}
${THEROCK_BUNDLED_ZSTD}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes rocGDB buildable with system-provided (non-bundled) sysdeps

Can you elaborate a bit more on the intended usage here?

  • Do you expect some subprojects to always build with "unbundled" (i.e. coming from the OS, outside the build system) sysdeps? Wouldn't that defeat the purpose of sysdeps? Is that okay/intended for rocgdb in particular?
  • Or do you expect that all subprojects should use the same THEROCK_BUNDLE_SYSDEPS value? Would we use that in our releases or would it be for developer use / non-portable deployments somehow?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That particular comment

makes rocGDB buildable with system-provided (non-bundled) sysdeps

refers to how rocDB sets CMake prefixes and other variables. The prefixes always where pointing to the bundled sysdeps even with THEROCK_BUNDLE_SYSDEPS set to OFF.

From my perspective THEROCK_BUNDLE_SYSDEPS should be a global setting respected by all components. Either build with what TheRock ships or with the system-installed libs (option 2). We had this a bit ago but this broke by not using the ${THEROCK_BUNDLED_* variables and instead hard coding the deps on packages that are only build with THEROCK_BUNDLE_SYSDEPS set to ON.

We won't use this in our releases but Linux distributions (which normally strictly disallow bundling deps) as well as the community (dev/user) might (see my comment #3477 (comment) or #3132).

Hope this makes it more clear?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. We might want a ~weekly (or some other reduced frequency) CI job that builds for e.g. Ubuntu in this mode to ensure that it continues working.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! Started as a drive by and ended up in more work than I expected.

Copy link
Copy Markdown
Contributor

@lumachad lumachad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for the rocgdb parts.

Comment thread debug-tools/rocgdb/CMakeLists.txt Outdated
@marbre marbre merged commit 013b5c8 into main Feb 24, 2026
77 checks passed
@marbre marbre deleted the users/marbre/bundled-deps branch February 24, 2026 13:39
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants