# Building mxnet from source
1. git clone **recursively** from github
git clone --recursive https://github.com/apache/incubator-mxnet mxnet
2. use cmake
1. **Don't use JEMALLOC**, it screwes you, USE_JEMALLOC=0
2. First **don't use CPP_PACKAGE**, because OpWrapperGenerator.py needs libmxnet.so first and then OpWrapperGenerator.py will use it afterwards
cmake -DUSE_JEMALLOC=0 -DUSE_CPP_PACKAGE=0 ..
make -j4
3. Then we can **use CPP_PACKAGE** to compile for c++ package support
cmake -DUSE_JEMALLOC=0 -DUSE_CPP_PACKAGE=1 ..
make -j4