-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpaddle-build
More file actions
67 lines (56 loc) · 2.62 KB
/
paddle-build
File metadata and controls
67 lines (56 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[Инструкция по сборке]
https://www.paddlepaddle.org.cn/documentation/docs/en/1.5/beginners_guide/install/compile/compile_Ubuntu_en.html
[Увеличить количество разрешенных файловых дескрипторов]
В директории /etc/security/limits.d создать файл nofile.conf со следующим
содержимым:
#<domain> <type> <item> <value>
#
USER_NAME soft nofile 4096
USER_NAME hard nofile 4096
USER_NAME заменить на имя текущего пользователя.
Перезагрузить компьютер.
[Источник]
git clone [email protected]:TochkaAI/Paddle.git
git checkout -t origin/release/2.1
cd ~/paddle
rm -rf build && mkdir build && cd build
export PADDLE_PREFIX=/opt/paddle/2.1 && echo "PADDLE_PREFIX: $PADDLE_PREFIX"
cmake \
-D CMAKE_INSTALL_PREFIX=${PADDLE_PREFIX} \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_SHARED_LINKER_FLAGS="-Wl,-z,origin \
-Wl,-rpath,\$ORIGIN \
-Wl,-rpath,${PADDLE_PREFIX}/third_party/install/mkldnn/lib \
-Wl,-rpath,${PADDLE_PREFIX}/third_party/install/mklml/lib" \
-D WITH_CONTRIB=OFF \
-D WITH_AVX=ON \
-D WITH_MKL=ON \
-D WITH_MKLDNN=ON \
-D WITH_TESTING=OFF \
-D WITH_INFERENCE_API_TEST=OFF \
-D ON_INFER=ON \
-D WITH_PYTHON=OFF \
-D WITH_GPU=OFF \
-D WITH_NCCL=OFF \
-D WITH_STRIP=ON \
.. \
make -j$(nproc)
# sudo make install - не работает
[Установка]
Создать директорию для установки:
sudo mkdir -p /opt/paddle/2.1
После завершения сборки скопировать C++ вариант в директорию назначения:
sudo cp -a ./paddle_inference_install_dir/{paddle,third_party} /opt/paddle/2.1
[Сборка с поддержкой Python3]
Дополнительно установить:
sudo pip3 install protobuf
sudo apt-get install -y patchelf
Версия Python3 указана для Ubuntu 20.04
-D PY_VERSION=3.8 \
-D PYTHON_EXECUTABLE=/usr/bin/python3 \
-D PYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-D PYTHON_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \
-D PY_PIP=/usr/lib/python3/dist-packages/pip \
-D PY_NUMPY=/usr/lib/python3/dist-packages/numpy \
-D PY_WHEEL=/usr/lib/python3/dist-packages/wheel \
-D PY_GOOGLE.PROTOBUF=/usr/local/lib/python3.8/dist-packages/google/protobuf \