提交 04be43da 编写于 作者: T Travis CI

Deploy to GitHub Pages: 2920b6bc

上级 40fd3f58
Build and Install
Installing from Sources
=================
## Requirement
* [1. Download and Setup](#download)
* [2. Requirements](#requirements)
* [3. Build on Ubuntu](#ubuntu)
* [4. Build on Mac OS X](#mac)
### Dependents
## <span id="download">Download and Setup</span>
You can download PaddlePaddle from the [github source](https://github.com/gangliao/Paddle).
- **CMake**: required for 2.8+ version
- **g++**: a recent c++ compiler supporting c++11, >= 4.6, < 5
- **BLAS library**: such as openBLAS, MKL, ATLAS
- **protobuf**: required for 2.4+ version, 3.x is not supported
- **python**: currently only 2.7 version is supported
```bash
git clone https://github.com/baidu/Paddle paddle
```
## <span id="requirements">Requirements</span>
To compile the source code, your computer must be equipped with GCC >=4.6 or Clang Compiler.
### Dependencies
- **CMake**: version >= 2.8
- **BLAS**: MKL, OpenBlas or ATLAS
- **protobuf**: version >= 2.4, **Note: 3.x is not supported**
- **python**: only python 2.7 is supported currently
### Options
PaddlePaddle supports some build options. To enable it, first you need to install the related libraries.
Optional | Description
------------ | :-----------
**WITH_GPU** | Compile with GPU mode.
**WITH_DOUBLE** | Compile with double precision floating-point, default: single precision. |
**WITH_GLOG** | Compile with glog. If not found, default: an internal log implementation.
**WITH_GFLAGS** | Compile with gflags. If not found, default: an internal flag implementation.
**WITH_TESTING** | Compile with gtest for PaddlePaddle's unit testing.
**WITH_DOC** | Compile to generate PaddlePaddle's docs, default: disabled (OFF).
**WITH_SWIG_PY** | Compile with python predict API, default: disabled (OFF).
**WITH_STYLE_CHECK**| Compile with code style check, default: enabled (ON).
|
### Optional
**Note:**
- The GPU version works best with Cuda Toolkit 7.5 and cuDNN v5.
- Other versions like Cuda Toolkit 6.5, 7.0, 8.0 and cuDNN v2, v3, v4 are also supported.
- **To utilize cuDNN v5, Cuda Toolkit 7.5 is prerequisite and vice versa.**
PaddlePaddle also support some build options, you have to install related libraries.
As a simple example, consider the following:
- **WITH_GPU**: Compile with gpu mode
- The GPU version works best with Cuda Toolkit 7.5 and cuDNN v5
- Other versions Cuda Toolkit 6.5, 7.0 and cuDNN v2, v3, v4 are also supported
- Note: to utilize cuDNN v5, Cuda Toolkit 7.5 is prerequisite and vice versa
- **WITH_DOUBLE**: Compile with double precision, otherwise use single precision
- **WITH_GLOG**: Compile with glog, otherwise use a log implement internally
- **WITH_GFLAGS**: Compile with gflags, otherwise use a flag implement internally
- **WITH_TESTING**: Compile with gtest and run unittest for PaddlePaddle
- **WITH_DOC**: Compile with documentation
- **WITH_SWIG_PY**: Compile with python predict api
- **WITH_STYLE_CHECK**: Style check for source code
1. **Python Dependencies(optional)**
To compile PaddlePaddle with python predict API, make sure swig installed and set `-DWITH_SWIG_PY=ON` as follows:
```bash
# install swig on ubuntu
sudo apt-get install swig
# install swig on Mac OS X
brew install swig
# active swig in cmake
cmake .. -DWITH_SWIG_PY=ON
```
2. **Doc Dependencies(optional)**
To generate PaddlePaddle's documentation, install dependencies and set `-DWITH_DOC=ON` as follows:
```bash
pip install 'sphinx>=1.4.0'
pip install sphinx_rtd_theme breathe recommonmark
## Building on Ubuntu14.04
# install doxygen on Ubuntu
sudo apt-get install doxygen
# install doxygen on Mac OS X
brew install doxygen
# active docs in cmake
cmake .. -DWITH_DOC=ON`
```
## <span id="ubuntu">Build on Ubuntu 14.04</span>
### Install Dependencies
- **CPU Dependencies**
```bash
# necessary
sudo apt-get update
sudo apt-get install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy git
# optional
sudo apt-get install libgoogle-glog-dev
sudo apt-get install libgflags-dev
sudo apt-get install libgtest-dev
sudo pip install wheel
pushd /usr/src/gtest
cmake .
make
sudo cp *.a /usr/lib
popd
```
```bash
# necessary
sudo apt-get update
sudo apt-get install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy git
# optional
sudo apt-get install libgoogle-glog-dev
sudo apt-get install libgflags-dev
sudo apt-get install libgtest-dev
sudo pip install wheel
pushd /usr/src/gtest
cmake .
make
sudo cp *.a /usr/lib
popd
```
- **GPU Dependencies(optional)**
- **GPU Dependencies (optional)**
If you need to build GPU version, the first thing you need is a machine that has GPU and CUDA installed.
And you also need to install cuDNN.
To build GPU version, you will need the following installed:
You can download CUDA toolkit and cuDNN from nvidia website:
```bash
https://developer.nvidia.com/cuda-downloads
https://developer.nvidia.com/cudnn
```
You can copy cuDNN files into the CUDA toolkit directory, such as:
1. a CUDA-capable GPU
2. A supported version of Linux with a gcc compiler and toolchain
3. NVIDIA CUDA Toolkit (available at http://developer.nvidia.com/cuda-downloads)
4. NVIDIA cuDNN Library (availabel at https://developer.nvidia.com/cudnn)
The CUDA development environment relies on tight integration with the host development environment,
including the host compiler and C runtime libraries, and is therefore only supported on
distribution versions that have been qualified for this CUDA Toolkit release.
After downloading cuDNN library, issue the following commands:
```bash
sudo tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
```
Then you need to set LD\_LIBRARY\_PATH, CUDA\_HOME and PATH environment variables in ~/.bashrc.
```bash
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda
export PATH=/usr/local/cuda/bin:$PATH
```
### Build and Install
As usual, the best option is to create build folder under paddle project directory.
```bash
sudo tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
mkdir build && cd build
cmake ..
```
Then you need to set LD\_LIBRARY\_PATH, CUDA\_HOME and PATH environment variables in ~/.bashrc.
CMake first check PaddlePaddle's dependencies in system default path. After installing some optional
libraries, corresponding build option will be set automatically (for instance, glog, gtest and gflags).
If still not found, you can manually set it based on CMake error information from your screen.
As a simple example, consider the following:
- **Only CPU**
```bash
cmake .. -DWITH_GPU=OFF -DWITH_DOC=OFF
```
- **GPU**
```bash
cmake .. -DWITH_GPU=ON -DWITH_DOC=OFF
```
- **GPU with doc and swig**
```bash
cmake .. -DWITH_GPU=ON -DWITH_DOC=ON -DWITH_SWIG_PY=ON
```
Finally, you can download source code and build:
```bash
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda
export PATH=/usr/local/cuda/bin:$PATH
# you can add build option here, such as:
cmake .. -DWITH_GPU=ON -DWITH_DOC=OFF -DCMAKE_INSTALL_PREFIX=<path to install>
# please use sudo make install, if you want
# to install PaddlePaddle into the system
make -j `nproc` && make install
# set PaddlePaddle installation path in ~/.bashrc
export PATH=<path to install>/bin:$PATH
```
- **Python Dependencies(optional)**
If you want to compile PaddlePaddle with python predict api, you need to add -DWITH_SWIG_PY=ON in cmake command and install these first:
**Note:**
If you set `WITH_SWIG_PY=ON`, related python dependencies also need to be installed.
Otherwise, PaddlePaddle will automatically install python dependencies
at first time when user run paddle commands, such as `paddle version`, `paddle train`.
It may require sudo privileges:
```bash
sudo apt-get install swig
# you can run
sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
# or just run
sudo paddle version
```
- **Doc Dependencies(optional)**
## <span id="mac">Building on Mac OS X</span>
If you want to compile PaddlePaddle with doc, you need to add -DWITH_DOC=ON in cmake command and install these first:
### Prerequisites
This guide is based on Mac OS X 10.11 (El Capitan). Note that if you are running an up to date version of OS X,
you will already have Python 2.7.10 and Numpy 1.8 installed.
The best option is to use the package manager homebrew to handle installations and upgrades for you.
To install [homebrew](http://brew.sh/), first open a terminal window (you can find Terminal in the Utilities folder in Applications), and issue the command:
```bash
pip install 'sphinx>=1.4.0'
pip install sphinx_rtd_theme breathe recommonmark
sudo apt-get install doxygen
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install pip
easy_install pip
```
### Build and Install
### Install Dependencies
CMake will find dependent libraries in system default paths first. After installing some optional libraries, corresponding build option will automatically be on(such as glog, gtest and gflags). And if libraries are not found, you have to set following variables manually in cmake command(CUDNN_ROOT, ATLAS_ROOT, MKL_ROOT, OPENBLAS_ROOT).
- **CPU Dependencies**
Here are some examples of cmake command with different options:
```bash
# Install fundamental dependents
brew install glog gflags cmake protobuf openblas
# Install google test on Mac OS X
# Download gtest 1.7.0
wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz
tar -xvf googletest-release-1.7.0.tar.gz && cd googletest-release-1.7.0
# Build gtest
mkdir build && cmake ..
make
# Install gtest library
sudo cp -r ../include/gtest /usr/local/include/
sudo cp lib*.a /usr/local/lib
```
**only cpu**
- **GPU Dependencies(optional)**
```bash
cmake -DWITH_GPU=OFF -DWITH_DOC=OFF
```
To build GPU version, you will need the following installed:
1. a CUDA-capable GPU
2. Mac OS X 10.11 or later
2. the Clang compiler and toolchain installed using Xcode
3. NVIDIA CUDA Toolkit (available at http://developer.nvidia.com/cuda-downloads)
4. NVIDIA cuDNN Library (availabel at https://developer.nvidia.com/cudnn)
The CUDA development environment relies on tight integration with the host development environment,
including the host compiler and C runtime libraries, and is therefore only supported on
distribution versions that have been qualified for this CUDA Toolkit release.
1. After downloading cuDNN library, issue the following commands:
```bash
sudo tar -xzf cudnn-7.5-osx-x64-v5.0-ga.tgz -C /usr/local
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
```
2. Then you need to set DYLD\_LIBRARY\_PATH, CUDA\_HOME and PATH environment variables in ~/.bashrc.
**gpu**
```bash
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
export PATH=/usr/local/cuda/bin:$PATH
```
### Build and Install
As usual, the best option is to create build folder under paddle project directory.
```bash
cmake -DWITH_GPU=ON -DWITH_DOC=OFF
mkdir build && cd build
cmake ..
```
**gpu with doc and swig**
CMake first check PaddlePaddle's dependencies in system default path. After installing some optional
libraries, corresponding build option will be set automatically (for instance, glog, gtest and gflags).
If still not found, you can manually set it based on CMake error information from your screen.
```bash
cmake -DWITH_GPU=ON -DWITH_DOC=ON -DWITH_SWIG_PY=ON
```
As a simple example, consider the following:
Finally, you can download source code and build:
- **Only CPU**
```bash
cmake .. -DWITH_GPU=OFF -DWITH_DOC=OFF
```
- **GPU**
```bash
cmake .. -DWITH_GPU=ON -DWITH_DOC=OFF
```
- **GPU with doc and swig**
```bash
cmake .. -DWITH_GPU=ON -DWITH_DOC=ON -DWITH_SWIG_PY=ON
```
Finally, you can build PaddlePaddle:
```bash
git clone https://github.com/baidu/Paddle paddle
cd paddle
mkdir build
cd build
# you can add build option here, such as:
cmake -DWITH_GPU=ON -DWITH_DOC=OFF -DCMAKE_INSTALL_PREFIX=<path to install> ..
# please use sudo make install, if you want
# to install PaddlePaddle into the system
cmake .. -DWITH_GPU=ON -DWITH_DOC=OFF -DCMAKE_INSTALL_PREFIX=<installation path>
# please use sudo make install, if you want to install PaddlePaddle into the system
make -j `nproc` && make install
# PaddlePaddle installation path
export PATH=<path to install>/bin:$PATH
# set PaddlePaddle installation path in ~/.bashrc
export PATH=<installation path>/bin:$PATH
```
**Note**
And if you set WITH_SWIG_PY=ON, you have to install related python predict api at the same time:
**Note:**
If you set `WITH_SWIG_PY=ON`, related python dependencies also need to be installed.
Otherwise, PaddlePaddle will automatically install python dependencies
at first time when user run paddle commands, such as `paddle version`, `paddle train`.
It may require sudo privileges:
```bash
pip install <path to install>/opt/paddle/share/wheels/*.whl
```
# you can run
sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
# or just run
sudo paddle version
```
\ No newline at end of file
......@@ -8,7 +8,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Build and Install &#8212; PaddlePaddle documentation</title>
<title>Installing from Sources &#8212; PaddlePaddle documentation</title>
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
......@@ -67,47 +67,93 @@ var _hmt = _hmt || [];
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="build-and-install">
<span id="build-and-install"></span><h1>Build and Install<a class="headerlink" href="#build-and-install" title="Permalink to this headline"></a></h1>
<div class="section" id="requirement">
<span id="requirement"></span><h2>Requirement<a class="headerlink" href="#requirement" title="Permalink to this headline"></a></h2>
<div class="section" id="dependents">
<span id="dependents"></span><h3>Dependents<a class="headerlink" href="#dependents" title="Permalink to this headline"></a></h3>
<div class="section" id="installing-from-sources">
<span id="installing-from-sources"></span><h1>Installing from Sources<a class="headerlink" href="#installing-from-sources" title="Permalink to this headline"></a></h1>
<ul class="simple">
<li><strong>CMake</strong>: required for 2.8+ version</li>
<li><strong>g++</strong>: a recent c++ compiler supporting c++11, &gt;= 4.6, &lt; 5</li>
<li><strong>BLAS library</strong>: such as openBLAS, MKL, ATLAS</li>
<li><strong>protobuf</strong>: required for 2.4+ version, 3.x is not supported</li>
<li><strong>python</strong>: currently only 2.7 version is supported</li>
<li><a class="reference external" href="#download">1. Download and Setup</a></li>
<li><a class="reference external" href="#requirements">2. Requirements</a></li>
<li><a class="reference external" href="#ubuntu">3. Build on Ubuntu</a></li>
<li><a class="reference external" href="#mac">4. Build on Mac OS X</a></li>
</ul>
<div class="section" id="span-id-download-download-and-setup-span">
<span id="span-id-download-download-and-setup-span"></span><h2><span id="download">Download and Setup</span><a class="headerlink" href="#span-id-download-download-and-setup-span" title="Permalink to this headline"></a></h2>
<p>You can download PaddlePaddle from the <a class="reference external" href="https://github.com/gangliao/Paddle">github source</a>.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>git clone https://github.com/baidu/Paddle paddle
</pre></div>
</div>
</div>
<div class="section" id="optional">
<span id="optional"></span><h3>Optional<a class="headerlink" href="#optional" title="Permalink to this headline"></a></h3>
<p>PaddlePaddle also support some build options, you have to install related libraries.</p>
<div class="section" id="span-id-requirements-requirements-span">
<span id="span-id-requirements-requirements-span"></span><h2><span id="requirements">Requirements</span><a class="headerlink" href="#span-id-requirements-requirements-span" title="Permalink to this headline"></a></h2>
<p>To compile the source code, your computer must be equipped with GCC &gt;=4.6 or Clang Compiler.</p>
<div class="section" id="dependencies">
<span id="dependencies"></span><h3>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><strong>WITH_GPU</strong>: Compile with gpu mode<ul>
<li>The GPU version works best with Cuda Toolkit 7.5 and cuDNN v5</li>
<li>Other versions Cuda Toolkit 6.5, 7.0 and cuDNN v2, v3, v4 are also supported</li>
<li>Note: to utilize cuDNN v5, Cuda Toolkit 7.5 is prerequisite and vice versa</li>
<li><strong>CMake</strong>: version &gt;= 2.8</li>
<li><strong>BLAS</strong>: MKL, OpenBlas or ATLAS</li>
<li><strong>protobuf</strong>: version &gt;= 2.4, <strong>Note: 3.x is not supported</strong></li>
<li><strong>python</strong>: only python 2.7 is supported currently</li>
</ul>
</li>
<li><strong>WITH_DOUBLE</strong>: Compile with double precision, otherwise use single precision</li>
<li><strong>WITH_GLOG</strong>: Compile with glog, otherwise use a log implement internally</li>
<li><strong>WITH_GFLAGS</strong>: Compile with gflags, otherwise use a flag implement internally</li>
<li><strong>WITH_TESTING</strong>: Compile with gtest and run unittest for PaddlePaddle</li>
<li><strong>WITH_DOC</strong>: Compile with documentation</li>
<li><strong>WITH_SWIG_PY</strong>: Compile with python predict api</li>
<li><strong>WITH_STYLE_CHECK</strong>: Style check for source code</li>
</div>
<div class="section" id="options">
<span id="options"></span><h3>Options<a class="headerlink" href="#options" title="Permalink to this headline"></a></h3>
<p>PaddlePaddle supports some build options. To enable it, first you need to install the related libraries.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Optional</span> <span class="o">|</span> <span class="n">Description</span>
<span class="o">------------</span> <span class="o">|</span> <span class="p">:</span><span class="o">-----------</span>
<span class="o">**</span><span class="n">WITH_GPU</span><span class="o">**</span> <span class="o">|</span> <span class="n">Compile</span> <span class="k">with</span> <span class="n">GPU</span> <span class="n">mode</span><span class="o">.</span>
<span class="o">**</span><span class="n">WITH_DOUBLE</span><span class="o">**</span> <span class="o">|</span> <span class="n">Compile</span> <span class="k">with</span> <span class="n">double</span> <span class="n">precision</span> <span class="n">floating</span><span class="o">-</span><span class="n">point</span><span class="p">,</span> <span class="n">default</span><span class="p">:</span> <span class="n">single</span> <span class="n">precision</span><span class="o">.</span> <span class="o">|</span>
<span class="o">**</span><span class="n">WITH_GLOG</span><span class="o">**</span> <span class="o">|</span> <span class="n">Compile</span> <span class="k">with</span> <span class="n">glog</span><span class="o">.</span> <span class="n">If</span> <span class="ow">not</span> <span class="n">found</span><span class="p">,</span> <span class="n">default</span><span class="p">:</span> <span class="n">an</span> <span class="n">internal</span> <span class="n">log</span> <span class="n">implementation</span><span class="o">.</span>
<span class="o">**</span><span class="n">WITH_GFLAGS</span><span class="o">**</span> <span class="o">|</span> <span class="n">Compile</span> <span class="k">with</span> <span class="n">gflags</span><span class="o">.</span> <span class="n">If</span> <span class="ow">not</span> <span class="n">found</span><span class="p">,</span> <span class="n">default</span><span class="p">:</span> <span class="n">an</span> <span class="n">internal</span> <span class="n">flag</span> <span class="n">implementation</span><span class="o">.</span>
<span class="o">**</span><span class="n">WITH_TESTING</span><span class="o">**</span> <span class="o">|</span> <span class="n">Compile</span> <span class="k">with</span> <span class="n">gtest</span> <span class="k">for</span> <span class="n">PaddlePaddle</span><span class="s1">&#39;s unit testing. </span>
<span class="o">**</span><span class="n">WITH_DOC</span><span class="o">**</span> <span class="o">|</span> <span class="n">Compile</span> <span class="n">to</span> <span class="n">generate</span> <span class="n">PaddlePaddle</span><span class="s1">&#39;s docs, default: disabled (OFF).</span>
<span class="o">**</span><span class="n">WITH_SWIG_PY</span><span class="o">**</span> <span class="o">|</span> <span class="n">Compile</span> <span class="k">with</span> <span class="n">python</span> <span class="n">predict</span> <span class="n">API</span><span class="p">,</span> <span class="n">default</span><span class="p">:</span> <span class="n">disabled</span> <span class="p">(</span><span class="n">OFF</span><span class="p">)</span><span class="o">.</span>
<span class="o">**</span><span class="n">WITH_STYLE_CHECK</span><span class="o">**|</span> <span class="n">Compile</span> <span class="k">with</span> <span class="n">code</span> <span class="n">style</span> <span class="n">check</span><span class="p">,</span> <span class="n">default</span><span class="p">:</span> <span class="n">enabled</span> <span class="p">(</span><span class="n">ON</span><span class="p">)</span><span class="o">.</span>
</pre></div>
</div>
<p>|</p>
<p><strong>Note:</strong></p>
<ul class="simple">
<li>The GPU version works best with Cuda Toolkit 7.5 and cuDNN v5.</li>
<li>Other versions like Cuda Toolkit 6.5, 7.0, 8.0 and cuDNN v2, v3, v4 are also supported.</li>
<li><strong>To utilize cuDNN v5, Cuda Toolkit 7.5 is prerequisite and vice versa.</strong></li>
</ul>
<p>As a simple example, consider the following:</p>
<ol>
<li><p class="first"><strong>Python Dependencies(optional)</strong></p>
<p>To compile PaddlePaddle with python predict API, make sure swig installed and set <code class="docutils literal"><span class="pre">-DWITH_SWIG_PY=ON</span></code> as follows:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># install swig on ubuntu</span>
sudo apt-get install swig
<span class="c1"># install swig on Mac OS X</span>
brew install swig
<span class="c1"># active swig in cmake</span>
cmake .. -DWITH_SWIG_PY<span class="o">=</span>ON
</pre></div>
</div>
</li>
<li><p class="first"><strong>Doc Dependencies(optional)</strong></p>
<p>To generate PaddlePaddle&#8217;s documentation, install dependencies and set <code class="docutils literal"><span class="pre">-DWITH_DOC=ON</span></code> as follows:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>pip install <span class="s1">&#39;sphinx&gt;=1.4.0&#39;</span>
pip install sphinx_rtd_theme breathe recommonmark
<span class="c1"># install doxygen on Ubuntu</span>
sudo apt-get install doxygen
<span class="c1"># install doxygen on Mac OS X</span>
brew install doxygen
<span class="c1"># active docs in cmake</span>
cmake .. -DWITH_DOC<span class="o">=</span>ON<span class="sb">`</span>
</pre></div>
</div>
</li>
</ol>
</div>
</div>
<div class="section" id="building-on-ubuntu14-04">
<span id="building-on-ubuntu14-04"></span><h2>Building on Ubuntu14.04<a class="headerlink" href="#building-on-ubuntu14-04" title="Permalink to this headline"></a></h2>
<div class="section" id="span-id-ubuntu-build-on-ubuntu-14-04-span">
<span id="span-id-ubuntu-build-on-ubuntu-14-04-span"></span><h2><span id="ubuntu">Build on Ubuntu 14.04</span><a class="headerlink" href="#span-id-ubuntu-build-on-ubuntu-14-04-span" title="Permalink to this headline"></a></h2>
<div class="section" id="install-dependencies">
<span id="install-dependencies"></span><h3>Install Dependencies<a class="headerlink" href="#install-dependencies" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><strong>CPU Dependencies</strong></li>
</ul>
<ul>
<li><p class="first"><strong>CPU Dependencies</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># necessary</span>
sudo apt-get update
sudo apt-get install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy git
......@@ -123,17 +169,19 @@ sudo cp *.a /usr/lib
<span class="nb">popd</span>
</pre></div>
</div>
<ul class="simple">
<li><strong>GPU Dependencies(optional)</strong></li>
</ul>
<p>If you need to build GPU version, the first thing you need is a machine that has GPU and CUDA installed.
And you also need to install cuDNN.</p>
<p>You can download CUDA toolkit and cuDNN from nvidia website:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>https://developer.nvidia.com/cuda-downloads
https://developer.nvidia.com/cudnn
</li>
<li><p class="first"><strong>GPU Dependencies (optional)</strong></p>
<p>To build GPU version, you will need the following installed:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span> <span class="mf">1.</span> <span class="n">a</span> <span class="n">CUDA</span><span class="o">-</span><span class="n">capable</span> <span class="n">GPU</span>
<span class="mf">2.</span> <span class="n">A</span> <span class="n">supported</span> <span class="n">version</span> <span class="n">of</span> <span class="n">Linux</span> <span class="k">with</span> <span class="n">a</span> <span class="n">gcc</span> <span class="n">compiler</span> <span class="ow">and</span> <span class="n">toolchain</span>
<span class="mf">3.</span> <span class="n">NVIDIA</span> <span class="n">CUDA</span> <span class="n">Toolkit</span> <span class="p">(</span><span class="n">available</span> <span class="n">at</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">developer</span><span class="o">.</span><span class="n">nvidia</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cuda</span><span class="o">-</span><span class="n">downloads</span><span class="p">)</span>
<span class="mf">4.</span> <span class="n">NVIDIA</span> <span class="n">cuDNN</span> <span class="n">Library</span> <span class="p">(</span><span class="n">availabel</span> <span class="n">at</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">developer</span><span class="o">.</span><span class="n">nvidia</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cudnn</span><span class="p">)</span>
</pre></div>
</div>
<p>You can copy cuDNN files into the CUDA toolkit directory, such as:</p>
<p>The CUDA development environment relies on tight integration with the host development environment,
including the host compiler and C runtime libraries, and is therefore only supported on
distribution versions that have been qualified for this CUDA Toolkit release.</p>
<p>After downloading cuDNN library, issue the following commands:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>sudo tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
</pre></div>
......@@ -144,56 +192,170 @@ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span>/usr/local/cuda/bin:<span class="nv">$PATH</span>
</pre></div>
</div>
<ul class="simple">
<li><strong>Python Dependencies(optional)</strong></li>
</li>
</ul>
<p>If you want to compile PaddlePaddle with python predict api, you need to add -DWITH_SWIG_PY=ON in cmake command and install these first:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>sudo apt-get install swig
</pre></div>
</div>
<ul class="simple">
<li><strong>Doc Dependencies(optional)</strong></li>
</ul>
<p>If you want to compile PaddlePaddle with doc, you need to add -DWITH_DOC=ON in cmake command and install these first:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>pip install <span class="s1">&#39;sphinx&gt;=1.4.0&#39;</span>
pip install sphinx_rtd_theme breathe recommonmark
sudo apt-get install doxygen
<div class="section" id="build-and-install">
<span id="build-and-install"></span><h3>Build and Install<a class="headerlink" href="#build-and-install" title="Permalink to this headline"></a></h3>
<p>As usual, the best option is to create build folder under paddle project directory.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>mkdir build <span class="o">&amp;&amp;</span> <span class="nb">cd</span> build
cmake ..
</pre></div>
</div>
</div>
<div class="section" id="build-and-install">
<span id="id1"></span><h3>Build and Install<a class="headerlink" href="#build-and-install" title="Permalink to this headline"></a></h3>
<p>CMake will find dependent libraries in system default paths first. After installing some optional libraries, corresponding build option will automatically be on(such as glog, gtest and gflags). And if libraries are not found, you have to set following variables manually in cmake command(CUDNN_ROOT, ATLAS_ROOT, MKL_ROOT, OPENBLAS_ROOT).</p>
<p>Here are some examples of cmake command with different options:</p>
<p><strong>only cpu</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake -DWITH_GPU<span class="o">=</span>OFF -DWITH_DOC<span class="o">=</span>OFF
<p>CMake first check PaddlePaddle&#8217;s dependencies in system default path. After installing some optional
libraries, corresponding build option will be set automatically (for instance, glog, gtest and gflags).
If still not found, you can manually set it based on CMake error information from your screen.</p>
<p>As a simple example, consider the following:</p>
<ul>
<li><p class="first"><strong>Only CPU</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake .. -DWITH_GPU<span class="o">=</span>OFF -DWITH_DOC<span class="o">=</span>OFF
</pre></div>
</div>
<p><strong>gpu</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>OFF
</li>
<li><p class="first"><strong>GPU</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake .. -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>OFF
</pre></div>
</div>
<p><strong>gpu with doc and swig</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>ON -DWITH_SWIG_PY<span class="o">=</span>ON
</li>
<li><p class="first"><strong>GPU with doc and swig</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake .. -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>ON -DWITH_SWIG_PY<span class="o">=</span>ON
</pre></div>
</div>
</li>
</ul>
<p>Finally, you can download source code and build:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>git clone https://github.com/baidu/Paddle paddle
<span class="nb">cd</span> paddle
mkdir build
<span class="nb">cd</span> build
<span class="c1"># you can add build option here, such as: </span>
cmake -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>OFF -DCMAKE_INSTALL_PREFIX<span class="o">=</span>&lt;path to install&gt; ..
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># you can add build option here, such as: </span>
cmake .. -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>OFF -DCMAKE_INSTALL_PREFIX<span class="o">=</span>&lt;path to install&gt;
<span class="c1"># please use sudo make install, if you want</span>
<span class="c1"># to install PaddlePaddle into the system</span>
make -j <span class="sb">`</span>nproc<span class="sb">`</span> <span class="o">&amp;&amp;</span> make install
<span class="c1"># PaddlePaddle installation path</span>
<span class="c1"># set PaddlePaddle installation path in ~/.bashrc</span>
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span>&lt;path to install&gt;/bin:<span class="nv">$PATH</span>
</pre></div>
</div>
<p><strong>Note</strong></p>
<p>And if you set WITH_SWIG_PY=ON, you have to install related python predict api at the same time:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>pip install &lt;path to install&gt;/opt/paddle/share/wheels/*.whl
<p><strong>Note:</strong></p>
<p>If you set <code class="docutils literal"><span class="pre">WITH_SWIG_PY=ON</span></code>, related python dependencies also need to be installed.
Otherwise, PaddlePaddle will automatically install python dependencies
at first time when user run paddle commands, such as <code class="docutils literal"><span class="pre">paddle</span> <span class="pre">version</span></code>, <code class="docutils literal"><span class="pre">paddle</span> <span class="pre">train</span></code>.
It may require sudo privileges:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># you can run</span>
sudo pip install &lt;path to install&gt;/opt/paddle/share/wheels/*.whl
<span class="c1"># or just run </span>
sudo paddle version
</pre></div>
</div>
</div>
</div>
<div class="section" id="span-id-mac-building-on-mac-os-x-span">
<span id="span-id-mac-building-on-mac-os-x-span"></span><h2><span id="mac">Building on Mac OS X</span><a class="headerlink" href="#span-id-mac-building-on-mac-os-x-span" title="Permalink to this headline"></a></h2>
<div class="section" id="prerequisites">
<span id="prerequisites"></span><h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline"></a></h3>
<p>This guide is based on Mac OS X 10.11 (El Capitan). Note that if you are running an up to date version of OS X,
you will already have Python 2.7.10 and Numpy 1.8 installed.</p>
<p>The best option is to use the package manager homebrew to handle installations and upgrades for you.
To install <a class="reference external" href="http://brew.sh/">homebrew</a>, first open a terminal window (you can find Terminal in the Utilities folder in Applications), and issue the command:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># install brew</span>
/usr/bin/ruby -e <span class="s2">&quot;</span><span class="k">$(</span>curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install<span class="k">)</span><span class="s2">&quot;</span>
<span class="c1"># install pip</span>
easy_install pip
</pre></div>
</div>
</div>
<div class="section" id="install-dependencies">
<span id="id1"></span><h3>Install Dependencies<a class="headerlink" href="#install-dependencies" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first"><strong>CPU Dependencies</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># Install fundamental dependents </span>
brew install glog gflags cmake protobuf openblas
<span class="c1"># Install google test on Mac OS X</span>
<span class="c1"># Download gtest 1.7.0</span>
wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz
tar -xvf googletest-release-1.7.0.tar.gz <span class="o">&amp;&amp;</span> <span class="nb">cd</span> googletest-release-1.7.0
<span class="c1"># Build gtest</span>
mkdir build <span class="o">&amp;&amp;</span> cmake ..
make
<span class="c1"># Install gtest library</span>
sudo cp -r ../include/gtest /usr/local/include/
sudo cp lib*.a /usr/local/lib
</pre></div>
</div>
</li>
<li><p class="first"><strong>GPU Dependencies(optional)</strong></p>
<p>To build GPU version, you will need the following installed:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span> <span class="mf">1.</span> <span class="n">a</span> <span class="n">CUDA</span><span class="o">-</span><span class="n">capable</span> <span class="n">GPU</span>
<span class="mf">2.</span> <span class="n">Mac</span> <span class="n">OS</span> <span class="n">X</span> <span class="mf">10.11</span> <span class="ow">or</span> <span class="n">later</span>
<span class="mf">2.</span> <span class="n">the</span> <span class="n">Clang</span> <span class="n">compiler</span> <span class="ow">and</span> <span class="n">toolchain</span> <span class="n">installed</span> <span class="n">using</span> <span class="n">Xcode</span>
<span class="mf">3.</span> <span class="n">NVIDIA</span> <span class="n">CUDA</span> <span class="n">Toolkit</span> <span class="p">(</span><span class="n">available</span> <span class="n">at</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">developer</span><span class="o">.</span><span class="n">nvidia</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cuda</span><span class="o">-</span><span class="n">downloads</span><span class="p">)</span>
<span class="mf">4.</span> <span class="n">NVIDIA</span> <span class="n">cuDNN</span> <span class="n">Library</span> <span class="p">(</span><span class="n">availabel</span> <span class="n">at</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">developer</span><span class="o">.</span><span class="n">nvidia</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cudnn</span><span class="p">)</span>
</pre></div>
</div>
<p>The CUDA development environment relies on tight integration with the host development environment,
including the host compiler and C runtime libraries, and is therefore only supported on
distribution versions that have been qualified for this CUDA Toolkit release.</p>
<ol>
<li><p class="first">After downloading cuDNN library, issue the following commands:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>sudo tar -xzf cudnn-7.5-osx-x64-v5.0-ga.tgz -C /usr/local
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
</pre></div>
</div>
</li>
<li><p class="first">Then you need to set DYLD_LIBRARY_PATH, CUDA_HOME and PATH environment variables in ~/.bashrc.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">DYLD_LIBRARY_PATH</span><span class="o">=</span>/usr/local/cuda/lib:<span class="nv">$DYLD_LIBRARY_PATH</span>
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span>/usr/local/cuda/bin:<span class="nv">$PATH</span>
</pre></div>
</div>
</li>
</ol>
</li>
</ul>
</div>
<div class="section" id="build-and-install">
<span id="id2"></span><h3>Build and Install<a class="headerlink" href="#build-and-install" title="Permalink to this headline"></a></h3>
<p>As usual, the best option is to create build folder under paddle project directory.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>mkdir build <span class="o">&amp;&amp;</span> <span class="nb">cd</span> build
cmake ..
</pre></div>
</div>
<p>CMake first check PaddlePaddle&#8217;s dependencies in system default path. After installing some optional
libraries, corresponding build option will be set automatically (for instance, glog, gtest and gflags).
If still not found, you can manually set it based on CMake error information from your screen.</p>
<p>As a simple example, consider the following:</p>
<ul>
<li><p class="first"><strong>Only CPU</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake .. -DWITH_GPU<span class="o">=</span>OFF -DWITH_DOC<span class="o">=</span>OFF
</pre></div>
</div>
</li>
<li><p class="first"><strong>GPU</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake .. -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>OFF
</pre></div>
</div>
</li>
<li><p class="first"><strong>GPU with doc and swig</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>cmake .. -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>ON -DWITH_SWIG_PY<span class="o">=</span>ON
</pre></div>
</div>
</li>
</ul>
<p>Finally, you can build PaddlePaddle:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># you can add build option here, such as: </span>
cmake .. -DWITH_GPU<span class="o">=</span>ON -DWITH_DOC<span class="o">=</span>OFF -DCMAKE_INSTALL_PREFIX<span class="o">=</span>&lt;installation path&gt;
<span class="c1"># please use sudo make install, if you want to install PaddlePaddle into the system</span>
make -j <span class="sb">`</span>nproc<span class="sb">`</span> <span class="o">&amp;&amp;</span> make install
<span class="c1"># set PaddlePaddle installation path in ~/.bashrc</span>
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span>&lt;installation path&gt;/bin:<span class="nv">$PATH</span>
</pre></div>
</div>
<p><strong>Note:</strong></p>
<p>If you set <code class="docutils literal"><span class="pre">WITH_SWIG_PY=ON</span></code>, related python dependencies also need to be installed.
Otherwise, PaddlePaddle will automatically install python dependencies
at first time when user run paddle commands, such as <code class="docutils literal"><span class="pre">paddle</span> <span class="pre">version</span></code>, <code class="docutils literal"><span class="pre">paddle</span> <span class="pre">train</span></code>.
It may require sudo privileges:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># you can run</span>
sudo pip install &lt;path to install&gt;/opt/paddle/share/wheels/*.whl
<span class="c1"># or just run </span>
sudo paddle version
</pre></div>
</div>
</div>
......@@ -208,13 +370,20 @@ make -j <span class="sb">`</span>nproc<span class="sb">`</span> <span class="o">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Build and Install</a><ul>
<li><a class="reference internal" href="#requirement">Requirement</a><ul>
<li><a class="reference internal" href="#dependents">Dependents</a></li>
<li><a class="reference internal" href="#optional">Optional</a></li>
<li><a class="reference internal" href="#">Installing from Sources</a><ul>
<li><a class="reference internal" href="#span-id-download-download-and-setup-span"><span id="download">Download and Setup</span></a></li>
<li><a class="reference internal" href="#span-id-requirements-requirements-span"><span id="requirements">Requirements</span></a><ul>
<li><a class="reference internal" href="#dependencies">Dependencies</a></li>
<li><a class="reference internal" href="#options">Options</a></li>
</ul>
</li>
<li><a class="reference internal" href="#span-id-ubuntu-build-on-ubuntu-14-04-span"><span id="ubuntu">Build on Ubuntu 14.04</span></a><ul>
<li><a class="reference internal" href="#install-dependencies">Install Dependencies</a></li>
<li><a class="reference internal" href="#build-and-install">Build and Install</a></li>
</ul>
</li>
<li><a class="reference internal" href="#building-on-ubuntu14-04">Building on Ubuntu14.04</a><ul>
<li><a class="reference internal" href="#span-id-mac-building-on-mac-os-x-span"><span id="mac">Building on Mac OS X</span></a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a></li>
<li><a class="reference internal" href="#install-dependencies">Install Dependencies</a></li>
<li><a class="reference internal" href="#build-and-install">Build and Install</a></li>
</ul>
......
......@@ -29,7 +29,7 @@
<link rel="top" title="PaddlePaddle documentation" href="../index.html" />
<link rel="up" title="Build And Install PaddlePaddle" href="index.html" />
<link rel="next" title="Docker installation guide" href="docker_install.html" />
<link rel="prev" title="Build and Install" href="build_from_source.html" />
<link rel="prev" title="Installing from Sources" href="build_from_source.html" />
<script>
var _hmt = _hmt || [];
(function() {
......@@ -55,7 +55,7 @@ var _hmt = _hmt || [];
<a href="docker_install.html" title="Docker installation guide"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="build_from_source.html" title="Build and Install"
<a href="build_from_source.html" title="Installing from Sources"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">PaddlePaddle documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Build And Install PaddlePaddle</a> &#187;</li>
......@@ -188,7 +188,7 @@ git push -f origin HEAD
<h4>Previous topic</h4>
<p class="topless"><a href="build_from_source.html"
title="previous chapter">Build and Install</a></p>
title="previous chapter">Installing from Sources</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="docker_install.html"
title="next chapter">Docker installation guide</a></p>
......@@ -226,7 +226,7 @@ git push -f origin HEAD
<a href="docker_install.html" title="Docker installation guide"
>next</a> |</li>
<li class="right" >
<a href="build_from_source.html" title="Build and Install"
<a href="build_from_source.html" title="Installing from Sources"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">PaddlePaddle documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" >Build And Install PaddlePaddle</a> &#187;</li>
......
......@@ -27,7 +27,7 @@
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="PaddlePaddle documentation" href="../index.html" />
<link rel="next" title="Build and Install" href="build_from_source.html" />
<link rel="next" title="Installing from Sources" href="build_from_source.html" />
<link rel="prev" title="Quick Start Tutorial" href="../demo/quick_start/index_en.html" />
<script>
var _hmt = _hmt || [];
......@@ -51,7 +51,7 @@ var _hmt = _hmt || [];
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="build_from_source.html" title="Build and Install"
<a href="build_from_source.html" title="Installing from Sources"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../demo/quick_start/index_en.html" title="Quick Start Tutorial"
......@@ -77,7 +77,7 @@ var _hmt = _hmt || [];
<p>If you want to hack and contribute PaddlePaddle source code, following guides can help you:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="build_from_source.html">Build and Install</a></li>
<li class="toctree-l1"><a class="reference internal" href="build_from_source.html">Installing from Sources</a></li>
<li class="toctree-l1"><a class="reference internal" href="contribute_to_paddle.html">Contribute to PaddlePaddle</a></li>
</ul>
</div>
......@@ -117,7 +117,7 @@ state and your experience of installation may not be smooth.</p>
title="previous chapter">Quick Start Tutorial</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="build_from_source.html"
title="next chapter">Build and Install</a></p>
title="next chapter">Installing from Sources</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
......@@ -149,7 +149,7 @@ state and your experience of installation may not be smooth.</p>
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="build_from_source.html" title="Build and Install"
<a href="build_from_source.html" title="Installing from Sources"
>next</a> |</li>
<li class="right" >
<a href="../demo/quick_start/index_en.html" title="Quick Start Tutorial"
......
......@@ -1989,7 +1989,7 @@ var _hmt = _hmt || [];
</dt>
<dt><a href="source/cuda/rnn/rnn.html#_CPPv24hppl">hppl (C++ type)</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[1]</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[2]</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[3]</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[4]</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[5]</a>
<dt><a href="source/cuda/rnn/rnn.html#_CPPv24hppl">hppl (C++ type)</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[1]</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[2]</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[3]</a>, <a href="source/cuda/rnn/rnn.html#_CPPv24hppl">[4]</a>
</dt>
......@@ -2549,7 +2549,7 @@ var _hmt = _hmt || [];
</dt>
<dt><a href="source/math/matrix/matrix.html#_CPPv26paddle">paddle (C++ type)</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[1]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[2]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[3]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[4]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[5]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[6]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[7]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[8]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[9]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[10]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[11]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[12]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[13]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[14]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[15]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[16]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[17]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[18]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[19]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[20]</a>, <a href="source/parameter/update/update.html#_CPPv26paddle">[21]</a>, <a href="source/parameter/update/update.html#_CPPv26paddle">[22]</a>
<dt><a href="source/cuda/rnn/rnn.html#_CPPv26paddle">paddle (C++ type)</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[1]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[2]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[3]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[4]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[5]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[6]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[7]</a>, <a href="source/math/matrix/matrix.html#_CPPv26paddle">[8]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[9]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[10]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[11]</a>, <a href="source/math/utils/utils.html#_CPPv26paddle">[12]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[13]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[14]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[15]</a>, <a href="source/parameter/optimizer/optimizer.html#_CPPv26paddle">[16]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[17]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[18]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[19]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[20]</a>, <a href="source/parameter/parameter/parameter.html#_CPPv26paddle">[21]</a>, <a href="source/parameter/update/update.html#_CPPv26paddle">[22]</a>, <a href="source/parameter/update/update.html#_CPPv26paddle">[23]</a>
</dt>
......@@ -9684,12 +9684,12 @@ var _hmt = _hmt || [];
<dt><a href="source/math/matrix/matrix.html#_CPPv2N6paddle12MatrixOffset5bRow_E">paddle::MatrixOffset::bRow_ (C++ member)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="source/math/matrix/matrix.html#_CPPv2N6paddle12MatrixOffset5cCol_E">paddle::MatrixOffset::cCol_ (C++ member)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="source/math/matrix/matrix.html#_CPPv2N6paddle12MatrixOffset5cRow_E">paddle::MatrixOffset::cRow_ (C++ member)</a>
</dt>
......@@ -14267,15 +14267,15 @@ var _hmt = _hmt || [];
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle9Semaphore4postEv">paddle::Semaphore::post (C++ function)</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle9SemaphoreaSERRK9Semaphore">paddle::Semaphore::operator= (C++ function)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle9Semaphore4sem_E">paddle::Semaphore::sem_ (C++ member)</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle9Semaphore4postEv">paddle::Semaphore::post (C++ function)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle9Semaphore9SemaphoreEi">paddle::Semaphore::Semaphore (C++ function)</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle9Semaphore9SemaphoreERK9Semaphore">paddle::Semaphore::Semaphore (C++ function)</a>, <a href="source/utils/thread.html#_CPPv2N6paddle9Semaphore9SemaphoreERR9Semaphore">[1]</a>, <a href="source/utils/thread.html#_CPPv2N6paddle9Semaphore9SemaphoreEi">[2]</a>
</dt>
......@@ -15463,23 +15463,15 @@ var _hmt = _hmt || [];
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock4lockEv">paddle::SpinLock::lock (C++ function)</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock12DISABLE_COPYE8SpinLock">paddle::SpinLock::DISABLE_COPY (C++ function)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock5lock_E">paddle::SpinLock::lock_ (C++ member)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLockaSERK8SpinLock">paddle::SpinLock::operator= (C++ function)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock8padding_E">paddle::SpinLock::padding_ (C++ member)</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock4lockEv">paddle::SpinLock::lock (C++ function)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock8SpinLockERK8SpinLock">paddle::SpinLock::SpinLock (C++ function)</a>, <a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock8SpinLockEv">[1]</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle8SpinLock8SpinLockEv">paddle::SpinLock::SpinLock (C++ function)</a>
</dt>
......@@ -15891,15 +15883,11 @@ var _hmt = _hmt || [];
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle13ThreadBarrier8barrier_E">paddle::ThreadBarrier::barrier_ (C++ member)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle13ThreadBarrieraSERK13ThreadBarrier">paddle::ThreadBarrier::operator= (C++ function)</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle13ThreadBarrier12DISABLE_COPYE13ThreadBarrier">paddle::ThreadBarrier::DISABLE_COPY (C++ function)</a>
</dt>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle13ThreadBarrier13ThreadBarrierERK13ThreadBarrier">paddle::ThreadBarrier::ThreadBarrier (C++ function)</a>, <a href="source/utils/thread.html#_CPPv2N6paddle13ThreadBarrier13ThreadBarrierEi">[1]</a>
<dt><a href="source/utils/thread.html#_CPPv2N6paddle13ThreadBarrier13ThreadBarrierEi">paddle::ThreadBarrier::ThreadBarrier (C++ function)</a>
</dt>
......
无法预览此类型文件
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -499,13 +499,29 @@ var _hmt = _hmt || [];
</div>
<dl class="type">
<dt>
<span class="target" id="paddlenamespacehppl"></span><em class="property">namespace </em><code class="descname">hppl</code></dt>
<dt id="_CPPv26paddle">
<span id="paddle"></span><span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code><a class="headerlink" href="#_CPPv26paddle" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<span class="target" id="paddlenamespacehppl_1a0ed7e93b31507e74ab94784d08288292"></span><code class="descname">static __inline__ __device__ double hppl::atomicAdd(double * address, double val)</code></dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt>
<span class="target" id="paddlenamespacepaddle_1abcad9a84d03d6d95c6f95c2374c507f1"></span><code class="descname">__device__ T paddle::paddleAtomicAdd(T * address, T val)</code></dt>
<dd></dd></dl>
<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddlenamespacepaddle_1a13d9db60a2cb630b48e01dc46334ae9c"></span><code class="descname">__device__ float paddle::paddleAtomicAdd(float * address, float val)</code></dt>
<dd></dd></dl>
<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddlenamespacepaddle_1a7cc9b9f8e1a0ea1ff5d017d341551041"></span><code class="descname">__device__ double paddle::paddleAtomicAdd(double * address, double val)</code></dt>
<dd></dd></dl>
</div>
......
......@@ -313,7 +313,7 @@ var _hmt = _hmt || [];
<p class="breathe-sectiondef-title rubric">Variables</p>
<dl class="member">
<dt id="_CPPv2N6paddle13__attribute__E">
<span id="paddle::__attribute____paddle::IParameterUpdaterHook"></span><span class="target" id="paddlenamespacepaddle_1ae83136be5a20c0fcca6a7858f6cf7b56"></span><em class="property">class</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv26paddle" title="paddle">paddle</a>::<a class="reference internal" href="#_CPPv2N6paddle21IParameterUpdaterHookE" title="paddle::IParameterUpdaterHook">IParameterUpdaterHook</a> <code class="descname">__attribute__</code><a class="headerlink" href="#_CPPv2N6paddle13__attribute__E" title="Permalink to this definition"></a></dt>
<span id="paddle::__attribute____paddle::IParameterUpdaterHook"></span><span class="target" id="paddlenamespacepaddle_1ae83136be5a20c0fcca6a7858f6cf7b56"></span><em class="property">class</em> <a class="reference internal" href="../../cuda/rnn/rnn.html#_CPPv26paddle" title="paddle">paddle</a>::<a class="reference internal" href="#_CPPv2N6paddle21IParameterUpdaterHookE" title="paddle::IParameterUpdaterHook">IParameterUpdaterHook</a> <code class="descname">__attribute__</code><a class="headerlink" href="#_CPPv2N6paddle13__attribute__E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
......
......@@ -183,9 +183,13 @@ var _hmt = _hmt || [];
<dl class="class">
<dt id="_CPPv2N6paddle8SpinLockE">
<span id="paddle::SpinLock"></span><span class="target" id="paddleclasspaddle_1_1SpinLock"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SpinLock</code><a class="headerlink" href="#_CPPv2N6paddle8SpinLockE" title="Permalink to this definition"></a></dt>
<dd><p>A simple wrapper for spin lock. The lock() method of <a class="reference internal" href="#paddleclasspaddle_1_1SpinLock"><span class="std std-ref">SpinLock</span></a> is busy-waiting which means it will keep trying to lock until lock on successfully. The <a class="reference internal" href="#paddleclasspaddle_1_1SpinLock"><span class="std std-ref">SpinLock</span></a> disable copy. </p>
<div class="breathe-sectiondef container">
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle8SpinLock12DISABLE_COPYE8SpinLock">
<span id="paddle::SpinLock::DISABLE_COPY__SpinLock"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1abb87cdb52fc8a8cc9576e2e220809085"></span><code class="descname">DISABLE_COPY</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle8SpinLockE" title="paddle::SpinLock">SpinLock</a><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8SpinLock12DISABLE_COPYE8SpinLock" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle8SpinLock8SpinLockEv">
<span id="paddle::SpinLock::SpinLock"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1ae4b8664661115cae5d7a9f5c1e4cd4ed"></span><code class="descname">SpinLock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8SpinLock8SpinLockEv" title="Permalink to this definition"></a></dt>
......@@ -196,16 +200,6 @@ var _hmt = _hmt || [];
<span id="paddle::SpinLock::~SpinLock"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1a12800af3f93511270eceba996f2e1233"></span><code class="descname">~SpinLock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8SpinLockD0Ev" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle8SpinLock8SpinLockERK8SpinLock">
<span id="paddle::SpinLock::SpinLock__SpinLockCR"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1a055efdc5fa3c87bf9c5efa19ca91fceb"></span><code class="descname">SpinLock</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle8SpinLock8SpinLockEv" title="paddle::SpinLock::SpinLock">SpinLock</a>&amp;<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8SpinLock8SpinLockERK8SpinLock" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle8SpinLockaSERK8SpinLock">
<span id="paddle::SpinLock::assign-operator__SpinLockCR"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1a65860c4525eafaf6c50f67bb7e6f1217"></span><a class="reference internal" href="#_CPPv2N6paddle8SpinLockE" title="paddle::SpinLock">SpinLock</a> &amp;<code class="descname">operator=</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle8SpinLockE" title="paddle::SpinLock">SpinLock</a>&amp;<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8SpinLockaSERK8SpinLock" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle8SpinLock4lockEv">
<span id="paddle::SpinLock::lock"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1ae5b78520a7808c9eee28674fa2dc1196"></span>void <code class="descname">lock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8SpinLock4lockEv" title="Permalink to this definition"></a></dt>
......@@ -216,19 +210,6 @@ var _hmt = _hmt || [];
<span id="paddle::SpinLock::unlock"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1a14f55be9684bed14427537571e7b6f7a"></span>void <code class="descname">unlock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8SpinLock6unlockEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle8SpinLock5lock_E">
<span id="paddle::SpinLock::lock___pthread_spinlock_t"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1a262929588dcc81d1740094988782f57e"></span>pthread_spinlock_t <code class="descname">lock_</code><a class="headerlink" href="#_CPPv2N6paddle8SpinLock5lock_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="member">
<dt id="_CPPv2N6paddle8SpinLock8padding_E">
<span id="paddle::SpinLock::padding___cA"></span><span class="target" id="paddleclasspaddle_1_1SpinLock_1a8c0dd8c3d3959525ecb169db292382ec"></span>char <code class="descname">padding_</code>[64-sizeof(pthread_spinlock_t)]<a class="headerlink" href="#_CPPv2N6paddle8SpinLock8padding_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
</dd></dl>
......@@ -238,9 +219,25 @@ var _hmt = _hmt || [];
<dl class="class">
<dt id="_CPPv2N6paddle9SemaphoreE">
<span id="paddle::Semaphore"></span><span class="target" id="paddleclasspaddle_1_1Semaphore"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">Semaphore</code><a class="headerlink" href="#_CPPv2N6paddle9SemaphoreE" title="Permalink to this definition"></a></dt>
<dd><p>A simple wapper of semaphore which can only be shared in the same process. </p>
<div class="breathe-sectiondef container">
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9Semaphore9SemaphoreERK9Semaphore">
<span id="paddle::Semaphore::Semaphore__SemaphoreCR"></span><span class="target" id="paddleclasspaddle_1_1Semaphore_1a6d471a25979a5d8c85f3649576a01284"></span><code class="descname">Semaphore</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9Semaphore9SemaphoreERK9Semaphore" title="paddle::Semaphore::Semaphore">Semaphore</a> &amp;<em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9Semaphore9SemaphoreERK9Semaphore" title="Permalink to this definition"></a></dt>
<dd><p>Disable copy &amp; assign. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle9SemaphoreaSERRK9Semaphore">
<span id="paddle::Semaphore::assign-operator__SemaphoreCRR"></span><span class="target" id="paddleclasspaddle_1_1Semaphore_1a9072e5b688450318d9c55437b5593f46"></span><a class="reference internal" href="#_CPPv2N6paddle9SemaphoreE" title="paddle::Semaphore">Semaphore</a> &amp;<code class="descname">operator=</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9SemaphoreE" title="paddle::Semaphore">Semaphore</a> &amp;&amp;<em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9SemaphoreaSERRK9Semaphore" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle9Semaphore9SemaphoreERR9Semaphore">
<span id="paddle::Semaphore::Semaphore__SemaphoreRR"></span><span class="target" id="paddleclasspaddle_1_1Semaphore_1a0a3cacfa683029887de7a865a6956b72"></span><code class="descname">Semaphore</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9Semaphore9SemaphoreERK9Semaphore" title="paddle::Semaphore::Semaphore">Semaphore</a> &amp;&amp;<em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9Semaphore9SemaphoreERR9Semaphore" title="Permalink to this definition"></a></dt>
<dd><p>Enable move. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle9Semaphore9SemaphoreEi">
<span id="paddle::Semaphore::Semaphore__i"></span><span class="target" id="paddleclasspaddle_1_1Semaphore_1a4884c28f1f853a0467b70e7f33547670"></span><code class="descname">Semaphore</code><span class="sig-paren">(</span>int <em>initValue</em> = 0<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9Semaphore9SemaphoreEi" title="Permalink to this definition"></a></dt>
......@@ -290,14 +287,6 @@ var _hmt = _hmt || [];
<dd><p>increment the semaphore. If the semaphore&#8217;s value greater than 0, wake up a thread blocked in <a class="reference internal" href="#paddleclasspaddle_1_1Semaphore_1a3d7d3699ad8f49ad8bbad260a174c28d"><span class="std std-ref">wait()</span></a>. </p>
</dd></dl>
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle9Semaphore4sem_E">
<span id="paddle::Semaphore::sem___sem_t"></span><span class="target" id="paddleclasspaddle_1_1Semaphore_1ab66cee48c4a02d13b4ef56cf2538ee42"></span>sem_t <code class="descname">sem_</code><a class="headerlink" href="#_CPPv2N6paddle9Semaphore4sem_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
</dd></dl>
......@@ -307,9 +296,13 @@ var _hmt = _hmt || [];
<dl class="class">
<dt id="_CPPv2N6paddle13ThreadBarrierE">
<span id="paddle::ThreadBarrier"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ThreadBarrier</code><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrierE" title="Permalink to this definition"></a></dt>
<dd><p>A simple wrapper of thread barrier. The <a class="reference internal" href="#paddleclasspaddle_1_1ThreadBarrier"><span class="std std-ref">ThreadBarrier</span></a> disable copy. </p>
<div class="breathe-sectiondef container">
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13ThreadBarrier12DISABLE_COPYE13ThreadBarrier">
<span id="paddle::ThreadBarrier::DISABLE_COPY__ThreadBarrier"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier_1ace6a9d5cf27b395ce3c478b3cbfd1f17"></span><code class="descname">DISABLE_COPY</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle13ThreadBarrierE" title="paddle::ThreadBarrier">ThreadBarrier</a><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrier12DISABLE_COPYE13ThreadBarrier" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle13ThreadBarrier13ThreadBarrierEi">
<span id="paddle::ThreadBarrier::ThreadBarrier__i"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier_1a2b4ee1af9857ce417455d6a343a1a117"></span><code class="descname">ThreadBarrier</code><span class="sig-paren">(</span>int <em>count</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrier13ThreadBarrierEi" title="Permalink to this definition"></a></dt>
......@@ -321,30 +314,12 @@ var _hmt = _hmt || [];
<span id="paddle::ThreadBarrier::~ThreadBarrier"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier_1a0922960555e03da24426cf8fdd0b15dd"></span><code class="descname">~ThreadBarrier</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrierD0Ev" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle13ThreadBarrier13ThreadBarrierERK13ThreadBarrier">
<span id="paddle::ThreadBarrier::ThreadBarrier__ThreadBarrierCR"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier_1a42b7d18074508549f5e53156d8791fd8"></span><code class="descname">ThreadBarrier</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle13ThreadBarrier13ThreadBarrierEi" title="paddle::ThreadBarrier::ThreadBarrier">ThreadBarrier</a>&amp;<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrier13ThreadBarrierERK13ThreadBarrier" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle13ThreadBarrieraSERK13ThreadBarrier">
<span id="paddle::ThreadBarrier::assign-operator__ThreadBarrierCR"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier_1a84b0ef2c24d0ee7770fa453d385f5bdf"></span><a class="reference internal" href="#_CPPv2N6paddle13ThreadBarrierE" title="paddle::ThreadBarrier">ThreadBarrier</a> &amp;<code class="descname">operator=</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle13ThreadBarrierE" title="paddle::ThreadBarrier">ThreadBarrier</a>&amp;<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrieraSERK13ThreadBarrier" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="_CPPv2N6paddle13ThreadBarrier4waitEv">
<span id="paddle::ThreadBarrier::wait"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier_1af63f9491d2644a258350e12120fedf89"></span>void <code class="descname">wait</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrier4waitEv" title="Permalink to this definition"></a></dt>
<dd><p>If there were count - 1 threads waiting before, then wake up all the count - 1 threads and continue run together. Else block the thread until waked by other thread . </p>
</dd></dl>
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle13ThreadBarrier8barrier_E">
<span id="paddle::ThreadBarrier::barrier___pthread_barrier_t"></span><span class="target" id="paddleclasspaddle_1_1ThreadBarrier_1ae29548e35c5a20906647e8dcc48f9f39"></span>pthread_barrier_t <code class="descname">barrier_</code><a class="headerlink" href="#_CPPv2N6paddle13ThreadBarrier8barrier_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
</dd></dl>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册