From 6b8bf873f494ead17e038621e06f0450413f5dfd Mon Sep 17 00:00:00 2001 From: zhupengyang Date: Mon, 18 May 2020 21:55:19 +0800 Subject: [PATCH] add py_version for python compiling (#3657) --- lite/tools/build_linux.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lite/tools/build_linux.sh b/lite/tools/build_linux.sh index d17760b9e4..7218faff69 100755 --- a/lite/tools/build_linux.sh +++ b/lite/tools/build_linux.sh @@ -12,6 +12,7 @@ TOOLCHAIN=gcc WITH_EXTRA=OFF # controls whether to compile python lib, default is OFF. WITH_PYTHON=OFF +PY_VERSION="" # controls whether to compile cv functions into lib, default is OFF. WITH_CV=OFF # controls whether to print log information, default is ON. @@ -52,11 +53,11 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_LITE=ON \ -DWITH_TESTING=OFF" # mutable options for linux compiling. function init_cmake_mutable_options { - cmake_mutable_options="-DARM_TARGET_ARCH_ABI=$ARCH \ -DARM_TARGET_LANG=$TOOLCHAIN \ -DLITE_BUILD_EXTRA=$WITH_EXTRA \ -DLITE_WITH_PYTHON=$WITH_PYTHON \ + -DPY_VERSION=$PY_VERSION \ -DLITE_WITH_CV=$WITH_CV \ -DLITE_WITH_LOG=$WITH_LOG \ -DLITE_BUILD_TAILOR=$WITH_STRIP \ @@ -206,6 +207,7 @@ function print_usage { 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_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_log: (OFF|ON); controls whether to print log information, default is ON |" echo -e "| |" @@ -262,6 +264,11 @@ function main { WITH_PYTHON="${i#*=}" shift ;; + # 2.7 or 3.5 or 3.7, default is None + --python_version=*) + PY_VERSION="${i#*=}" + shift + ;; # ON or OFF, default OFF --with_cv=*) WITH_CV="${i#*=}" -- GitLab