PaddlePaddle目前唯一官方支持的运行的方式是Docker容器。因为Docker能在所有主要操作系统(包括Linux,Mac OS X和Windows)上运行。 请注意,您需要更改 `Dockers设置 <https://github.com/PaddlePaddle/Paddle/issues/627>`_ 才能充分利用Mac OS X和Windows上的硬件资源。
PaddlePaddle目前唯一官方支持的运行的方式是Docker容器。因为Docker能在所有主要操作系统(包括Linux,Mac OS X和Windows)上运行。 请注意,您需要更改 `Dockers设置 <https://github.com/PaddlePaddle/Paddle/issues/627>`_ 才能充分利用Mac OS X和Windows上的硬件资源。
But this works only if all dependencies of :code:`a.py` are in the production image. If this is not the case, we need to build a new Docker image from the production image and with more dependencies installs.
Given the development image `paddle:dev`, the following command builds PaddlePaddle from the source tree on the development computer (host):
Given the development image `paddle:dev`, the following command builds PaddlePaddle from the source tree on the development computer (host):
```bash
```bash
docker run -v$PWD:/paddle -e"WITH_GPU=OFF"-e"WITH_AVX=ON"-e"TEST=OFF" paddle:dev
docker run -v$PWD:/paddle -e"WITH_GPU=OFF"-e"WITH_AVX=ON"-e"WITH_TEST=OFF"-e"RUN_TEST=OFF" paddle:dev
```
```
This command mounts the source directory on the host into `/paddle` in the container, so the default entry point of `paddle:dev`, `build.sh`, could build the source code with possible local changes. When it writes to `/paddle/build` in the container, it writes to `$PWD/build` on the host indeed.
This command mounts the source directory on the host into `/paddle` in the container, so the default entry point of `paddle:dev`, `build.sh`, could build the source code with possible local changes. When it writes to `/paddle/build` in the container, it writes to `$PWD/build` on the host indeed.
...
@@ -108,7 +108,11 @@ This command mounts the source directory on the host into `/paddle` in the conta
...
@@ -108,7 +108,11 @@ This command mounts the source directory on the host into `/paddle` in the conta
Users can specify the following Docker build arguments with either "ON" or "OFF" value:
Users can specify the following Docker build arguments with either "ON" or "OFF" value:
-`WITH_GPU`: ***Required***. Generates NVIDIA CUDA GPU code and relies on CUDA libraries.
-`WITH_GPU`: ***Required***. Generates NVIDIA CUDA GPU code and relies on CUDA libraries.
-`WITH_AVX`: ***Required***. Set to "OFF" prevents from generating AVX instructions. If you don't know what is AVX, you might want to set "ON".
-`WITH_AVX`: ***Required***. Set to "OFF" prevents from generating AVX instructions. If you don't know what is AVX, you might want to set "ON".
-`TEST`: ***Optional, default OFF***. Build unit tests and run them after building.
-`WITH_TEST`: ***Optional, default OFF***. Build unit tests binaries. Once you've built the unit tests, you can run these test manually by the following command:
```bash
docker run -v$PWD:/paddle -e"WITH_GPU=OFF"-e"WITH_AVX=ON" paddle:dev sh -c"cd /paddle/build; make coverall"
```
-`RUN_TEST`: ***Optional, default OFF***. Run unit tests after building. You can't run unit tests without building it.