Skip to content

Commit ced5486

Browse files
committed
[DOC] Detail build info
1 parent 55948a7 commit ced5486

File tree

5 files changed

+206
-55
lines changed

5 files changed

+206
-55
lines changed

R-package/README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
MXNet R-Package
22
===============
3-
The MXNet R packages brings flexible and efficient GPU computing and deep learning to R.
3+
4+
You have find MXNet R Package! The MXNet R packages brings flexible and efficient GPU
5+
computing and state-of-art deep learning to R.
46

57
- It enables you to write seamless tensor/matrix computation with multiple GPUs in R.
68
- It also enables you construct and customize the state-of-art deep learning models in R,
79
and apply them to tasks such as image classification and data science challenges.
810

9-
Document
10-
--------
11+
Sounds exciting? This page contains links to all the related documents on R package.
12+
13+
Resources
14+
---------
1115
* [MXNet R Package Document](http://mxnet.readthedocs.org/en/latest/R-package/index.html)
12-
- This is a online hosted documents for mxnet examples etc.
16+
- Check this out for detailed documents, examples, installation guides.
17+
1318

1419
Installation
1520
------------
16-
- First build ```../lib/libmxnet.so``` by following [Build Instruction](../doc/build.md)
17-
- Type ```R CMD INSTALL R-package``` in the root folder.
21+
Follow [Installation Guide](http://mxnet.readthedocs.org/en/latest/build.html)
22+
1823

doc/R-package/index.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
MXNet R Package
22
===============
3-
This page contains links to all the python related documents on R package.
4-
The MXNet R packages brings flexible and efficient GPU computing and deep learning to R.
3+
You have find MXNet R Package! The MXNet R packages brings flexible and efficient GPU
4+
computing and state-of-art deep learning to R.
55

66
- It enables you to write seamless tensor/matrix computation with multiple GPUs in R.
77
- It also enables you construct and customize the state-of-art deep learning models in R,
88
and apply them to tasks such as image classification and data science challenges.
99

10+
Sounds exciting? This page contains links to all the related documents on R package.
11+
12+
Get Started
13+
-----------
14+
There are several information to get you started
15+
* [Installation Guide](../build.md) contains instructions to install mxnet.
16+
* [Tutorials](#tutorials) contains various examples how how mxnet can be applied to different cool tasks :)
17+
* [Contributor Guide](http://mxnet.readthedocs.org/en/latest/contribute.html#r-package)
18+
- The R package section gives various guidelines on how to contribute code, tutorial, rmarkdown examples to mxnet.
19+
- Your contribution is always welcomed!
20+
1021
Tutorials
1122
---------
1223
* [Classify Realworld Images with Pretrained Model](classifyRealImageWithPretrainedModel.md)
1324
* [Handwritten Digits Classification Competition](mnistCompetition.md)
1425
* [Tutorial on NDArray and Symbol](ndarrayAndSymbolTutorial.md)
1526

16-
Installation
17-
------------
18-
- First build ```../lib/libmxnet.so``` by following [Build Instruction](../doc/build.md)
19-
- Type ```R CMD INSTALL R-package``` in the root folder.
20-
21-
Contributor Guide
22-
-----------------
23-
* [Contributor Guide](http://mxnet.readthedocs.org/en/latest/contribute.html#r-package) R package section gives various guidelines on how to contribute code, tutorial, rmarkdown examples to mxnet.
24-

doc/build.md

+96-36
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,134 @@
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+
```
331

4-
Minimal system requirement:
32+
The system dependency requirement for mxnet libraries are
533

6-
- recent c++ compiler supporting C++ 11 such as `g++ >= 4.8`
34+
- Recent c++ compiler supporting C++ 11 such as `g++ >= 4.8`
735
- git
836
- BLAS library.
9-
- opencv
37+
- opencv (optional if you do not need image augmentation, you can switch it off in config.mk)
1038

11-
On Ubuntu >= 13.10, one can install them by
39+
### Linux
40+
41+
On Ubuntu >= 13.10, one can install the dependencies by
1242

1343
```bash
1444
sudo apt-get update
1545
sudo apt-get install -y build-essential git libblas-dev libopencv-dev
1646
```
1747

18-
Then build mxnet
19-
48+
Then build mxnet on the project root
2049
```bash
21-
git clone --recursive https://github.com/dmlc/mxnet
22-
cd mxnet; make -j4
50+
make -j4
2351
```
52+
Then proceed to package installation instructions for python or R in this page.
2453

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
2656

2757
```bash
28-
cd python; python setup.py install
58+
brew update
59+
brew tap homebrew/science
60+
brew info opencv
61+
brew install opencv
2962
```
3063

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+
```
3368

69+
Then build mxnet on the project root
3470
```bash
35-
cd ..; python example/mnist/mlp.py
71+
make -j4
3672
```
3773

38-
Advanced Build
39-
--------------
74+
Then proceed to package installation instructions for python or R in this page.
4075

41-
- update the repo:
76+
### Windows
4277

43-
```bash
44-
git pull
45-
git submodule update
46-
```
78+
Firstly, we should make your Visual Studio 2013 support more C++11 features.
4779

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.
4982

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`.
5388

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```
5494
- modify the compiling options such as compilers, CUDA, CUDNN, Intel MKL,
5595
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
5897
modify the according flags.
5998

60-
Build in Visual Studio 2013
99+
Python Package Installation
61100
---------------------------
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.
62103

63-
Firstly, we should make your Visual Studio 2013 support more C++11 features.
104+
```bash
105+
cd python; python setup.py install
106+
```
64107

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.
67110

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+
```
69114

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.
71116

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!
73131

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.

make/osx.mk

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#-------------------------------------------------------------------------------
2+
# Template configuration for compiling mxnet
3+
#
4+
# If you want to change the configuration, please use the following
5+
# steps. Assume you are on the root directory of mxnet. First copy the this
6+
# file so that any local changes will be ignored by git
7+
#
8+
# $ cp make/config.mk .
9+
#
10+
# Next modify the according entries, and then compile by
11+
#
12+
# $ make
13+
#
14+
# or build in parallel with 8 threads
15+
#
16+
# $ make -j8
17+
#-------------------------------------------------------------------------------
18+
19+
#---------------------
20+
# choice of compiler
21+
#--------------------
22+
23+
export CC = gcc
24+
export CXX = g++
25+
export NVCC = nvcc
26+
27+
# whether compile with debug
28+
DEBUG = 0
29+
30+
# the additional link flags you want to add
31+
ADD_LDFLAGS =
32+
33+
# the additional compile flags you want to add
34+
ADD_CFLAGS =
35+
36+
#---------------------------------------------
37+
# matrix computation libraries for CPU/GPU
38+
#---------------------------------------------
39+
40+
# whether use CUDA during compile
41+
USE_CUDA = 0
42+
43+
# add the path to CUDA libary to link and compile flag
44+
# if you have already add them to enviroment variable, leave it as NONE
45+
# USE_CUDA_PATH = /usr/local/cuda
46+
USE_CUDA_PATH = NONE
47+
48+
# whether use CUDNN R3 library
49+
USE_CUDNN = 0
50+
51+
# whether use opencv during compilation
52+
# you can disable it, however, you will not able to use
53+
# imbin iterator
54+
USE_OPENCV = 1
55+
56+
# use openmp for parallelization
57+
USE_OPENMP = 0
58+
59+
# choose the version of blas you want to use
60+
# can be: mkl, blas, atlas, openblas
61+
USE_BLAS = apple
62+
63+
# add path to intel libary, you may need it for MKL, if you did not add the path
64+
# to enviroment variable
65+
USE_INTEL_PATH = NONE
66+
67+
#----------------------------
68+
# distributed computing
69+
#----------------------------
70+
71+
# whether or not to enable mullti-machine supporting
72+
USE_DIST_KVSTORE = 0
73+
74+
# whether or not allow to read and write HDFS directly. If yes, then hadoop is
75+
# required
76+
USE_HDFS = 0
77+
78+
# path to libjvm.so. required if USE_HDFS=1
79+
LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server
80+
81+
# whether or not allow to read and write AWS S3 directly. If yes, then
82+
# libcurl4-openssl-dev is required, it can be installed on Ubuntu by
83+
# sudo apt-get install -y libcurl4-openssl-dev
84+
USE_S3 = 0

python/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
version=__version__,
1919
description=open(os.path.join(CURRENT_DIR, 'README.md')).read(),
2020
install_requires=[
21-
'numpy',
22-
],
21+
'numpy',
22+
],
2323
zip_safe=False,
2424
packages=['mxnet'],
2525
data_files=[('mxnet', [LIB_PATH[0]])],

0 commit comments

Comments
 (0)