-
Notifications
You must be signed in to change notification settings - Fork 21
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
Unable to build LiteRT for Android #196
Comments
Is there any tutorial for building LiteRT for Android? |
try don't forget to you may need to clean it with |
also you can use |
My computer is Mac Studio Apple M1 Max Still error |
did you also hit try to add:
into WORKSPACE file. |
Do I need to execute ./configure first to complete the configuration? I executed ./configure and still got an error. |
Hi, @yg-dickson
Please follow the below instructions and let us know is it working as expected or not ?
Thank you for your cooperation and patience. |
I did follow this step. (fastapi) ➜ sit git clone https://github.com/google-ai-edge/LiteRT.git Found possible Python library paths: Do you wish to build TensorFlow with ROCm support? [y/N]: n Do you wish to build TensorFlow with CUDA support? [y/N]: n Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -Wno-sign-compare]: Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: y Please specify the home path of the Android NDK to use. [Default is /Users/wangchengyun/library/Android/Sdk/ndk-bundle]: /Users/wangchengyun/Library/Android/sdk/ndk/25.1.8937393 Please specify the (min) Android NDK API level to use. [Available levels: [16, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33]] [Default is 21]: 21 Please specify the home path of the Android SDK to use. [Default is /Users/wangchengyun/library/Android/Sdk]: /Users/wangchengyun/Library/Android/sdk Please specify the Android SDK API level to use. [Available levels: ['24', '28', '29', '30', '31', '32', '33', '34', '35']] [Default is 35]: 30 Please specify an Android build tools version to use. [Available versions: ['30.0.2', '30.0.3', '33.0.1', '34.0.0', '35.0.0']] [Default is 35.0.0]: 30.0.3 Do you wish to build TensorFlow with iOS support? [y/N]: n Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
|
add
to WORKSPACE file |
bazel build -c opt --cxxopt=--std=c++17 --config=android_arm64
--fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a
--define=android_dexmerger_tool=d8_dexmerger
--define=android_incremental_dexing_tool=d8_dexbuilder
//tensorflow/lite/java:tensorflow-lite
Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=123
INFO: Reading rc options for 'build' from /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc:
'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility --config=v2 --config=litert_prefixes
INFO: Found applicable config definition build:short_logs in file /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:litert_prefixes in file /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc: --define=litert_prefixes=external/org_tensorflow/
INFO: Found applicable config definition build:android_arm64 in file /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc: --config=android --cpu=arm64-v8a --fat_apk_cpu=arm64-v8a
INFO: Found applicable config definition build:android in file /Users/wang/IdeProjects/tflite-ai/client/LiteRT/.bazelrc: --crosstool_top=//external:android/crosstool --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --dynamic_mode=off --define=xnn_enable_avxvnniint8=false --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
DEBUG: /private/var/tmp/wang/c286a78069d91d2d2c206403e296a20d/external/local_tsl/third_party/py/python_repo.bzl:98:14:
HERMETIC_PYTHON_VERSION variable was not set correctly, using default version.
Python 3.11 will be used.
To select Python version, either set HERMETIC_PYTHON_VERSION env variable in
your shell:
export HERMETIC_PYTHON_VERSION=3.12
OR pass it as an argument to bazel command directly or inside your .bazelrc
file:
--repo_env=HERMETIC_PYTHON_VERSION=3.12
DEBUG: /private/var/tmp/wang/c286a78069d91d2d2c206403e296a20d/external/local_tsl/third_party/py/python_repo.bzl:109:10: Using hermetic Python 3.11
ERROR: Skipping '//tensorflow/lite/java:tensorflow-lite': no such package 'tensorflow/lite/java': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
WARNING: Target pattern parsing failed.
ERROR: no such package 'tensorflow/lite/java': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
INFO: Elapsed time: 2.220s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
The text was updated successfully, but these errors were encountered: