Repository navigation
[MIOpen] Don't leak global BUILD_SHARED_LIBS into the superbuild - #11800
Merged
CMiservaAMD merged 3 commits intoSep 16, 2026
Merged
CMiservaAMD merged 3 commits into
CMiservaAMD merged 3 commits into
Conversation
…rbuild MIOpen set the global BUILD_SHARED_LIBS via option(), which writes a cache entry visible to sibling subprojects added later by a parent superbuild. That leaked ON forced siblings with a bare add_library (e.g. hipDNN's un-exported hipdnn_backend_private) to build shared, breaking install(EXPORT). Use a directory-scoped, guarded default instead so MIOpen's own linkage and codegen are unaffected while the value no longer leaks; an explicit user/parent -D or cache value is still honored. ALMIOPEN-2585 Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
CMiservaAMD
enabled auto-merge (squash)
September 9, 2026 18:06
…build-fix-global-scope-leak
6 tasks done
…build-fix-global-scope-leak
CMiservaAMD
deleted the
users/cmiserva/almiopen-2585/miopen-superbuild-fix-global-scope-leak
branch
September 16, 2026 00:53
Contributor
TheRock Submodule Bump ActivityNewest first
|
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.
Summary
MIOpen set the global
BUILD_SHARED_LIBSviaoption(), which writes a cacheentry visible to sibling subprojects added later by a parent superbuild. That
leaked
ONforced siblings that use a bareadd_library(e.g. hipDNN'sun-exported
hipdnn_backend_private) to build shared, breakinginstall(EXPORT).This replaces the global cache write with a directory-scoped, guarded default so
MIOpen's own linkage and
config.h/solver.hppcodegen are unaffected while thevalue no longer leaks to siblings; an explicit user/parent
-Dor cache value isstill honored.
JIRA ID : ALMIOPEN-2585
Risk Assessment
Risk 3. Narrow, single-file CMake scoping change with no runtime/device behavior
impact, but it touches MIOpen's linkage default, which is foundational to both the
superbuild and standalone builds — a mistake fails the build loudly rather than
silently. Validated against both a minimal synthetic CMake reproduction and a real
containerized superbuild configure with MIOpen built from source (see Testing).
ASIC Coverage
Architecture-independent: the change alters CMake library linkage scoping only — no
kernel selection, defaults, dispatch, or support-surface change, and no device
code. Passing PR CI (which builds the superbuild and MIOpen) is sufficient; no
specific-ASIC run or multi-arch sweep is required.
Testing Summary
ROCM_LIBS_ENABLE_COMPONENTS="miopen;hipdnn;...", fresh build dir): confirms theleak is gone at generate time and the resulting target linkage is correct.
ordering and hipDNN's bare add_library + install(EXPORT) structure, across
superbuild / standalone-default / standalone
-DBUILD_SHARED_LIBS=OFF.Testing Checklist
cmakeconfigure, gfx942 - Status: Passed (Generating done, no "not in any export set";libMIOpenSHARED,hipdnn_backend_privateSTATIC)Technical Changes
projects/miopen/CMakeLists.txt: replaceoption(BUILD_SHARED_LIBS "..." ON)(global cache write) with a guarded directory-scoped default
(
if(NOT DEFINED BUILD_SHARED_LIBS) set(BUILD_SHARED_LIBS ON) endif()), soMIOpen no longer leaks the global into a parent superbuild's sibling subprojects
while still honoring an explicit user/parent value.