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

Add llvm-link and clang to CMake install #14768

Merged
merged 2 commits into from
Aug 23, 2023
Merged

Conversation

hcindyl
Copy link
Contributor

@hcindyl hcindyl commented Aug 21, 2023

They are used to generate ukernel bitcode targets. Include the binaries in the host tool install to support cross-compilation

The binaries will be added as CMake TARGET via iree_import_binary for cross-compile flows.

They are used to generate ukernel bitcode targets. Include the binaries
in the host tool install to support cross-compilation
@hcindyl hcindyl changed the title Add llvm-link and clang to install Add llvm-link and clang to CMake install Aug 21, 2023
@hcindyl hcindyl marked this pull request as ready for review August 21, 2023 23:19
@hcindyl hcindyl added the infrastructure Relating to build systems, CI, or testing label Aug 22, 2023
"${IREE_CLANG_BINARY}"
"clang"
Copy link
Member

Choose a reason for hiding this comment

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

There are other places using these CMake variables https://github.com/openxla/iree/blob/a623a93d27cd75b7c306a8282704f10b5a58ad3a/build_tools/cmake/iree_llvm.cmake#L74-L76 https://github.com/openxla/iree/blob/a623a93d27cd75b7c306a8282704f10b5a58ad3a/samples/custom_dispatch/cpu/embedded/CMakeLists.txt#L34-L39

I don't remember the full context here... but we should avoid having two different mechanisms for accessing the same tool

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 change in this PR uses the variables set in iree_llvm.cmake. I can make the changes in samples for the consistency.

The goal is of this PR to make ukernel bitcode gen working in the cross-compilation scenarios, so clang and llvm-link needs to be in install/bin and iree_bitcode_library macro can use binaries from IREE_HOST_BIN_DIR` instead from the CMake target list.

@hcindyl
Copy link
Contributor Author

hcindyl commented Aug 23, 2023

I sorted out the mechanism: The binaries need to be added in CMake install, and to be added to iree_import_binary for the cross-compile flows, so they can be found with CMake <TARGET_FILE:target> syntax.

@hcindyl hcindyl requested a review from ScottTodd August 23, 2023 00:45
@hcindyl hcindyl merged commit ae9b2c0 into iree-org:main Aug 23, 2023
50 checks passed
@hcindyl hcindyl deleted the llvm-link branch August 23, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Relating to build systems, CI, or testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants