测试环境:
jetpack4.6.3
cuda10.2+cudnn8.2+trt8.2
python3.6.9
编译过程按照官方教程进行:
git clone https://github.com/PaddlePaddle/FastDeploy.git cd FastDeploy/python export BUILD_ON_JETSON=ON export ENABLE_VISION=ON
# ENABLE_PADDLE_BACKEND & PADDLEINFERENCE_DIRECTORY为可选项 export ENABLE_PADDLE_BACKEND=ON export PADDLEINFERENCE_DIRECTORY=/Download/paddle_inference_install_dir
python3 setup.py build
报错如下:
~/FastDeploy/python$ python setup.py build
fatal: not a git repository (or any of the parent directories): .git
running build
running build_py
running create_version
running cmake_build
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Downloading file from https://bj.bcebos.com/fastdeploy/third_libs/patchelf-0.15.0-aarch64.tar.gz to /home/MM/FastDeploy/python/.setuptools-cmake-build/patchelf-0.15.0-aarch64.tar.gz ...
-- [download 5% complete]
-- [download 10% complete]
-- [download 15% complete]
-- [download 20% complete]
-- [download 26% complete]
-- [download 31% complete]
-- [download 36% complete]
-- [download 41% complete]
-- [download 46% complete]
-- [download 51% complete]
-- [download 56% complete]
-- [download 61% complete]
-- [download 67% complete]
-- [download 72% complete]
-- [download 77% complete]
-- [download 82% complete]
-- [download 83% complete]
-- [download 88% complete]
-- [download 93% complete]
-- [download 98% complete]
-- [download 100% complete]
Decompress file /home/MM/FastDeploy/python/.setuptools-cmake-build/patchelf-0.15.0-aarch64.tar.gz ...
-- Use the default onnxruntime lib. The ONNXRuntime path: /home/MM/FastDeploy/python/.setuptools-cmake-build/third_libs/install/onnxruntime
Cannot compile with onnxruntime-gpu while in linux-aarch64 platform, fallback to onnxruntime-cpu
CMake Error at cmake/paddle_inference.cmake:72 (find_package):
By not providing "FindPython.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Python", but
CMake did not find one.
Could not find a package configuration file provided by "Python" with any
of the following names:
PythonConfig.cmake
python-config.cmake
Add the installation prefix of "Python" to CMAKE_PREFIX_PATH or set
"Python_DIR" to a directory containing one of the above files. If "Python"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:225 (include)
-- Configuring incomplete, errors occurred!
See also "/home/MM/FastDeploy/python/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "setup.py", line 437, in <module>
license='Apache 2.0')
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 280, in run
self.run_command('cmake_build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 266, in run
subprocess.check_call(cmake_args)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/usr/include/python3.6m', '-DPYTHON_EXECUTABLE=/usr/bin/python', '-DBUILD_FASTDEPLOY_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=paddle2onnx', '-DPY_EXT_SUFFIX=.cpython-36m-aarch64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DENABLE_RKNPU2_BACKEND=OFF', '-DENABLE_SOPHGO_BACKEND=OFF', '-DWITH_ASCEND=OFF', '-DENABLE_ORT_BACKEND=OFF', '-DENABLE_OPENVINO_BACKEND=OFF', '-DENABLE_PADDLE_BACKEND=ON', '-DENABLE_POROS_BACKEND=OFF', '-DENABLE_TRT_BACKEND=OFF', '-DENABLE_LITE_BACKEND=OFF', '-DPADDLELITE_URL=OFF', '-DENABLE_VISION=ON', '-DENABLE_ENCRYPTION=OFF', '-DENABLE_FLYCV=OFF', '-DENABLE_CVCUDA=OFF', '-DENABLE_TEXT=OFF', '-DENABLE_BENCHMARK=OFF', '-DWITH_GPU=OFF', '-DWITH_IPU=OFF', '-DWITH_KUNLUNXIN=OFF', '-DBUILD_ON_JETSON=ON', '-DTRT_DIRECTORY=UNDEFINED', '-DCUDA_DIRECTORY=/usr/local/cuda', '-DLIBRARY_NAME=fastdeploy', '-DPY_LIBRARY_NAME=fastdeploy_main', '-DOPENCV_DIRECTORY=', '-DORT_DIRECTORY=', '-DPADDLEINFERENCE_DIRECTORY=/home/MM/FastDeploy/paddle_inference_jetson', '-DRKNN2_TARGET_SOC=', '/home/MM/FastDeploy']' returned non-zero exit status 1.
解决方法:升级cmake,cmake3.10.2会报错,升级方法
sudo apt purge cmake
添加签名密钥
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - 将存储库添加到您的源列表并进行更新
稳定版
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' sudo apt-get update
候选发布版本(可选) sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic-rc main' sudo apt-get update
安装新版本:
sudo apt install -y cmake