|
1 |
| -Build and Installation |
2 |
| -====================== |
| 1 | +Installation Guide |
| 2 | +================== |
| 3 | +This page gives the detail of how to install mxnet packages on various systems. |
| 4 | +We tried to listed the detailed, but if the information on this page does not work for you. |
| 5 | +Please ask questions at [mxnet/issues](https://github.com/dmlc/mxnet/issues), better still |
| 6 | +if you have ideas to improve this page, please send a pull request! |
| 7 | + |
| 8 | +Contents |
| 9 | +-------- |
| 10 | +- [Build MXNet Library](#build-mxnet-library) |
| 11 | + - Introduces how to build the mxnet core library for all packages. |
| 12 | + - Supported platforms: linux, windows, osx |
| 13 | +- [Advanced Build Configurations](#advanced-build-configuration) |
| 14 | + - Introduces how to build mxnet with advanced features such as HDFS/S3 support, CUDNN |
| 15 | +- [Python Package Installation](#python-package-installation) |
| 16 | +- [R Package Installation](#r-package-installation) |
| 17 | + |
| 18 | +Build MXNet Library |
| 19 | +------------------- |
| 20 | +MXNet have a general runtime library that can be used by various packages such as python, R and Julia. |
| 21 | +This section gives details about how to build the mxnet library. |
| 22 | +- On Linux/OSX the target library will be ```libmxnet.so``` |
| 23 | +- On Windows the target libary is ```mxnet.dll``` |
| 24 | + |
| 25 | +Things to do before get started: |
| 26 | + |
| 27 | +- Clone the project from github |
| 28 | +```bash |
| 29 | +git clone --recursive https://github.com/dmlc/mxnet |
| 30 | +``` |
3 | 31 |
|
4 |
| -Minimal system requirement: |
| 32 | +The system dependency requirement for mxnet libraries are |
5 | 33 |
|
6 |
| -- recent c++ compiler supporting C++ 11 such as `g++ >= 4.8` |
| 34 | +- Recent c++ compiler supporting C++ 11 such as `g++ >= 4.8` |
7 | 35 | - git
|
8 | 36 | - BLAS library.
|
9 |
| -- opencv |
| 37 | +- opencv (optional if you do not need image augmentation, you can switch it off in config.mk) |
10 | 38 |
|
11 |
| -On Ubuntu >= 13.10, one can install them by |
| 39 | +### Linux |
| 40 | + |
| 41 | +On Ubuntu >= 13.10, one can install the dependencies by |
12 | 42 |
|
13 | 43 | ```bash
|
14 | 44 | sudo apt-get update
|
15 | 45 | sudo apt-get install -y build-essential git libblas-dev libopencv-dev
|
16 | 46 | ```
|
17 | 47 |
|
18 |
| -Then build mxnet |
19 |
| - |
| 48 | +Then build mxnet on the project root |
20 | 49 | ```bash
|
21 |
| -git clone --recursive https://github.com/dmlc/mxnet |
22 |
| -cd mxnet; make -j4 |
| 50 | +make -j4 |
23 | 51 | ```
|
| 52 | +Then proceed to package installation instructions for python or R in this page. |
24 | 53 |
|
25 |
| -To install the python package, first make sure `python >= 2.7` and `numpy >= ?` are installed, then |
| 54 | +### OSX |
| 55 | +On OSX, we can install the dependencies by |
26 | 56 |
|
27 | 57 | ```bash
|
28 |
| -cd python; python setup.py install |
| 58 | +brew update |
| 59 | +brew tap homebrew/science |
| 60 | +brew info opencv |
| 61 | +brew install opencv |
29 | 62 | ```
|
30 | 63 |
|
31 |
| -If anything goes well, now we can train a multilayer perceptron on the hand |
32 |
| -digit recognition dataset. |
| 64 | +- Copy ```make/osx.mk``` to project root ```config.mk```. |
| 65 | +```bash |
| 66 | +cp make/osx.mk config.mk |
| 67 | +``` |
33 | 68 |
|
| 69 | +Then build mxnet on the project root |
34 | 70 | ```bash
|
35 |
| -cd ..; python example/mnist/mlp.py |
| 71 | +make -j4 |
36 | 72 | ```
|
37 | 73 |
|
38 |
| -Advanced Build |
39 |
| --------------- |
| 74 | +Then proceed to package installation instructions for python or R in this page. |
40 | 75 |
|
41 |
| -- update the repo: |
| 76 | +### Windows |
42 | 77 |
|
43 |
| -```bash |
44 |
| -git pull |
45 |
| -git submodule update |
46 |
| -``` |
| 78 | +Firstly, we should make your Visual Studio 2013 support more C++11 features. |
47 | 79 |
|
48 |
| -- install python package in developing model, |
| 80 | + - Download and install [Visual C++ Compiler Nov 2013 CTP](http://www.microsoft.com/en-us/download/details.aspx?id=41151). |
| 81 | + - Copy all files in `C:\Program Files (x86)\Microsoft Visual C++ Compiler Nov 2013 CTP` (or the folder where you extracted the zip archive) to `C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC` and overwrite all existed files. Don't forget to backup the original files before copying. |
49 | 82 |
|
50 |
| -```bash |
51 |
| -cd python; python setup.py develop --user |
52 |
| -``` |
| 83 | +Secondly, fetch the third-party libraries, including [OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download), [CuDNN](https://developer.nvidia.com/cudnn) and [OpenBlas](http://sourceforge.net/projects/openblas/files/v0.2.14/)(ignore this if you have MKL). |
| 84 | + |
| 85 | + - NOTICE: You need to register as a NVIDIA community user to get the download link of CuDNN. |
| 86 | + |
| 87 | +Finally, use CMake to create a Visual Studio solution in `./build/`. During configuration, you may need to set the path of each third-party library, until no error is reported. Open the solution and compile, you will get a `mxnet.dll` in `./build/Release` or `./build/Debug`. |
53 | 88 |
|
| 89 | +Then proceed to package installation instructions for python or R in this page. |
| 90 | + |
| 91 | +Advanced Build Configurations |
| 92 | +----------------------------- |
| 93 | +The configuration of mxnet can be modified by ```config.mk``` |
54 | 94 | - modify the compiling options such as compilers, CUDA, CUDNN, Intel MKL,
|
55 | 95 | various distributed filesystem such as HDFS/Amazon S3/...
|
56 |
| - |
57 |
| - First copy [make/config.mk](../make/config.mk) to the project root, then |
| 96 | +- First copy [make/config.mk](../make/config.mk) to the project root, then |
58 | 97 | modify the according flags.
|
59 | 98 |
|
60 |
| -Build in Visual Studio 2013 |
| 99 | +Python Package Installation |
61 | 100 | ---------------------------
|
| 101 | +To install the python package. First finish the [Build MXNet Library](#build-mxnet-library) step. |
| 102 | +Then use the following command to install mxnet. |
62 | 103 |
|
63 |
| -Firstly, we should make your Visual Studio 2013 support more C++11 features. |
| 104 | +```bash |
| 105 | +cd python; python setup.py install |
| 106 | +``` |
64 | 107 |
|
65 |
| - - Download and install [Visual C++ Compiler Nov 2013 CTP](http://www.microsoft.com/en-us/download/details.aspx?id=41151). |
66 |
| - - Copy all files in `C:\Program Files (x86)\Microsoft Visual C++ Compiler Nov 2013 CTP` (or the folder where you extracted the zip archive) to `C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC` and overwrite all existed files. Don't forget to backup the original files before copying. |
| 108 | +If anything goes well, now we can train a multilayer perceptron on the hand |
| 109 | +digit recognition dataset. |
67 | 110 |
|
68 |
| -Secondly, fetch the third-party libraries, including [OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download), [CuDNN](https://developer.nvidia.com/cudnn) and [OpenBlas](http://sourceforge.net/projects/openblas/files/v0.2.14/)(ignore this if you have MKL). |
| 111 | +```bash |
| 112 | +cd ..; python example/mnist/mlp.py |
| 113 | +``` |
69 | 114 |
|
70 |
| - - NOTICE: You need to register as a NVIDIA community user to get the download link of CuDNN. |
| 115 | +YOu can also install python to your user directory instead of root. |
71 | 116 |
|
72 |
| -Finally, use CMake to create a Visual Studio solution in `./build/`. During configuration, you may need to set the path of each third-party library, until no error is reported. Open the solution and compile, you will get a `mxnet.dll` in `./build/Release` or `./build/Debug`. |
| 117 | +```bash |
| 118 | +cd python; python setup.py develop --user |
| 119 | +``` |
| 120 | + |
| 121 | +R Package Installation |
| 122 | +---------------------- |
| 123 | +To install the python package. First finish the [Build MXNet Library](#build-mxnet-library) step. |
| 124 | +Then use the following command to install mxnet at root folder |
| 125 | + |
| 126 | +```bash |
| 127 | +R CMD INSTALL R-Package |
| 128 | +``` |
| 129 | + |
| 130 | +Hopefully, we will now have mxnet on R! |
73 | 131 |
|
74 |
| -The following steps are the same with Linux. |
| 132 | +## Note on Library Build |
| 133 | +We isolate the library build with Rcpp end to maximize the portability |
| 134 | + - MSVC is needed on windows to build the mxnet library, because of CUDA compatiblity issue of toolchains. |
0 commit comments