Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 851 Bytes

how_to_build_linux_and_mac.md

File metadata and controls

36 lines (26 loc) · 851 Bytes

Linux & Mac编译

环境依赖

  • cmake >= 3.10
  • gcc >= 8.2.0

编译C++库方法

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

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

编译Python库方法

git clone https://github.com/PaddlePaddle/PaddleNLP.git
cd PaddleNLP/fast_tokenizer
mkdir build & cd build
# 设置Python环境
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.6.0/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/_internal/cpython-3.6.0/bin/:${PATH}

cmake .. -DWITH_PYTHON=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
make -j8

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

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