Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-1225] Always use config.mk in make install instructions #13364

Merged
merged 6 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
38 changes: 30 additions & 8 deletions docs/install/build_from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,57 +214,79 @@ It is recommended to set environment variable NCCL_LAUNCH_MODE to PARALLEL when
For example, you can specify using all cores on Linux as follows:

```bash
cmake -j$(nproc)
cmake -j $(nproc) .
```


#### Recommended for Systems with NVIDIA GPUs and Intel CPUs
* Build MXNet with `cmake` and install with MKL DNN, GPU, and OpenCV support:

```bash
cmake -j USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 USE_MKLDNN=1
echo "USE_OPENCV = 1" >> ./config.mk
echo "USE_CUDA = 1" >> ./config.mk
echo "USE_CUDA_PATH = /usr/local/cuda" >> ./config.mk
echo "USE_CUDNN = 1" >> ./config.mk
echo "USE_MKLDNN = 1" >> ./config.mk
cmake -j $(nproc) USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 USE_MKLDNN=1 .
zachgk marked this conversation as resolved.
Show resolved Hide resolved
```

#### Recommended for Systems with NVIDIA GPUs
* Build with both OpenBLAS, GPU, and OpenCV support:

```bash
cmake -j BLAS=open USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1
echo "USE_BLAS = openblas" >> ./config.mk
echo "USE_OPENCV = 1" >> ./config.mk
echo "USE_CUDA = 1" >> ./config.mk
echo "USE_CUDA_PATH = /usr/local/cuda" >> ./config.mk
echo "USE_CUDNN = 1" >> ./config.mk
cmake -j $(nproc) BLAS=open USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 .
```

#### Recommended for Systems with Intel CPUs
* Build MXNet with `cmake` and install with MKL DNN, and OpenCV support:

```bash
cmake -j USE_CUDA=0 USE_MKLDNN=1
echo "USE_CUDA = 0" >> ./config.mk
echo "USE_OPENCV = 1" >> ./config.mk
echo "USE_MKLDNN = 1" >> ./config.mk
cmake -j $(nproc) USE_CUDA=0 USE_MKLDNN=1 .
```

#### Recommended for Systems with non-Intel CPUs
* Build MXNet with `cmake` and install with OpenBLAS and OpenCV support:

```bash
cmake -j USE_CUDA=0 BLAS=open
echo "USE_BLAS = openblas" >> ./config.mk
echo "USE_OPENCV = 1" >> ./config.mk
echo "USE_CUDA = 0" >> ./config.mk
cmake -j $(nproc) USE_CUDA=0 BLAS=open .
```

#### Other Examples

* Build without using OpenCV:

```bash
cmake USE_OPENCV=0
echo "USE_OPENCV = 0" >> ./config.mk
cmake -j $(nproc) USE_OPENCV=0 .
```

* Build on **macOS** with the default BLAS library (Apple Accelerate) and Clang installed with `xcode` (OPENMP is disabled because it is not supported by the Apple version of Clang):

```bash
cmake -j BLAS=apple USE_OPENCV=0 USE_OPENMP=0
echo "USE_BLAS = openblas" >> ./config.mk
echo "USE_OPENCV = 0" >> ./config.mk
echo "USE_OPENMP = 0" >> ./config.mk
cmake -j $(sysctl -n hw.ncpu) BLAS=apple USE_OPENCV=0 USE_OPENMP=0 .
```

* To use OpenMP on **macOS** you need to install the Clang compiler, `llvm` (the one provided by Apple does not support OpenMP):

```bash
brew install llvm
cmake -j BLAS=apple USE_OPENMP=1
echo "USE_BLAS = openblas" >> ./config.mk
echo "USE_OPENMP = 1" >> ./config.mk
cmake -j $(sysctl -n hw.ncpu) BLAS=apple USE_OPENMP=1 .
```

