Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shortfin][build] Improve dependency management for builds #132

Merged
merged 11 commits into from
Aug 22, 2024

Conversation

Groverkss
Copy link
Contributor

Add logic to cmake configuration to automatically download dependencies if they cannot be found. Also adds a flag to specify SHORTFIN_IREE_SOURCE_DIR to build iree out-of-tree.

libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
# tests

if(SHORTFIN_BUILD_TESTS)
if (SHORTFIN_IREE_SOURCE_DIR)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should modernize how IREE does this so it plays nicely with others. The right way to do it would be to teach IREE how to fetch googletest dynamically and then make ours available before including IREE (these work as first one wins).

Copy link
Contributor Author

@Groverkss Groverkss Aug 20, 2024

Choose a reason for hiding this comment

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

I'm not very sure how to do that on the IREE side. Can we namespace the iree googletest dependency? I'm planning on atlest not doing a add_subdirectory on google test in IREE if we are not building tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree we should take a look into modernizing IREE. For now I am fine with this but we should add it to the list for future improvements.

if(SHORTFIN_IREE_SOURCE_DIR)
set(IREE_BUILD_COMPILER OFF)
set(IREE_BUILD_TESTS OFF)
add_subdirectory(${SHORTFIN_IREE_SOURCE_DIR} iree SYSTEM)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also only enable backends that we care about: right now just local and amdgpu.

Also, for my own edification, why do you need SYSTEM here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Following the discussion on discord, seems like there is a unused function error propagating from IREE and due to -Wno-used-function set. However, just building with IREE_BUILD_COMPILER_OFF shouldn't trigger that error (we don't see it in iree-bare-metal-arm) but I can dig into with @Groverkss tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error comes because IREE uses -Wno-unused-function and other compilation options, while our CMakeLists.txt doesn't (for now at least). IREE will fail to compile without these flags. I used SYSTEM to isolate IREE's compilation flags to itself. I'm guessing this could also bite us in future if we wanted to use some of our own flags. Not sure whats preferred here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's go with what you have (at least) for now :)

@Groverkss Groverkss changed the title [build] Improve dependency management for builds [shortfin][build] Improve dependency management for builds Aug 21, 2024
Copy link
Collaborator

@marbre marbre left a comment

Choose a reason for hiding this comment

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

Some first thoughts. Will test locally before hitting the approve button.

libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
libshortfin/CMakeLists.txt Show resolved Hide resolved
libshortfin/CMakeLists.txt Outdated Show resolved Hide resolved
libshortfin/CMakeLists.txt Show resolved Hide resolved
libshortfin/CMakeLists.txt Show resolved Hide resolved
libshortfin/CMakeLists.txt Show resolved Hide resolved
libshortfin/CMakeLists.txt Show resolved Hide resolved
@Groverkss Groverkss merged commit cb0f176 into main Aug 22, 2024
3 of 4 checks passed
@Groverkss Groverkss deleted the users/Groverkss/dep-manage branch August 22, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants