Skip to content

Add a documentation for android llvm aot - #2386

Merged
asaadaldien merged 2 commits into
mainfrom
aot-android-doc
Jul 1, 2020
Merged

asaadaldien merged 2 commits into
mainfrom
aot-android-doc

Conversation

@asaadaldien

Copy link
Copy Markdown
Contributor

Add a getting started documentation for compiling and running IREE module with dylib-llvm-aot backend

Add a getting started documentation for compiling and running IREE module with dylib-llvm-aot backend
@asaadaldien
asaadaldien requested a review from antiagainst July 1, 2020 20:10
@asaadaldien
asaadaldien requested a review from ScottTodd July 1, 2020 20:10

@stellaraccident stellaraccident left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

@ScottTodd
ScottTodd self-requested a review July 1, 2020 20:39
@ScottTodd ScottTodd added the documentation ✏️ Improvements or additions to documentation label Jul 1, 2020
@asaadaldien
asaadaldien merged commit 8a476a2 into main Jul 1, 2020
@asaadaldien
asaadaldien deleted the aot-android-doc branch July 1, 2020 20:51

@antiagainst antiagainst 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.

Cool stuff!

$ export ANDROID_ARM64_TOOLCHAIN=<path to put new arm64 toolchain>
$ $ANDROID_NDK/build/tools/make-standalone-toolchain.sh --arch=arm64 --platform=android-29 \
--install-dir=$ANDROID_ARM64_TOOLCHAIN
$ export IREE_LLVMAOT_LINKER_PATH=$ANDROID_ARM64_TOOLCHAIN/aarch64-linux-android/bin/ld

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.

Is this IREE_LLVMAOT_LINKER_PATH path to be read by iree-translate to invoke the linker under the hood? Is it possible to provide a "default" value for it when compiling iree-translate? When cross compiling towards Android, we already specified the ANDROID_ABI and ANDROID_PLATFORM. Together with android.toolchain.cmake, we should be able to figure out which ld to use by using the ANDROID_TOOLCHAIN_PREFIX cmake variable. so here we are requiring to provide the information again and making a standalone toolchain, which is a bit annoying. Particularly because standalone toolchain has a big "obsolete" in its title..

Not really blocking, but want to see what you think here. :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Chatted with @antiagainst offline. Very good idea I will file an issue to forward android.toolchain.cmake linker path when building host tools.


### Dylib LLVM AOT backend

To compile iree module for the target android device (assume aarch64,android 29)

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.

s/iree/IREE/
s/android/Android/
"Android 10 AArch64"

### Dylib LLVM AOT backend

To compile iree module for the target android device (assume aarch64,android 29)
we need install standalone toolchain and setting AOT linker path environment

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.

the corresponding standalone toolchain

we need install standalone toolchain and setting AOT linker path environment
variable:
```shell
$ export ANDROID_ARM64_TOOLCHAIN=<path to put new arm64 toolchain>

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.

/path/to/install/the/toolchain

variable:
```shell
$ export ANDROID_ARM64_TOOLCHAIN=<path to put new arm64 toolchain>
$ $ANDROID_NDK/build/tools/make-standalone-toolchain.sh --arch=arm64 --platform=android-29 \

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 think it's recommended to invoke the .py one.

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

Labels

documentation ✏️ Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants