提交 77c328ec 编写于 作者: Q Qiao Longfei 提交者: Jeff Wang

Add manylinux build doc (#306)

* add manylinux build

* update build.sh

* typo
上级 e2b7bfde
#!/bin/bash
PYTHON_FLAGS=""
if [ "$1" != "" ]; then
echo "using python abi: $1"
if [ "$1" == "cp27-cp27m" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-2.7.11-ucs2/lib:${LD_LIBRARY_PATH#/opt/_internal/cpython-2.7.11-ucs4/lib:}
export PATH=/opt/python/cp27-cp27m/bin/:${PATH}
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/python/cp27-cp27m/bin/python
-DPYTHON_INCLUDE_DIR:PATH=/opt/python/cp27-cp27m/include/python2.7
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-2.7.11-ucs2/lib/libpython2.7.so"
elif [ "$1" == "cp27-cp27mu" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-2.7.11-ucs4/lib:${LD_LIBRARY_PATH#/opt/_internal/cpython-2.7.11-ucs2/lib:}
export PATH=/opt/python/cp27-cp27mu/bin/:${PATH}
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/python/cp27-cp27mu/bin/python
-DPYTHON_INCLUDE_DIR:PATH=/opt/python/cp27-cp27mu/include/python2.7
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-2.7.11-ucs4/lib/libpython2.7.so"
fi
fi
echo $LD_LIBRARY_PATH
echo $PATH
echo $PYTHON_FLAGS
python setup.py bdist_wheel
VisualDL uses the same manylinux environment docker image with PaddlePaddle, the related wiki is <https://github.com/PaddlePaddle/Paddle/tree/develop/tools/manylinux1>.
We can use this [build file](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/manylinux1/build_scripts/build.sh) to build this manylinux environment. But most of the time, we can directly use `paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5`.
You can use this [check script](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/manylinux1/build_scripts/manylinux1-check.py) to check the build envrionment.
The whole build step can be:
1. Get the manyliux build docker image `paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5` and enter.
```shell
docker run -it paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 /bin/bash
```
1. Get the VisualDL code and run build.sh. It will generate a whl file like `visualdl-0.0.2a0-cp27-cp27m(u)-linux_x86_64.whl`
1. The `linux` above should be renamed to `manylinux1`
```shell
mv visualdl-0.0.2a0-cp27-cp27m-linux_x86_64.whl visualdl-0.0.2a0-cp27-cp27m-
manylinux1_x86_64.whl
```
1. Before upload to the final pypi website, you can first upload it to a test repo `https://testpypi.python.org/pypi` and test the installation process.
```shell
pip install twine
twine upload --repository-url https://test.pypi.org/legacy/ visualdl-*xx.whl
pip install --index-url https://test.pypi.org/simple/ your-package
```
1. Use twine to upload the package to pypi.
```shell
pip install twine
twine upload xx.whl
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册