Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.12 KB

how_to_build_windows.md

File metadata and controls

42 lines (32 loc) · 1.12 KB

Windows 编译

环境依赖

  • cmake >= 3.10
  • VS 2019
  • ninja
  • cmake >= 3.10

以上依赖安装好后,在Windows菜单打开x64 Native Tools Command Prompt for VS 2019命令工具即可进行下面的编译环节。

编译C++库方法

git clone https://github.com/PaddlePaddle/PaddleNLP.git
cd PaddleNLP/fast_tokenizer
mkdir build & cd build
cmake .. -G "Ninja" -DWITH_PYTHON=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
ninja -j8

编译后的C++库在当前目录下的cpp目录下。

编译Python库方法

git clone https://github.com/PaddlePaddle/PaddleNLP.git
cd PaddleNLP/fast_tokenizer
mkdir build & cd build
# 需要指定Python库
cmake .. -G "Ninja" -DWITH_PYTHON=ON ^
                    -DWITH_TESTING=OFF ^
                    -DCMAKE_BUILD_TYPE=Release ^
                    -DPYTHON_EXECUTABLE=C:\Python37\python.exe ^
                    -DPYTHON_INCLUDE_DIR=C:\Python37\include ^
                    -DPYTHON_LIBRARY=C:\Python37\libs\python3%%x.lib
ninja -j8

编译后的wheel包即在当前目录下的dist目录中

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