Skip to content

Commit 2e1d968

Browse files
authored
Remove Mac OS X build docs (#386)
Currently, Paddle on Mac OS X is not deliberate testing through the different versions of Mac OS X and Clang. When all these things that we've done, we will reopen Mac build docs.
1 parent 4905751 commit 2e1d968

File tree

1 file changed

+0
-119
lines changed

1 file changed

+0
-119
lines changed

doc/build/build_from_source.md

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Installing from Sources
44
* [1. Download and Setup](#download)
55
* [2. Requirements](#requirements)
66
* [3. Build on Ubuntu](#ubuntu)
7-
* [4. Build on Mac OS X](#mac)
87

98
## <span id="download">Download and Setup</span>
109
You can download PaddlePaddle from the [github source](https://github.com/gangliao/Paddle).
@@ -191,121 +190,3 @@ sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
191190
# or just run
192191
sudo paddle version
193192
```
194-
195-
## <span id="mac">Building on Mac OS X</span>
196-
197-
### Prerequisites
198-
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,
199-
you will already have Python 2.7.10 and Numpy 1.8 installed.
200-
201-
The best option is to use the package manager homebrew to handle installations and upgrades for you.
202-
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:
203-
204-
```bash
205-
# install brew
206-
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
207-
# install pip
208-
easy_install pip
209-
```
210-
211-
### Install Dependencies
212-
213-
- **CPU Dependencies**
214-
215-
```bash
216-
# Install fundamental dependents
217-
brew install glog gflags cmake protobuf openblas
218-
219-
# Install google test on Mac OS X
220-
# Download gtest 1.7.0
221-
wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz
222-
tar -xzf googletest-release-1.7.0.tar.gz && cd googletest-release-1.7.0
223-
# Build gtest
224-
mkdir build && cd build && cmake .. && make
225-
# Install gtest library
226-
sudo cp -r ../include/gtest /usr/local/include/
227-
sudo cp lib*.a /usr/local/lib
228-
```
229-
230-
- **GPU Dependencies(optional)**
231-
232-
To build GPU version, you will need the following installed:
233-
234-
1. a CUDA-capable GPU
235-
2. Mac OS X 10.11 or later
236-
2. the Clang compiler and toolchain installed using Xcode
237-
3. NVIDIA CUDA Toolkit (available at http://developer.nvidia.com/cuda-downloads)
238-
4. NVIDIA cuDNN Library (availabel at https://developer.nvidia.com/cudnn)
239-
240-
The CUDA development environment relies on tight integration with the host development environment,
241-
including the host compiler and C runtime libraries, and is therefore only supported on
242-
distribution versions that have been qualified for this CUDA Toolkit release.
243-
244-
1. After downloading cuDNN library, issue the following commands:
245-
246-
```bash
247-
sudo tar -xzf cudnn-7.5-osx-x64-v5.0-ga.tgz -C /usr/local
248-
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib/libcudnn*
249-
```
250-
2. Then you need to set DYLD\_LIBRARY\_PATH, PATH environment variables in ~/.bashrc.
251-
252-
```bash
253-
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
254-
export PATH=/usr/local/cuda/bin:$PATH
255-
```
256-
257-
### Build and Install
258-
259-
As usual, the best option is to create build folder under paddle project directory.
260-
261-
```bash
262-
mkdir build && cd build
263-
cmake ..
264-
```
265-
266-
CMake first check PaddlePaddle's dependencies in system default path. After installing some optional
267-
libraries, corresponding build option will be set automatically (for instance, glog, gtest and gflags).
268-
If still not found, you can manually set it based on CMake error information from your screen.
269-
270-
As a simple example, consider the following:
271-
272-
- **Only CPU**
273-
274-
```bash
275-
cmake .. -DWITH_GPU=OFF
276-
```
277-
- **GPU**
278-
279-
```bash
280-
cmake .. -DWITH_GPU=ON
281-
```
282-
283-
- **GPU with doc and swig**
284-
285-
```bash
286-
cmake .. -DWITH_GPU=ON -DWITH_DOC=ON -DWITH_SWIG_PY=ON
287-
```
288-
289-
Finally, you can build PaddlePaddle:
290-
291-
```bash
292-
# you can add build option here, such as:
293-
cmake .. -DWITH_GPU=ON -DCMAKE_INSTALL_PREFIX=<installation path>
294-
# please use sudo make install, if you want to install PaddlePaddle into the system
295-
make -j `sysctl -n hw.ncpu` && make install
296-
# set PaddlePaddle installation path in ~/.bashrc
297-
export PATH=<installation path>/bin:$PATH
298-
```
299-
**Note:**
300-
301-
If you set `WITH_SWIG_PY=ON`, related python dependencies also need to be installed.
302-
Otherwise, PaddlePaddle will automatically install python dependencies
303-
at first time when user run paddle commands, such as `paddle version`, `paddle train`.
304-
It may require sudo privileges:
305-
306-
```bash
307-
# you can run
308-
sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
309-
# or just run
310-
sudo paddle version
311-
```

0 commit comments

Comments
 (0)