Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Update find_package for msgpack to work with 5.x and 6.x and Capture configure-time PATH when invoking tensile at build time#2110

Open
zichguan-amd wants to merge2 commits intoROCm:develop
base:develop
Choose a base branch
Loading
fromzichguan-amd:therock

Conversation

zichguan-amd
Copy link

Comment on lines +93 to +104
# See: https://github.com/msgpack/msgpack-c/wiki/Q%26A#how-to-support-both-msgpack-c-c-version-5x-and-6x-
# Prefer 6.x (msgpack-cxx) as that is what we bundle in the build.
find_package(msgpack-cxx CONFIG)
if(msgpack-cxx_FOUND)
# Version 6.x
message(STATUS "Found msgpack-cxx (>=6.x)")
target_link_libraries(TensileHost PUBLIC msgpack-cxx)
else()
# Fallback to <= 5.x
find_package(msgpackc-cxx CONFIG REQUIRED NAMES msgpackc-cxx msgpack)
message(STATUS "Found msgpack (<=5.x)")
target_link_libraries(TensileHost PUBLIC msgpackc)
Copy link
Contributor

Choose a reason for hiding this comment

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

If we bundle v6 in the build do we need/want a fallback. I need to look into what versions are available across all of the supported platforms.

Choose a reason for hiding this comment

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

This isn't about "bundling" the dep with the build so much as it is about supporting the versions of msgpack-cxx that are in the wild. The msgpack project, for better or worse, changed the way you depend on their library between v5 and v6, forcing all of their consumers to react to that change.

TheRock does in fact bundle msgpack (6.x) but that could easily just come from a distro which installs that version (I think this is where the issue was first discovered: on a distro that was shipping v6).

Choose a reason for hiding this comment

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

afaict, nothing that we used of msgpack-cxx changed materially between v5 and v6 aside from how you take the dep -- and other consumers of it seem to concur (see link).

Choose a reason for hiding this comment

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

(we can take out the part of the comment about "bundle in the build". That is specific to how TheRock operates)

Comment on lines +225 to 228
set(CommandLine
"${CMAKE_COMMAND}" -E env "'PATH=$ENV{PATH}'" --
${CommandLine})
message(STATUS "Tensile_CREATE_COMMAND: ${CommandLine}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I trust this is necessary, but it is difficult to understand why. Can you provide some context for posterity?

Copy link

Choose a reason for hiding this comment

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

Sure. CMake builds are split into configure time and build time, with everything running at configure time being part of the former. Build time (i.e. things that run in make/ninja/etc) needs to not depend on environment variables provided in the configure time CMake invocation.

As it is presently, it is only possible to build a Tensile based project where you configure and build in the same shell environment, with the same variables set. This is not how multi-project builds (and various other kinds of automation) are done and is considered an anti-pattern.

In most projects, the configure side should fully resolve all needed tools to absolute paths and use them explicitly in the build phase vs relying on implicit build-time path based resolution. However, Tensile uses path based resolution extensively. I had a patch which attempted to plumb through absolute paths for everything, but it was quite intricate and something that should be considered for the future as its own thing (and the needed surgery is even worse in the hipblaslt version). As a partial step, since the project physically is not correct in its current state, this patch does the next best thing and at least preserves the configure-time PATH for use at build time when setting up custom commands. Without this, the build time PATH could be anything and the project fails to build unless if the build invocation is in the same shell environment.

Choose a reason for hiding this comment

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

I would recommend capturing this feedback in an issue for posterity and linking it in the source code. Ideally, in the future, we remove all PATH-based assumptions from Tensile and use explicit flags for tool locations, discovering them correctly at configure time.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stellaraccidentstellaraccidentstellaraccident left review comments

@elloselelloselellosel left review comments

@babakpstbabakpstAwaiting requested review from babakpstbabakpst is a code owner

@yoichiyoshidayoichiyoshidaAwaiting requested review from yoichiyoshidayoichiyoshida is a code owner

@bragadeeshbragadeeshAwaiting requested review from bragadeeshbragadeesh is a code owner

@AlexBrownAMDAlexBrownAMDAwaiting requested review from AlexBrownAMDAlexBrownAMD is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@zichguan-amd@stellaraccident@ellosel@marbre

[8]ページ先頭

©2009-2025 Movatter.jp