PaddlePaddle / Paddle-Lite

PaddlePaddle High Performance Deep Learning Inference Engine for Mobile and Edge (飞桨高性能深度学习端侧推理引擎)
https://www.paddlepaddle.org.cn/lite
Apache License 2.0
6.93k stars 1.61k forks source link

Raspberry Pi 5 (and 4) build_linux.sh building optimize tool fails #10435

Open Qengineering opened 8 months ago

Qengineering commented 8 months ago

为使您的问题得到快速解决,在建立 Issues 前,请您先通过如下方式搜索是否有相似问题:历史 issue, FAQ 文档, 官方文档

如果您没有查询到相似问题,为快速解决您的提问,建立issue时请提供如下细节信息:

image

To address this issue, add const at the end of line 68 in

thrid-party/protobuf-host/src/google/protobuf/compiler/java/java_file.cc image

2) The build_linux.sh script is hard coded and fixed for an x86 machine. When running the script, you get the following output on the terminal:

-- LITE_WITH_X86: ON -- LITE_WITH_ARM: OFF -- LITE_WITH_SW: OFF -- LITE_WITH_OPENCL: OFF -- LITE_WITH_METAL: OFF -- LITE_WITH_XPU: OFF -- LITE_WITH_NNADAPTER: OFF -- LITE_WITH_PROFILE: OFF -- LITE_WITH_CV: ON

You need to alter the script to get it working for the Raspberry Pi (or any other aarch64 device other than Android). Inside build_linux.sh

# 4.2 function of opt
function build_opt {
    rm -f $workspace/lite/api/paddle_use_ops.h
    rm -f $workspace/lite/api/paddle_use_kernels.h
    prepare_thirdparty

    build_dir=$workspace/build.opt
    rm -rf $build_dir
    mkdir -p $build_dir
    cd $build_dir
    cmake $workspace \
      -DARM_TARGET_OS=armlinux \
      -DLITE_ON_MODEL_OPTIMIZE_TOOL=ON \
      -DWITH_TESTING=OFF \
      -DLITE_WITH_X86=OFF \
      -DLITE_WITH_ARM=ON \
      -DLITE_BUILD_EXTRA=ON \
      -DWITH_MKL=OFF
    make opt -j$NUM_PROC
}

Now you get -- LITE_WITH_X86: OFF -- LITE_WITH_ARM: ON -- LITE_WITH_SW: OFF -- LITE_WITH_OPENCL: OFF -- LITE_WITH_METAL: OFF -- LITE_WITH_XPU: OFF -- LITE_WITH_NNADAPTER: OFF -- LITE_WITH_PROFILE: OFF -- LITE_WITH_CV: ON

zhupengyang commented 7 months ago

感谢,确实有这个问题