PaddlePaddle / FastDeploy

⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support.
https://www.paddlepaddle.org.cn/fastdeploy
Apache License 2.0
3k stars 465 forks source link

MacOSX 13.2.1 上,编译cpu模式失败 #1506

Closed edwardzhou closed 1 year ago

edwardzhou commented 1 year ago

温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度


环境


- 【系统平台】:  Mac OSX intel(13.2.1)
- 【编译语言】: C++ 

## 问题日志及出现问题的操作流程

上面cmake的输出

```bash
cmake .. -DENABLE_ORT_BACKEND=ON \
         -DENABLE_PADDLE_BACKEND=ON \
         -DENABLE_OPENVINO_BACKEND=ON \
         -DCMAKE_INSTALL_PREFIX=${PWD}/compiled_fastdeploy_sdk \
         -DENABLE_VISION=ON \
         -DENABLE_TEXT=ON
-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Use the default onnxruntime lib. The ONNXRuntime path: /Users/edwardzhou/ff_work/FastDeploy/build/third_libs/install/onnxruntime
CMake Warning (dev) at /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  cmake/onnxruntime.cmake:104 (ExternalProject_Add)
  CMakeLists.txt:208 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  cmake/paddle_inference.cmake:114 (ExternalProject_Add)
  CMakeLists.txt:226 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

Downloading file from https://bj.bcebos.com/fastdeploy/third_libs/m_openvino_toolkit_osx_2022.2.0.dev20220829.tgz to /Users/edwardzhou/ff_work/FastDeploy/build/m_openvino_toolkit_osx_2022.2.0.dev20220829.tgz ...
-- [download 0% complete]
-- [download 1% complete]
....
-- [download 99% complete]
-- [download 100% complete]
Decompress file /Users/edwardzhou/ff_work/FastDeploy/build/m_openvino_toolkit_osx_2022.2.0.dev20220829.tgz ...
OPENVINO_LIBS = /Users/edwardzhou/ff_work/FastDeploy/build/third_libs/install/openvino/runtime/lib/libopenvino.dylib;TBB::tbb;TBB::tbbmalloc;TBB::tbbmalloc_proxy
-- Use the default OpenCV lib from: https://bj.bcebos.com/paddle2onnx/libs/opencv-osx-x86_64-3.4.16.tgz
Downloading file from https://bj.bcebos.com/paddle2onnx/libs/opencv-osx-x86_64-3.4.16.tgz to /Users/edwardzhou/ff_work/FastDeploy/build/opencv-osx-x86_64-3.4.16.tgz ...
-- [download 0% complete]
-- [download 1% complete]
...
-- [download 99% complete]
-- [download 100% complete]
Decompress file /Users/edwardzhou/ff_work/FastDeploy/build/opencv-osx-x86_64-3.4.16.tgz ...
-- Found OpenCV: /Users/edwardzhou/ff_work/FastDeploy/build/third_libs/install/opencv (found version "3.4.16")
FASTTOKENIZER_COMPILE_LIB = /Users/edwardzhou/ff_work/FastDeploy/build/third_libs/install/fast_tokenizer/lib/libcore_tokenizers.dylib
CMake Warning (dev) at /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  cmake/fast_tokenizer.cmake:117 (ExternalProject_Add)
  CMakeLists.txt:410 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.25.2/share/cmake/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  cmake/paddle2onnx.cmake:67 (ExternalProject_Add)
  CMakeLists.txt:423 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

--
-- *************FastDeploy Building Summary**********
--   CMake version             : 3.25.2
--   CMake command             : /usr/local/Cellar/cmake/3.25.2/bin/cmake
--   System                    : Darwin
--   C++ compiler              : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
--   C++ compiler version      : 14.0.0.14000029
--   CXX flags                 : -Wno-format -g0 -O3
--   EXE linker flags          :
--   Shared linker flags       :
--   Build type                :
--   Compile definitions       : _GLIBCXX_USE_CXX11_ABI=1;FASTDEPLOY_LIB;CMAKE_BUILD_TYPE=Release;ENABLE_ORT_BACKEND;ENABLE_PADDLE_BACKEND;ENABLE_OPENVINO_BACKEND;ENABLE_VISION;ENABLE_TEXT;ENABLE_PADDLE2ONNX
--   CMAKE_PREFIX_PATH         :
--   CMAKE_INSTALL_PREFIX      : /Users/edwardzhou/ff_work/FastDeploy/build/compiled_fastdeploy_sdk
--   CMAKE_MODULE_PATH         :
--
--   FastDeploy version        : 0.0.0
--   ENABLE_ORT_BACKEND        : ON
--   ENABLE_RKNPU2_BACKEND     : OFF
--   ENABLE_SOPHGO_BACKEND     : OFF
--   ENABLE_PADDLE_BACKEND     : ON
--   ENABLE_LITE_BACKEND       : OFF
--   ENABLE_POROS_BACKEND      : OFF
--   ENABLE_TRT_BACKEND        : OFF
--   ENABLE_OPENVINO_BACKEND   : ON
--   ENABLE_BENCHMARK          : OFF
--   ENABLE_VISION             : ON
--   ENABLE_TEXT               : ON
--   ENABLE_ENCRYPTION         : OFF
--   ENABLE_FLYCV              : OFF
--   ENABLE_CVCUDA             : OFF
--   WITH_GPU                  : OFF
--   WITH_IPU                  : OFF
--   WITH_TESTING              : OFF
--   WITH_ASCEND               : OFF
--   WITH_DIRECTML             : OFF
--   WITH_TIMVX                : OFF
--   WITH_KUNLUNXIN            : OFF
--   WITH_CAPI                 : OFF
--   WITH_CSHARPAPI            : OFF
--   ONNXRuntime version       : 1.12.0
--   Paddle Inference version  : 2.4-dev5
--   OpenVINO version          : 2022.2.0.dev20220829
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/edwardzhou/ff_work/FastDeploy/build

编译时出错


make -j12
[  1%] Creating directories for 'extern_fast_tokenizer'
[  2%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/contrib/graphbuilderadapter.cpp.o
[  2%] Creating directories for 'extern_onnxruntime'
[  2%] Creating directories for 'extern_paddle2onnx'
[  3%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/emit.cpp.o
[  3%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/contrib/graphbuilder.cpp.o
[  3%] Creating directories for 'extern_paddle_inference'
[  4%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/depthguard.cpp.o
[  4%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/binary.cpp.o
[  4%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/convert.cpp.o
[  4%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/directives.cpp.o
[  4%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/emitfromevents.cpp.o
[  4%] Performing download step (download, verify and extract) for 'extern_paddle2onnx'
[  4%] Performing download step (download, verify and extract) for 'extern_onnxruntime'
[  4%] Performing download step (download, verify and extract) for 'extern_fast_tokenizer'
[  4%] Performing download step (download, verify and extract) for 'extern_paddle_inference'
-- Downloading...
   dst='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/onnxruntime/src/onnxruntime-osx-x86_64-1.12.0.tgz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://bj.bcebos.com/paddle2onnx/libs/onnxruntime-osx-x86_64-1.12.0.tgz'
-- Downloading...
   dst='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/paddle2onnx/src/paddle2onnx-osx-x86_64-1.0.5.tgz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://bj.bcebos.com/fastdeploy/third_libs/paddle2onnx-osx-x86_64-1.0.5.tgz'
-- Downloading...
   dst='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/fast_tokenizer/src/fast_tokenizer-osx-x86_64-1.0.2.tgz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://bj.bcebos.com/paddlenlp/fast_tokenizer/fast_tokenizer-osx-x86_64-1.0.2.tgz'
-- Downloading...
   dst='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/paddle_inference/src/paddle_inference-osx-x86_64-2.4-dev5.tgz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://bj.bcebos.com/fastdeploy/third_libs/paddle_inference-osx-x86_64-2.4-dev5.tgz'
CMake Error at extern_paddle_inference-stamp/download-extern_paddle_inference.cmake:170 (message):
  Each download failed!

    error: downloading 'https://bj.bcebos.com/fastdeploy/third_libs/paddle_inference-osx-x86_64-2.4-dev5.tgz' failed
          status_code: 22
          status_string: "HTTP response code said error"
          log:
          --- LOG BEGIN ---
            Trying [2409:8c04:1001:1002:0:ff:b001:368a]:443...

  Connected to bj.bcebos.com (2409:8c04:1001:1002:0:ff:b001:368a) port 443
  (#0)

  ALPN: offers h2

  ALPN: offers http/1.1

  (304) (OUT), TLS handshake, Client hello (1):

  [318 bytes data]

  (304) (IN), TLS handshake, Server hello (2):

  [88 bytes data]

  (304) (OUT), TLS handshake, Client hello (1):

  [351 bytes data]

  (304) (IN), TLS handshake, Server hello (2):

  [155 bytes data]

  (304) (IN), TLS handshake, Unknown (8):

  [25 bytes data]

  (304) (IN), TLS handshake, Certificate (11):

  [2974 bytes data]

  (304) (IN), TLS handshake, CERT verify (15):

  [264 bytes data]

  (304) (IN), TLS handshake, Finished (20):

  [52 bytes data]

  (304) (OUT), TLS handshake, Finished (20):

  [52 bytes data]

  SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384

  ALPN: server accepted http/1.1

  Server certificate:

   subject: C=CN; ST=Beijing; O=BeiJing Baidu Netcom Science Technology Co., Ltd; CN=*.bcebos.com
   start date: Sep 23 00:00:00 2022 GMT
   expire date: Oct 18 23:59:59 2023 GMT
   subjectAltName: host "bj.bcebos.com" matched cert's "*.bcebos.com"
   issuer: C=US; O=DigiCert Inc; CN=DigiCert Secure Site Pro CN CA G3
   SSL certificate verify ok.

  GET /fastdeploy/third_libs/paddle_inference-osx-x86_64-2.4-dev5.tgz
  HTTP/1.1

  Host: bj.bcebos.com

  User-Agent: curl/7.84.0

  Accept: */*

  Mark bundle as not supporting multiuse

  HTTP/1.1 404 Not Found

  Date: Sat, 04 Mar 2023 02:21:43 GMT

  Content-Type: application/json; charset=utf-8

  Content-Length: 117

  Connection: keep-alive

  Server: BceBos

  x-bce-debug-id:
  fTjKmwgrjBSGRStmxV4DwboxqiqCStEW4QxvuXvw61IOf481DJMNWKsxDfTtrS12MjvsH866VdK34wUh7RzZDg==

  x-bce-request-id: 9d9c23b0-b4b5-4012-8d5d-51034f6b4930

  The requested URL returned error: 404

  Closing connection 0

          --- LOG END ---

make[2]: *** [third_libs/paddle_inference/src/extern_paddle_inference-stamp/extern_paddle_inference-download] Error 1
make[1]: *** [CMakeFiles/extern_paddle_inference.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  4%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/emitter.cpp.o
[  5%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/emitterstate.cpp.o
[  5%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o
[  6%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/exceptions.cpp.o
[  6%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/exp.cpp.o
[  6%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/memory.cpp.o
[  7%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/node.cpp.o
[  7%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/node_data.cpp.o
[  7%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/nodebuilder.cpp.o
[  8%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/nodeevents.cpp.o
[  8%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/null.cpp.o
[  9%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/ostream_wrapper.cpp.o
[  9%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/parse.cpp.o
[  9%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/parser.cpp.o
[ 10%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/regex_yaml.cpp.o
[ 10%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/scanner.cpp.o
[ 11%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/scanscalar.cpp.o
[ 11%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/scantag.cpp.o
[ 11%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/scantoken.cpp.o
[ 12%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/simplekey.cpp.o
[ 12%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/singledocparser.cpp.o
[ 12%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/stream.cpp.o
[ 13%] Building CXX object third_party/yaml-cpp/CMakeFiles/yaml-cpp.dir/src/tag.cpp.o
[ 13%] Linking CXX static library libyaml-cpp.a
[ 13%] Built target yaml-cpp
-- Downloading... done
-- extracting...
     src='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/paddle2onnx/src/paddle2onnx-osx-x86_64-1.0.5.tgz'
     dst='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/paddle2onnx/src/extern_paddle2onnx'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 14%] No update step for 'extern_paddle2onnx'
[ 14%] No patch step for 'extern_paddle2onnx'
[ 15%] No configure step for 'extern_paddle2onnx'
[ 15%] No build step for 'extern_paddle2onnx'
[ 16%] Performing install step for 'extern_paddle2onnx'
[ 16%] Completed 'extern_paddle2onnx'
[ 16%] Built target extern_paddle2onnx
-- Downloading... done
-- extracting...
     src='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/onnxruntime/src/onnxruntime-osx-x86_64-1.12.0.tgz'
     dst='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/onnxruntime/src/extern_onnxruntime'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 17%] No update step for 'extern_onnxruntime'
[ 17%] No patch step for 'extern_onnxruntime'
[ 18%] No configure step for 'extern_onnxruntime'
[ 18%] No build step for 'extern_onnxruntime'
[ 19%] Performing install step for 'extern_onnxruntime'
[ 19%] Completed 'extern_onnxruntime'
[ 19%] Built target extern_onnxruntime
-- Downloading... done
-- extracting...
     src='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/fast_tokenizer/src/fast_tokenizer-osx-x86_64-1.0.2.tgz'
     dst='/Users/edwardzhou/ff_work/FastDeploy/build/third_libs/fast_tokenizer/src/extern_fast_tokenizer'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 20%] No update step for 'extern_fast_tokenizer'
[ 20%] No patch step for 'extern_fast_tokenizer'
[ 21%] No configure step for 'extern_fast_tokenizer'
[ 21%] No build step for 'extern_fast_tokenizer'
[ 21%] Performing install step for 'extern_fast_tokenizer'
[ 21%] Completed 'extern_fast_tokenizer'
[ 21%] Built target extern_fast_tokenizer
make: *** [all] Error 2
leiqing1 commented 1 year ago

@edwardzhou 你好 看错误logo信息,是网络问题导致paddle inference后端下载失败。 可以清除没完成的编译后, 配置好网络重新编译; 或者,将DENABLE_PADDLE_BACKEND设置成off (-DENABLE_PADDLE_BACKEND=OFF \)来编译。使用onnx runtime先推理确定正确。

edwardzhou commented 1 year ago

禁用 paddle backend 后正常