Files
FastDeploy/docs/compile/how_to_build_windows.md
2022-08-17 16:13:28 +08:00

1.2 KiB
Raw Blame History

Windows编译

环境依赖

  • cmake >= 3.12
  • g++ >= 8.2
  • cuda >= 11.2 (当WITH_GPU=ON)
  • cudnn >= 11.2 (当WITH_GPU=ON)
  • TensorRT >= 8.4 (当ENABLE_TRT_BACKEND=ON)

获取代码

git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy
git checkout develop

编译C++ SDK

Windows菜单打开x64 Native Tools Command Prompt for VS 2019命令工具,其中CMAKE_INSTALL_PREFIX用于指定编译后生成的SDK路径

mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=D:\Paddle\FastDeploy\build\fastdeploy-win-x64-0.2.0 -DENABLE_ORT_BACKEND=ON -DENABLE_VISION=ON .. 
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64

编译后C++ SDK即在D:\Paddle\FastDeploy\build\fastdeploy-win-x64-0.2.0目录下

编译Python Wheel包

Python编译时通过环境变量获取编译选项

git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy
git checkout develop

set ENABLE_ORT_BACKEND=ON
set ENABLE_VISION=ON

python setup.py build
python setup.py bdist_wheel

更多编译选项说明参考编译指南