You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Paddle/tools/manylinux1
Huihuang Zheng 377f9e6142
Fix a docker image error. (#17930)
6 years ago
..
build_scripts Fix 2 bugs for CI Cuda9/10 tasks (#17861) 6 years ago
Dockerfile.x64 Fix 2 bugs for CI Cuda9/10 tasks (#17861) 6 years ago
README.md add manylinux docker image usage (#10585) 7 years ago
build_all.sh Fix a docker image error. (#17930) 6 years ago

README.md

buildtools

We release PaddlePaddle and PaddlePaddle Fluid as shared libraries, which, we hope could be released as wheel packages on PyPI, so we need to make sure that the build follows the manulinux1 standard.

The manylinux standard suggests building Python modules on an old system, because that a module would anyway depend on some shared libraries, and Linux's shared library standard states that those built with newer version compilers cannot work with those with older versions. The suggested building environment is as old as CentOS 5. However, PaddlePaddle relies on CUDA, and the earlies version of CentOS works with CUDA is 6. So, here we provide a Docker image based on CentOS 6 and CUDA for building PaddlePaddle and making the release supports "as-manylinux as possible." or "sufficiently many Linux" according to this discussion.

The build output of our Docker image includes multiple wheel files -- some contain the CPU-only binary, some others support CUDA; some are compatible with the cp27m Python ABI, some others with cp27.

To build these wheels, please run the following commands:

git clone https://github.com/paddlepaddle/paddle
cd paddle/tools/manylinux1
REPO=[yourrepo] ./build_all.sh

Build PaddlePaddle for the different Python ABIs

Choose one of the following Python ABI and set the correct environment variables.

  • cp27-cp27m

    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"
    
  • cp27-cp27mu

    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"
    

And then add the PYTHON_FLAGS as your cmake flags:

cmake ..
  ${PYTHON_FLAGS} \
  -DWITH_GPU=OFF \
  ...

You can find more details about cmake flags at here