-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-all.sh
executable file
·82 lines (57 loc) · 2.87 KB
/
build-all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
# Copyright (c) Project KanTV(www.cde-os.com). 2021-. All rights reserved.
function build_init()
{
if [ "x${PROJECT_ROOT_PATH}" == "x" ]; then
echo "pwd is `pwd`"
echo "pls run . build/envsetup in project's toplevel directory firstly"
exit 1
fi
}
function build_tensorflow()
{
cd ${PROJECT_ROOT_PATH}/tensorflow
./build_arm32.sh
./build_arm64.sh
}
function build_jni()
{
cd ${PROJECT_ROOT_PATH}
mkdir -p deepspeech-jni/libs/armeabi-v7a
mkdir -p deepspeech-jni/libs/arm64-v8a
mkdir -p examples/androiddemo/app/src/main/jniLibs/armeabi-v7a
mkdir -p examples/androiddemo/app/src/main/jniLibs/arm64-v8a
mkdir -p examples/androiddemo-streaming/app/src/main/jniLibs/armeabi-v7a
mkdir -p examples/androiddemo-streaming/app/src/main/jniLibs/arm64-v8a
if [ -d ${LOCAL_BAZEL_PATH}/execroot/org_tensorflow/bazel-out ]; then
/bin/cp -fv ${LOCAL_BAZEL_PATH}/execroot/org_tensorflow/bazel-out/armeabi-v7a-opt/bin/native_client/libdeepspeech.so deepspeech-jni/libs/armeabi-v7a/
/bin/cp -fv ${LOCAL_BAZEL_PATH}/execroot/org_tensorflow/bazel-out/arm64-v8a-opt/bin/native_client/libdeepspeech.so deepspeech-jni/libs/arm64-v8a/
/bin/cp -fv ${LOCAL_BAZEL_PATH}/execroot/org_tensorflow/bazel-out/armeabi-v7a-opt/bin/native_client/libdeepspeech.so examples/androiddemo/app/src/main/jniLibs/armeabi-v7a/
/bin/cp -fv ${LOCAL_BAZEL_PATH}/execroot/org_tensorflow/bazel-out/arm64-v8a-opt/bin/native_client/libdeepspeech.so examples/androiddemo/app/src/main/jniLibs/arm64-v8a/
/bin/cp -fv ${LOCAL_BAZEL_PATH}/execroot/org_tensorflow/bazel-out/armeabi-v7a-opt/bin/native_client/libdeepspeech.so examples/androiddemo-streaming/app/src/main/jniLibs/armeabi-v7a/
/bin/cp -fv ${LOCAL_BAZEL_PATH}/execroot/org_tensorflow/bazel-out/arm64-v8a-opt/bin/native_client/libdeepspeech.so examples/androiddemo-streaming/app/src/main/jniLibs/arm64-v8a/
cd ${PROJECT_ROOT_PATH}/deepspeech-jni
./build.sh
cd ${PROJECT_ROOT_PATH}
/bin/cp -fv deepspeech-jni/libs/armeabi-v7a/lib*jni*.so examples/androiddemo/app/src/main/jniLibs/armeabi-v7a/
/bin/cp -fv deepspeech-jni/libs/arm64-v8a/lib*jni*.so examples/androiddemo/app/src/main/jniLibs/arm64-v8a/
/bin/cp -fv deepspeech-jni/libs/armeabi-v7a/lib*jni*.so examples/androiddemo-streaming/app/src/main/jniLibs/armeabi-v7a/
/bin/cp -fv deepspeech-jni/libs/arm64-v8a/lib*jni*.so examples/androiddemo-streaming/app/src/main/jniLibs/arm64-v8a/
else
echo "pls check dev envs"
fi
}
function build_check()
{
cd ${PROJECT_ROOT_PATH}
ls -l deepspeech-jni/libs/arm64-v8a/
ls -l deepspeech-jni/libs/armeabi-v7a/
ls -l examples/androiddemo/app/src/main/jniLibs/armeabi-v7a/
ls -l examples/androiddemo/app/src/main/jniLibs/arm64-v8a/
ls -l examples/androiddemo-streaming/app/src/main/jniLibs/armeabi-v7a/
ls -l examples/androiddemo-streaming/app/src/main/jniLibs/arm64-v8a/
}
build_init
build_tensorflow
build_jni
build_check