forked from mlcommons/mobile_app_open
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move make targets to separate files included into root makefile (mlco…
…mmons#167) * refactor root makefile Signed-off-by: Danil Uzlov <[email protected]> * rename docker flags var Signed-off-by: Danil Uzlov <[email protected]> * fix spaces in makefiles Signed-off-by: Danil Uzlov <[email protected]> * refactor qti makefile Signed-off-by: Danil Uzlov <[email protected]> * extract proxy args to common.mk Signed-off-by: Danil Uzlov <[email protected]> * extract android make targets to separate makefile Signed-off-by: Danil Uzlov <[email protected]> * allow to interrupt build in android docker Signed-off-by: Danil Uzlov <[email protected]> * refactor makefiles Signed-off-by: Danil Uzlov <[email protected]> * rename vendor backend flag vars Signed-off-by: Danil Uzlov <[email protected]> * add WITH_MEDIATEK info print Signed-off-by: Danil Uzlov <[email protected]> * rename make targets for flutter app Signed-off-by: Danil Uzlov <[email protected]> * rename flutter makefile Signed-off-by: Danil Uzlov <[email protected]> * integrate flutter makefile into root makefile Signed-off-by: Danil Uzlov <[email protected]> * remove deprecated documentation Signed-off-by: Danil Uzlov <[email protected]> * update flutter app documentation Signed-off-by: Danil Uzlov <[email protected]> * adjust windows container make targets (not tested) Signed-off-by: Danil Uzlov <[email protected]> * update android readme Signed-off-by: Danil Uzlov <[email protected]> * fix root makefile Signed-off-by: Danil Uzlov <[email protected]> * fix datasets makefile Signed-off-by: Danil Uzlov <[email protected]> * fix formatting Signed-off-by: Danil Uzlov <[email protected]> * add makefile for ios CI Signed-off-by: Danil Uzlov <[email protected]> * update flutter android ci config Signed-off-by: Danil Uzlov <[email protected]> * update readmes Signed-off-by: Danil Uzlov <[email protected]> * update flutter readme Signed-off-by: Danil Uzlov <[email protected]> * fix ci Signed-off-by: Danil Uzlov <[email protected]> * pin flutter version on CI Signed-off-by: Danil Uzlov <[email protected]> * return info about formatting tools in macos Signed-off-by: Danil Uzlov <[email protected]>
- Loading branch information
Showing
29 changed files
with
662 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
# Copyright 2020-2021 The MLPerf Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
########################################################################## | ||
|
||
.PHONY: android/builder-image | ||
android/builder-image: output/android_docker.stamp | ||
|
||
output/android_docker.stamp: android/docker/mlperf_mobile/Dockerfile | ||
mkdir -p output/docker | ||
docker image build -t mlcommons/mlperf_mobile_android_builder android/docker/mlperf_mobile | ||
touch $@ | ||
|
||
ANDROID_COMMON_DOCKER_FLAGS1= \ | ||
-it \ | ||
-e USER=mlperf \ | ||
${PROXY_WORKAROUND1} \ | ||
-v $(CURDIR):/home/mlperf/mobile_app \ | ||
-v $(CURDIR)/output/home/mlperf/cache:/home/mlperf/cache \ | ||
${QTI_VOLUMES} \ | ||
-w /home/mlperf/mobile_app \ | ||
-u `id -u`:`id -g` \ | ||
mlcommons/mlperf_mobile_android_builder bazel-3.7.2 | ||
|
||
ANDROID_COMMON_DOCKER_FLAGS2= \ | ||
${PROXY_WORKAROUND2} \ | ||
--output_user_root=/home/mlperf/cache/bazel build --verbose_failures \ | ||
-c opt --cxxopt='--std=c++14' --host_cxxopt='--std=c++14' \ | ||
--host_cxxopt='-Wno-deprecated-declarations' --host_cxxopt='-Wno-class-memaccess' \ | ||
--cxxopt='-Wno-deprecated-declarations' --cxxopt='-Wno-unknown-attributes' | ||
|
||
ANDROID_COMMON_DOCKER_FLAGS= \ | ||
${ANDROID_COMMON_DOCKER_FLAGS1} \ | ||
${ANDROID_COMMON_DOCKER_FLAGS2} | ||
|
||
|
||
ANDROID_NATIVE_DOCKER_FLAGS= \ | ||
${ANDROID_COMMON_DOCKER_FLAGS1} --bazelrc=/dev/null \ | ||
${ANDROID_COMMON_DOCKER_FLAGS2} | ||
|
||
.PHONY: android/proto_test | ||
android/proto_test: android/builder-image | ||
# Building proto_test | ||
mkdir -p output/home/mlperf/cache && chmod 777 output/home/mlperf/cache | ||
docker run \ | ||
${ANDROID_NATIVE_DOCKER_FLAGS} --experimental_repo_remote_exec \ | ||
//android/cpp/proto:proto_test | ||
cp output/`readlink bazel-bin`/android/cpp/proto/proto_test output/proto_test | ||
chmod 777 output/proto_test | ||
|
||
.PHONY: android/main | ||
android/main: android/builder-image | ||
# Building main | ||
mkdir -p output/home/mlperf/cache && chmod 777 output/home/mlperf/cache | ||
docker run \ | ||
${ANDROID_COMMON_DOCKER_FLAGS} \ | ||
--config android_arm64 //mobile_back_tflite:tflitebackend ${QTI_TARGET} //android/cpp/binary:main | ||
rm -rf output/binary && mkdir -p output/binary | ||
cp output/`readlink bazel-bin`/android/cpp/binary/main output/binary/main | ||
cp output/`readlink bazel-bin`/mobile_back_tflite/cpp/backend_tflite/libtflitebackend.so output/binary/libtflitebackend.so | ||
${QTI_LIB_COPY} | ||
chmod 777 output/binary/main output/binary/libtflitebackend.so | ||
|
||
.PHONY: android/libtflite | ||
android/libtflite: android/builder-image | ||
# Building libtflite | ||
mkdir -p output/home/mlperf/cache && chmod 777 output/home/mlperf/cache | ||
docker run \ | ||
${ANDROID_COMMON_DOCKER_FLAGS} \ | ||
--config android_arm64 //mobile_back_tflite:tflitebackend | ||
rm -rf output/binary && mkdir -p output/binary | ||
cp output/`readlink bazel-bin`/mobile_back_tflite/cpp/backend_tflite/libtflitebackend.so output/binary/libtflitebackend.so | ||
chmod 777 output/binary/libtflitebackend.so | ||
|
||
.PHONY: android/app | ||
android/app: android/builder-image | ||
# Building mlperf_app.apk | ||
mkdir -p output/home/mlperf/cache && chmod 777 output/home/mlperf/cache | ||
docker run \ | ||
${ANDROID_COMMON_DOCKER_FLAGS} \ | ||
${QTI_BACKEND_BAZEL_FLAG} \ | ||
${SAMSUNG_BACKEND_BAZEL_FLAG} \ | ||
${MEDIATEK_BACKEND_BAZEL_FLAG} \ | ||
${PIXEL_BACKEND_BAZEL_FLAG} \ | ||
--fat_apk_cpu=arm64-v8a \ | ||
//android/java/org/mlperf/inference:mlperf_app | ||
cp output/`readlink bazel-bin`/android/java/org/mlperf/inference/mlperf_app.apk output/mlperf_app.apk | ||
chmod 777 output/mlperf_app.apk | ||
|
||
.PHONY: android/app_x86_64 | ||
android/app_x86_64: android/builder-image | ||
# Building mlperf_app_x86_64.apk | ||
mkdir -p output/home/mlperf/cache && chmod 777 output/home/mlperf/cache | ||
docker run \ | ||
${ANDROID_COMMON_DOCKER_FLAGS} \ | ||
${QTI_BACKEND_BAZEL_FLAG} \ | ||
${SAMSUNG_BACKEND_BAZEL_FLAG} \ | ||
${MEDIATEK_BACKEND_BAZEL_FLAG} \ | ||
${PIXEL_BACKEND_BAZEL_FLAG} \ | ||
--fat_apk_cpu=x86_64 \ | ||
//android/java/org/mlperf/inference:mlperf_app | ||
cp output/`readlink bazel-bin`/android/java/org/mlperf/inference/mlperf_app.apk output/mlperf_app_x86_64.apk | ||
chmod 777 output/mlperf_app.apk | ||
|
||
.PHONY: android/test_app | ||
android/test_app: android/builder-image | ||
# Building mlperf_test_app.apk | ||
mkdir -p output/home/mlperf/cache && chmod 777 output/home/mlperf/cache | ||
docker run \ | ||
${ANDROID_COMMON_DOCKER_FLAGS} \ | ||
${QTI_BACKEND_BAZEL_FLAG} \ | ||
${SAMSUNG_BACKEND_BAZEL_FLAG} \ | ||
${MEDIATEK_BACKEND_BAZEL_FLAG} \ | ||
${PIXEL_BACKEND_BAZEL_FLAG} \ | ||
--fat_apk_cpu=x86_64,arm64-v8a \ | ||
//androidTest:mlperf_test_app | ||
cp output/`readlink bazel-bin`/android/androidTest/mlperf_test_app.apk output/mlperf_test_app.apk | ||
chmod 777 output/mlperf_test_app.apk | ||
|
||
.PHONY: android/rundocker | ||
android/rundocker: android/builder-image | ||
docker run -it \ | ||
-e USER=mlperf \ | ||
-v $(CURDIR):/home/mlperf/mobile_app \ | ||
-v $(CURDIR)/output/home/mlperf/cache:/home/mlperf/cache \ | ||
-w /home/mlperf/mobile_app \ | ||
-u `id -u`:`id -g` \ | ||
mlcommons/mlperf_mobile_android_builder | ||
|
||
.PHONY: android/rundocker_root | ||
android/rundocker_root: android/builder-image | ||
docker run -it \ | ||
-e USER=mlperf \ | ||
-v $(CURDIR):/home/mlperf/mobile_app \ | ||
-v $(CURDIR)/output/home/mlperf/cache:/home/mlperf/cache \ | ||
-w /home/mlperf/mobile_app \ | ||
mlcommons/mlperf_mobile_android_builder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Docker image name: mlcommons/mlperf_mobile:1.0 | ||
# Docker image name: mlcommons/mlperf_mobile_android_builder | ||
FROM ubuntu:bionic | ||
LABEL maintainer="[email protected]" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.