paddle/scripts/musl_build/README.md
Paddle can be built for linux-musl such as alpine, and be used in libos-liked SGX TEE environment. Currently supported commercial product TEE Scone, and community maintanced TEE Occlum. We also working on to support open source TEE Graphene.
git clone https://github.com/PaddlePaddle/Paddle.git
# enter paddle directory
cd ./Paddle
# create and enter building directory
mkdir -p build && cd build
# setup proxy address, when the speed of internet is not good.
# export HTTP_PROXY='http://127.0.0.1:8080'
# export HTTPS_PROXY='https://127.0.0.1:8080'
# invoke build script
../paddle/scripts/musl_build/build_docker.sh
# setup proxy address, when the speed of internet is not good.
# export HTTP_PROXY='http://127.0.0.1:8080'
# export HTTPS_PROXY='https://127.0.0.1:8080'
# invoke build paddle script
# all arguments, such as -j8 optional, is past to make procedure.
../paddle/scripts/musl_build/build_paddle.sh -j8
# find output wheel package
# output wheel packages will save to "./output" directory.
ls ./output/*.whl
# checkout paddle source code
git clone https://github.com/PaddlePaddle/Paddle.git
# enter paddle directory
cd ./Paddle
# build docker image
../paddle/scripts/musl_build/build_docker.sh
# enter the container interactive shell
BUILD_MAN=1 ../paddle/scripts/musl_build/build_paddle.sh
# compile paddle by commands
# paddle is mount to /paddle directory
# working directory is /root
mkdir build && cd build
# install python requirement
pip install -r /paddle/python/requirements.txt
# configure project with cmake
cmake -DWITH_MUSL=ON -DWITH_CRYPTO=OFF -DWITH_MKL=OFF -DWITH_GPU=OFF /paddle
# run the make to build project.
# the argument -j8 is optional to accelerate compiling.
make -j8
build_docker.sh compiling docker building script. it use alpine linux 3.10 as musl linux build environment. it will try to install all the compiling tools, development packages, and python requirements for paddle musl compiling.
environment variables:
build_paddle.sh automatically or manually paddle building script. it will mount the root directory of paddle source to /paddle, and run compile procedure in /root/build directory. the output wheel package will save to the ./output directory relative to working directory.
environment variables: