未验证 提交 6b8bf873 编写于 作者: Z zhupengyang 提交者: GitHub

add py_version for python compiling (#3657)

上级 9827cb87
...@@ -12,6 +12,7 @@ TOOLCHAIN=gcc ...@@ -12,6 +12,7 @@ TOOLCHAIN=gcc
WITH_EXTRA=OFF WITH_EXTRA=OFF
# controls whether to compile python lib, default is OFF. # controls whether to compile python lib, default is OFF.
WITH_PYTHON=OFF WITH_PYTHON=OFF
PY_VERSION=""
# controls whether to compile cv functions into lib, default is OFF. # controls whether to compile cv functions into lib, default is OFF.
WITH_CV=OFF WITH_CV=OFF
# controls whether to print log information, default is ON. # controls whether to print log information, default is ON.
...@@ -52,11 +53,11 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_LITE=ON \ ...@@ -52,11 +53,11 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_LITE=ON \
-DWITH_TESTING=OFF" -DWITH_TESTING=OFF"
# mutable options for linux compiling. # mutable options for linux compiling.
function init_cmake_mutable_options { function init_cmake_mutable_options {
cmake_mutable_options="-DARM_TARGET_ARCH_ABI=$ARCH \ cmake_mutable_options="-DARM_TARGET_ARCH_ABI=$ARCH \
-DARM_TARGET_LANG=$TOOLCHAIN \ -DARM_TARGET_LANG=$TOOLCHAIN \
-DLITE_BUILD_EXTRA=$WITH_EXTRA \ -DLITE_BUILD_EXTRA=$WITH_EXTRA \
-DLITE_WITH_PYTHON=$WITH_PYTHON \ -DLITE_WITH_PYTHON=$WITH_PYTHON \
-DPY_VERSION=$PY_VERSION \
-DLITE_WITH_CV=$WITH_CV \ -DLITE_WITH_CV=$WITH_CV \
-DLITE_WITH_LOG=$WITH_LOG \ -DLITE_WITH_LOG=$WITH_LOG \
-DLITE_BUILD_TAILOR=$WITH_STRIP \ -DLITE_BUILD_TAILOR=$WITH_STRIP \
...@@ -206,6 +207,7 @@ function print_usage { ...@@ -206,6 +207,7 @@ function print_usage {
echo -e "| --toolchain: (gcc|clang), defalut is gcc |" echo -e "| --toolchain: (gcc|clang), defalut is gcc |"
echo -e "| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP), default is OFF |" echo -e "| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP), default is OFF |"
echo -e "| --with_python: (OFF|ON); controls whether to build python lib or whl, default is OFF |" echo -e "| --with_python: (OFF|ON); controls whether to build python lib or whl, default is OFF |"
echo -e "| --python_version: (2.7|3.5|3.7); controls python version to compile whl, default is None |"
echo -e "| --with_cv: (OFF|ON); controls whether to compile cv functions into lib, default is OFF |" 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 "| |" echo -e "| |"
...@@ -262,6 +264,11 @@ function main { ...@@ -262,6 +264,11 @@ function main {
WITH_PYTHON="${i#*=}" WITH_PYTHON="${i#*=}"
shift shift
;; ;;
# 2.7 or 3.5 or 3.7, default is None
--python_version=*)
PY_VERSION="${i#*=}"
shift
;;
# ON or OFF, default OFF # ON or OFF, default OFF
--with_cv=*) --with_cv=*)
WITH_CV="${i#*=}" WITH_CV="${i#*=}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册