Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
bbbc9940
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
332
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bbbc9940
编写于
5月 07, 2020
作者:
H
huzhiqiang
提交者:
GitHub
5月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Compiling]Update build_android.sh and build_ios.sh (#3563)
上级
ba3e0778
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
26 deletion
+25
-26
lite/tools/build_android.sh
lite/tools/build_android.sh
+10
-10
lite/tools/build_ios.sh
lite/tools/build_ios.sh
+15
-16
未找到文件。
lite/tools/build_android.sh
浏览文件 @
bbbc9940
...
...
@@ -4,7 +4,7 @@ set +x
# 1. global variables, you can change them according to your requirements
#####################################################################################################
# armv7 or armv8, default armv8.
AR
M_ABI
=
armv8
AR
CH
=
armv8
# c++_static or c++_shared, default c++_static.
ANDROID_STL
=
c++_static
# gcc or clang, default gcc.
...
...
@@ -121,7 +121,7 @@ function prepare_thirdparty {
# 4.1 function of tiny_publish compiling
# here we only compile light_api lib
function
make_tiny_publish_so
{
build_dir
=
$workspace
/build.lite.android.
$AR
M_ABI
.
$TOOLCHAIN
build_dir
=
$workspace
/build.lite.android.
$AR
CH
.
$TOOLCHAIN
if
[
"
${
WITH_OPENCL
}
"
==
"ON"
]
;
then
build_dir
=
${
build_dir
}
.opencl
fi
...
...
@@ -152,7 +152,7 @@ function make_tiny_publish_so {
-DLITE_WITH_NPU=
$WITH_HUAWEI_KIRIN_NPU
\
-DNPU_DDK_ROOT=
$HUAWEI_KIRIN_NPU_SDK_ROOT
\
-DLITE_WITH_OPENCL=
$WITH_OPENCL
\
-DARM_TARGET_ARCH_ABI=
$AR
M_ABI
\
-DARM_TARGET_ARCH_ABI=
$AR
CH
\
-DARM_TARGET_LANG=
$TOOLCHAIN
\
-DANDROID_STL_TYPE=
$ANDROID_STL
"
...
...
@@ -176,7 +176,7 @@ function make_full_publish_so {
prepare_thirdparty
build_directory
=
$workspace
/build.lite.android.
$AR
M_ABI
.
$ARM_LANG
build_directory
=
$workspace
/build.lite.android.
$AR
CH
.
$ARM_LANG
if
[
-d
$build_directory
]
then
...
...
@@ -201,7 +201,7 @@ function make_full_publish_so {
-DLITE_WITH_NPU=
$WITH_HUAWEI_KIRIN_NPU
\
-DNPU_DDK_ROOT=
$HUAWEI_KIRIN_NPU_SDK_ROOT
\
-DLITE_WITH_OPENCL=
$WITH_OPENCL
\
-DARM_TARGET_ARCH_ABI=
$AR
M_ABI
\
-DARM_TARGET_ARCH_ABI=
$AR
CH
\
-DARM_TARGET_LANG=
$ARM_LANG
\
-DLITE_WITH_TRAIN=
$WITH_TRAIN
\
-DANDROID_STL_TYPE=
$ANDROID_STL
"
...
...
@@ -231,12 +231,12 @@ function print_usage {
echo
-e
"| ./lite/tools/build_android.sh help |"
echo
-e
"| |"
echo
-e
"| optional argument: |"
echo
-e
"| --ar
m_abi: (armv8|armv7), default is armv8
|"
echo
-e
"| --ar
ch: (armv8|armv7), default is armv8
|"
echo
-e
"| --toolchain: (gcc|clang), defalut is gcc |"
echo
-e
"| --android_stl: (c++_static|c++_shared|gnu_static|gnu_shared), default is c++_static |"
echo
-e
"| --with_java: (OFF|ON); controls whether to publish java api lib, default is ON |"
echo
-e
"| --with_cv: (OFF|ON); controls whether to compile cv functions into lib, default is OFF |"
echo
-e
"| --with_log: (OFF|ON); controls whether to print log information, default is ON |"
echo
-e
"| --with_log: (OFF|ON); controls whether to print log information, default is ON
|"
echo
-e
"| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP) |"
echo
-e
"| |"
echo
-e
"| arguments of striping lib according to input model:(armv8, gcc, c++_static) |"
...
...
@@ -268,15 +268,15 @@ function print_usage {
function
main
{
if
[
-z
"
$1
"
]
;
then
# compiling result contains light_api lib only, recommanded.
make_tiny_publish_so
$AR
M_ABI
$TOOLCHAIN
$ANDROID_STL
make_tiny_publish_so
$AR
CH
$TOOLCHAIN
$ANDROID_STL
fi
# Parse command line.
for
i
in
"
$@
"
;
do
case
$i
in
# armv7 or armv8, default armv8
--ar
m_abi
=
*
)
AR
M_ABI
=
"
${
i
#*=
}
"
--ar
ch
=
*
)
AR
CH
=
"
${
i
#*=
}
"
shift
;;
# gcc or clang, default gcc
...
...
lite/tools/build_ios.sh
浏览文件 @
bbbc9940
...
...
@@ -5,7 +5,7 @@ set +x
# 1. global variables, you can change them according to your requirements
#####################################################################################################
# armv7 or armv8, default armv8.
AR
M_ABI
=
armv8
AR
CH
=
armv8
# ON or OFF, default OFF.
WITH_EXTRA
=
OFF
# controls whether to compile cv functions into lib, default is OFF.
...
...
@@ -36,24 +36,24 @@ fi
# 3. compiling functions
####################################################################################################
function
make_ios
{
local
a
bi
=
$1
local a
rch
=
$1
if
[
${
a
bi
}
==
"armv8"
]
;
then
if
[
${
a
rch
}
==
"armv8"
]
;
then
local
os
=
ios64
elif
[
${
a
bi
}
==
"armv7"
]
;
then
elif
[
${
a
rch
}
==
"armv7"
]
;
then
local
os
=
ios
else
echo
-e
"Error: unsupported ar
m_abi:
${
abi
}
\t
--arm_abi
: armv8|armv7"
echo
-e
"Error: unsupported ar
ch:
${
arch
}
\t
--arch
: armv8|armv7"
exit
1
fi
build_dir
=
$workspace
/build.ios.
${
os
}
.
${
a
bi
}
build_dir
=
$workspace
/build.ios.
${
os
}
.
${
a
rch
}
if
[
-d
$build_dir
]
then
rm
-rf
$build_dir
fi
echo
"building ios target into
$build_dir
"
echo
"target a
bi:
$abi
"
echo
"target a
rch:
$arch
"
mkdir
-p
${
build_dir
}
cd
${
build_dir
}
GEN_CODE_PATH_PREFIX
=
lite/gen_code
...
...
@@ -70,7 +70,7 @@ function make_ios {
-DLITE_WITH_LOG
=
$WITH_LOG
\
-DLITE_BUILD_TAILOR
=
$WITH_STRIP
\
-DLITE_OPTMODEL_DIR
=
$OPTMODEL_DIR
\
-DARM_TARGET_ARCH_ABI
=
$a
bi
\
-DARM_TARGET_ARCH_ABI
=
$a
rch
\
-DLITE_BUILD_EXTRA
=
$WITH_EXTRA
\
-DLITE_WITH_CV
=
$WITH_CV
\
-DARM_TARGET_OS
=
$os
...
...
@@ -87,14 +87,14 @@ function print_usage {
echo
-e
"| compile iOS armv8 library: |"
echo
-e
"| ./lite/tools/build_ios.sh |"
echo
-e
"| compile iOS armv7 library: |"
echo
-e
"| ./lite/tools/build_ios.sh --ar
m_abi=armv7
|"
echo
-e
"| ./lite/tools/build_ios.sh --ar
ch=armv7
|"
echo
-e
"| print help information: |"
echo
-e
"| ./lite/tools/build_ios.sh help |"
echo
-e
"| |"
echo
-e
"| optional argument: |"
echo
-e
"| --ar
m_abi: (armv8|armv7), default is armv8
|"
echo
-e
"| --ar
ch: (armv8|armv7), default is armv8
|"
echo
-e
"| --with_cv: (OFF|ON); controls whether to compile cv functions into lib, default is OFF |"
echo
-e
"| --with_log: (OFF|ON); controls whether to print log information, default is ON |"
echo
-e
"| --with_log: (OFF|ON); controls whether to print log information, default is ON
|"
echo
-e
"| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP) |"
echo
-e
"| |"
echo
-e
"| arguments of striping lib according to input model:(armv8, gcc, c++_static) |"
...
...
@@ -108,16 +108,15 @@ function print_usage {
function
main
{
if
[
-z
"
$1
"
]
;
then
make_ios
$AR
M_ABI
make_ios
$AR
CH
exit
-1
fi
# Parse command line.
for
i
in
"
$@
"
;
do
case
$i
in
--arm_abi
=
*
)
ARM_ABI
=
"
${
i
#*=
}
"
make_ios
$ARM_ABI
--arch
=
*
)
ARCH
=
"
${
i
#*=
}
"
shift
;;
--with_extra
=
*
)
...
...
@@ -151,7 +150,7 @@ function main {
;;
esac
done
make_ios
$AR
M_ABI
make_ios
$AR
CH
}
main
$@
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录