[runtime-library] Rename the library name ireert into iree #97
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.
The Problem
Currently, for macOS and iOS, we build the IREE runtime into
ireert.framework
. Header files in/runtime/src
is copied to the directoryHeaders/iree
ofireert.framework
. Following the convention of Objective-C, in an iOS app, we can import an IREE header file from the framework as the following:where
ireert
is the framework name,iree
is the directory inHeaders
.Unfortunately, the build of our Objective-C app would fail because in
status.h
, there are lines like the following.Note that this include path does not start with
ireert
, so the compiler complains not found header file "attributes.h".Idea 1. Change the IREE runtime code.
A straightforward idea is to change the IREE source code and replace the above line into
This does not make sense because the IREE authors, when writing the runtime code, have no idea that we will build their work into a framework named
ireert
.Idea 2. Add search path in the ireert.framework in Xcode
In Xcode, we can add
$(SRCROOT)/ireert.xcframework/arm64-ios-sim/ireert.framework/Headers/iree
to the search path, so the compiler can find file like"iree/base/attributes.h"
.This is not ideal because we will need to manually add paths for each platform in the XCFramework. We might support more and more platforms in the future, including tvOS and watchOS.
Idea 3. Rename ireert into iree
This is what this pull request does.
In addition to renaming the framework/xcframework, we also change the mapping of header files. Rather than mapping
iree/runtime/src/*
, we mapiree/runtime/src/iree
toHeaders
.After the name changing, in our iOS app, we do
instead of
Here,
iree
is the framework/xcframework name, andbase/status.h
is inHeaders
.This import has the same convention as we already have in the IREE source code, i.e.,
The Result
The following screenshot shows an iOS app developed with Xcode.
iree.xcframework
into this Xcode project. This XCFramework includes multipleiree.framework
s, each built for a certain platform.#import "iree/base/status.h"
to includestatus.h
from the XCFramework.status.h
file, it can just `#include "iree/base/attributes.h" as is.iree_status_fprint
.