<hr>
Expand Down
6 changes: 5 additions & 1 deletion docs/install/c_plus_plus.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ To enable C++ package, just add `USE_CPP_PACKAGE=1` in the [build from source](b
For example to build MXNet with GPU support and the C++ package, OpenCV, and OpenBLAS, from the project root you would run:

```bash
make -j USE_CPP_PACKAGE=1 USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1
echo "USE_CPP_PACKAGE=1" >> ./config.mk
echo "USE_OPENCV=1" >> ./config.mk
echo "USE_BLAS=openblas" >> ./config.mk
echo "USE_CUDA=1" >> ./config.mk
make -j $(nproc)
zachgk marked this conversation as resolved.
Show resolved Hide resolved
```

You may also want to add the MXNet shared library to your `LD_LIBRARY_PATH`:
Expand Down
9 changes: 8 additions & 1 deletion docs/install/osx_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ The file called ```osx.mk``` has the configuration required for building MXNet o
To build with MKLDNN

```bash
LIBRARY_PATH=$(brew --prefix llvm)/lib/ make -j $(sysctl -n hw.ncpu) CC=$(brew --prefix llvm)/bin/clang++ CXX=$(brew --prefix llvm)/bin/clang++ USE_OPENCV=1 USE_OPENMP=1 USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
echo "CC=$(brew --prefix llvm)/bin/clang++" >> ./config.mk
echo "CXX=$(brew --prefix llvm)/bin/clang++" >> ./config.mk
echo "USE_OPENCV=1" >> ./config.mk
echo "USE_OPENMP=1" >> ./config.mk
echo "USE_MKLDNN=1" >> ./config.mk
echo "USE_BLAS=apple" >> ./config.mk
echo "USE_PROFILER=1" >> ./config.mk
LIBRARY_PATH=$(brew --prefix llvm)/lib/ make -j $(sysctl -n hw.ncpu)
```

If building with ```GPU``` support, add the following configuration to config.mk and build:
Expand Down
21 changes: 17 additions & 4 deletions docs/install/ubuntu_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,34 @@ If building on CPU and using OpenBLAS:
```bash
git clone --recursive /~https://github.com/apache/incubator-mxnet.git
cd incubator-mxnet
make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas
echo "USE_OPENCV = 1" >> ./config.mk
echo "USE_BLAS = openblas" >> ./config.mk
make -j $(nproc)
zachgk marked this conversation as resolved.
Show resolved Hide resolved
```

If building on CPU and using MKL and MKL-DNN (make sure MKL is installed according to [Math Library Selection](build_from_source.html#math-library-selection) and [MKL-DNN README](/~https://github.com/apache/incubator-mxnet/blob/master/MKLDNN_README.md)):

```bash
git clone --recursive /~https://github.com/apache/incubator-mxnet.git
cd incubator-mxnet
make -j $(nproc) USE_OPENCV=1 USE_BLAS=mkl USE_MKLDNN=1
echo "USE_OPENCV = 1" >> ./config.mk
echo "USE_BLAS = openblas" >> ./config.mk
echo "USE_CUDA = 0" >> ./config.mk
echo "USE_MKLDNN = 1" >> ./config.mk
make -j $(nproc)
```

If building on GPU and you want OpenCV and OpenBLAS (make sure you have installed the [CUDA dependencies first](#cuda-dependencies)):

```bash
git clone --recursive /~https://github.com/apache/incubator-mxnet.git
cd incubator-mxnet
make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1
echo "USE_OPENCV = 1" >> ./config.mk
echo "USE_BLAS = openblas" >> ./config.mk
echo "USE_CUDA = 1" >> ./config.mk
echo "USE_CUDA_PATH = /usr/local/cuda" >> ./config.mk
echo "USE_CUDNN = 1" >> ./config.mk
make -j $(nproc)
```

*Note* - USE_OPENCV and USE_BLAS are make file flags to set compilation options to use OpenCV and BLAS library. You can explore and use more compilation options in `make/config.mk` and also review common [usage examples](build_from_source.html#usage-examples).
Expand Down Expand Up @@ -351,7 +362,9 @@ $ sudo apt-get install -y libopencv-dev
```bash
$ git clone --recursive /~https://github.com/apache/incubator-mxnet
$ cd incubator-mxnet
$ make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas
$ echo "USE_OPENCV = 1" >> ./config.mk
$ echo "USE_BLAS = openblas" >> ./config.mk
$ make -j $(nproc)
```

*Note* - USE_OPENCV and USE_BLAS are make file flags to set compilation options to use OpenCV and BLAS library. You can explore and use more compilation options in `make/config.mk`.
Expand Down