diff --git a/lite/tools/build.sh b/lite/tools/build.sh index e2a557cc5ac..149bd1c30cd 100755 --- a/lite/tools/build.sh +++ b/lite/tools/build.sh @@ -132,9 +132,9 @@ function build_opt { rm -rf build.opt mkdir -p build.opt cd build.opt - opt_arch=$(echo `uname -p`) + opt_arch=$(echo `uname -m`) with_x86=OFF - if [ $opt_arch == "aarch64" ]; then + if [ $opt_arch == "aarch64" ] || [ $opt_arch == "armv6l" ] || [ $opt_arch == "armv7" ] || [ $opt_arch == "armv7l" ]; then with_x86=OFF else with_x86=ON diff --git a/lite/tools/build_linux.sh b/lite/tools/build_linux.sh index 0a97db2c416..0376e04301d 100755 --- a/lite/tools/build_linux.sh +++ b/lite/tools/build_linux.sh @@ -378,8 +378,16 @@ function build_opt { rm -rf $build_dir mkdir -p $build_dir cd $build_dir + opt_arch=$(echo `uname -m`) + with_x86=OFF + if [ $opt_arch == "aarch64" ] || [ $opt_arch == "armv6l" ] || [ $opt_arch == "armv7" ] || [ $opt_arch == "armv7l" ]; then + with_x86=OFF + else + with_x86=ON + fi cmake $workspace \ -DLITE_ON_MODEL_OPTIMIZE_TOOL=ON \ + -DLITE_WITH_X86=${with_x86} \ -DWITH_TESTING=OFF \ -DLITE_BUILD_EXTRA=ON \ -DWITH_MKL=OFF