Skip to content

CMake improvements - #160

Closed
marbre wants to merge 6 commits into
iree-org:masterfrom
marbre:cmake-1
Closed

marbre wants to merge 6 commits into
iree-org:masterfrom
marbre:cmake-1

Conversation

@marbre

@marbre marbre commented Nov 26, 2019

Copy link
Copy Markdown
Member

First changes to solve issue #90. This further closes #149.

@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@ScottTodd
ScottTodd self-requested a review November 26, 2019 18:28

@ScottTodd ScottTodd left a comment

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! Changes generally look good.

Please sign the Contributor License Agreement (see the comment from googlebot).

# See the License for the specific language governing permissions and
# limitations under the License.

add_executable(generate_cc_embed_data)

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.

I could see us wrapping the CMake add_executable in some sort of external_cc_binary util located here: https://github.com/google/iree/tree/master/build_tools/cmake. In general, we want the CMake files to closely match Bazel BUILD files in structure, so we can make mechanical changes (by hand or with a script) to synchronize them.

Maybe I could do the same thing with third_party/dear_imgui : https://github.com/google/iree/blob/0d41620fbe415d5fa3b492a804653c9dea9b8fd5/build_tools/third_party/dear_imgui/CMakeLists.txt#L81-L93

No action needed in this pull request, just making an observation.

@marbre

marbre commented Nov 26, 2019

Copy link
Copy Markdown
Member Author

Thanks! Changes generally look good.

Please sign the Contributor License Agreement (see the comment from googlebot).

I will sign the CLA asap. However, I thought it might be a good idea to already start the review process on the PR.

@GMNGeoffrey

Copy link
Copy Markdown
Member

Awesome, thanks for all the patches! With these all in, are you able to build the compiler portion with cmake? Wondering if I can set -DIREE_BUILD_COMPILER=ON on the CI?

@marbre

marbre commented Nov 27, 2019

Copy link
Copy Markdown
Member Author

@GMNGeoffrey
Unfortunately not. There is a huge bunch of patches missing to get the iree_translate target build with CMake. iree_translate depends on iree::compiler::Translation::SPIRV::Kernels which requires iree_glsl_cc_library to be implemented. Taking a look into the corresponding Bazel configuration, this requires iree_glsl_vulkan which is an alias to glsl_vulkan. So I already started to analyze the deps, but get it finally working will require some more effort. Do you think it be a good idea to document this in/open separate issues?

@marbre

marbre commented Nov 29, 2019

Copy link
Copy Markdown
Member Author

@googlebot I signed it!

@marbre

marbre commented Dec 10, 2019

Copy link
Copy Markdown
Member Author

@googlebot Rescan

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

iree-copybara-bot pushed a commit that referenced this pull request Dec 10, 2019
This PR complements #160. I implemented the generation of *emod*, *h* and *cc* files, by using `add_custom_command` to call `iree-translate` and `generate_cc_embed_data`.

At the moment, the `iree_translate` target to build the `iree-translate` executable still fails. For testing puposes, I added `#file(COPY "${CMAKE_SOURCE_DIR}/iree/tools/iree-translate" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")` to `iree/tools/CMakeLists.txt` and replaced `COMMAND iree-translate` by `COMMAND "${CMAKE_BINARY_DIR}/iree/tools/iree-translate"`. This allowed me to verify that the additions to the CMakeLists.txt work as expected, using the `iree-translate` executable build with Bazel.

Prior to (maybe) merging this, I would like to discuss if a *raw* `add_custom_command` is the way to go or, taking comment #160 (comment) into account, if wrapping, e.g. in a CMake function, would be preferable.

Closes #161

COPYBARA_INTEGRATE_REVIEW=#161 from marbre:cmake-2 082acb9
PiperOrigin-RevId: 284782756
@marbre
marbre deleted the cmake-1 branch December 10, 2019 21:22
iree-copybara-bot pushed a commit that referenced this pull request Dec 11, 2019
This PR depends on #160, which implements building `generate_cc_embed_data`. The PR does not implement `iree_glsl_cc_library`, but I think that can be refactored after getting the complete compiler or samples target working.

Closes #164

COPYBARA_INTEGRATE_REVIEW=#164 from marbre:cmake-3 3705c9e
PiperOrigin-RevId: 284875458
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.

CMake build of mlir/xla fails

4 participants