Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ ifneq ($(ADD_LDFLAGS), NONE)
LDFLAGS += $(ADD_LDFLAGS)
endif

ifneq ($(USE_CUDA_PATH), NONE)
NVCC=$(USE_CUDA_PATH)/bin/nvcc
endif

.PHONY: clean all test lint doc clean_all

all: lib/libmxnet.a lib/libmxnet.so $(BIN)
Expand Down Expand Up @@ -105,7 +109,7 @@ lib/libmxnet.so: $(ALL_DEP)
$(DMLC_CORE)/libdmlc.a:
+ cd $(DMLC_CORE); make libdmlc.a config=$(ROOTDIR)/$(config); cd $(ROOTDIR)

bin/im2rec: tools/im2rec.cc $(DMLC_CORE)/libdmlc.a
bin/im2rec: tools/im2rec.cc $(DMLC_CORE)/libdmlc.a

$(BIN) :
$(CXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.a %.cc, $^) $(LDFLAGS)
Expand Down
59 changes: 49 additions & 10 deletions doc/build.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,58 @@
Build and Installation
======================
- You can clone the mxnet from the [github repo](https://github.com/dmlc/mxnet)
- After you clone the repo, update the submodules by

Minimal system requirement:

- recent c++ compiler supporting C++ 11 such as `g++ >= 4.8`
- git
- BLAS library.
- opencv

On Ubuntu >= 13.10, one can install them by

```bash
sudo apt-get update
sudo apt-get install -y build-essential git libblas-dev libopencv-dev
```

Then build mxnet

```bash
git clone --recursive https://github.com/dmlc/mxnet
cd mxnet; make -j4
```

To install the python package, first make sure `python >= 2.7` and `numpy >= ?` are installed, then

```bash
git submodule init
cd python; python setup.py install
```

If anything goes well, now we can train a multilayer perceptron on the hand
digit recognition dataset.

```bash
cd ..; python tests/python/train/test_mlp.py
```

Advanced Build
--------------

- update the repo:

```bash
git pull
git submodule update
```
- Copy [make/config.mk](../make/config.mk) to the project root, modify according to your desired setting.
- Type ```make``` in the root folder.

- install python package in developing model,

Install Python Package
----------------------
After you build the mxnet, you can install python package by
```bash
cd python
python setup.py install
cd python; python setup.py develop --user
```

- modify the compiling options such as compilers, CUDA, CUDNN, Intel MKL,
various distributed filesystem such as HDFS/Amazon S3/...

First copy [make/config.mk](../make/config.mk) to the project root, then
modify the according flags.
2 changes: 1 addition & 1 deletion doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ How to Get Started

User Guide
----------
* [Python Package Document](python/index.md)
* [Build and Installation](build.md)
* [Python Package Document](python/index.md)
* [Frequently Asked Questions](faq.md)

Developer Guide
Expand Down
53 changes: 30 additions & 23 deletions make/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,33 @@
# - type make or make -j n for parallel build
#----------------------------------------------------

#------------------------
# choice of compiler
#------------------------

export CC = gcc
export CXX = g++
export NVCC = nvcc

# whether compile with debug
DEBUG = 0

# the additional link flags you want to add
ADD_LDFLAGS =

# the additional compile flags you want to add
ADD_CFLAGS =

#---------------------------------------------
# matrix computation libraries for CPU/GPU
#---------------------------------------------

# whether use CUDA during compile
USE_CUDA = 0

# add the path to CUDA libary to link and compile flag
# if you have already add them to enviroment variable, leave it as NONE
# USE_CUDA_PATH = /usr/local/cuda
USE_CUDA_PATH = NONE

# whether use CUDNN R3 library
Expand All @@ -39,39 +53,32 @@ USE_OPENCV = 1
# use openmp for parallelization
USE_OPENMP = 1

#
# choose the version of blas you want to use
# can be: mkl, blas, atlas, openblas
USE_STATIC_MKL = NONE
USE_BLAS = blas
#
# add path to intel libary, you may need it
# for MKL, if you did not add the path to enviroment variable
#
USE_INTEL_PATH = NONE

# the additional link flags you want to add
ADD_LDFLAGS =
# add path to intel libary, you may need it for MKL, if you did not add the path
# to enviroment variable
USE_INTEL_PATH = NONE

# the additional compile flags you want to add
ADD_CFLAGS =
#
# If use MKL, choose static link automaticly to fix python wrapper
#
# If use MKL, choose static link automaticly to allow python wrapper
ifeq ($(USE_BLAS), mkl)
USE_STATIC_MKL = 1
endif

#------------------------
# configuration for DMLC
#------------------------
# whether use HDFS support during compile
# this will allow cxxnet to directly save/load model from hdfs
USE_HDFS = 0
#----------------------------
# distributed filesystems
#----------------------------

# whether use AWS S3 support during compile
# this will allow cxxnet to directly save/load model from s3
USE_S3 = 1
# whether or not allow to read and write HDFS directly. If yes, then hadoop is
# required
USE_HDFS = 0

# path to libjvm.so
# path to libjvm.so. required if USE_HDFS=1
LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server

# whether or not allow to read and write AWS S3 directly. If yes, then
# libcurl4-openssl-dev is required, it can be installed on Ubuntu by
# sudo apt-get install -y libcurl4-openssl-dev
USE_S3 = 0