This repository was archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[MXNET-1225] Always use config.mk in make install instructions #13364
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2f2f24e
Always use config.mk in make install instructions
zachgk d2970bb
Specify Cuda 0 for ubuntu with mkldnn
zachgk a332c3c
Scala install doc avoid build_from_source
zachgk f050321
Fix build_from_source CMake usage
zachgk e5ffd32
CPP Install Instruction with CMake
zachgk 1923114
Use cmake out of source build
zachgk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
|
|
||
| This document explains how to build MXNet from source code. | ||
|
|
||
| **For Java/Scala/Clojure, please follow [this guide instead](./scala_setup.md)** | ||
|
|
||
| ## Overview | ||
|
|
||
|
|
@@ -27,14 +28,14 @@ MXNet's newest and most popular API is Gluon. Gluon is built into the Python bin | |
| - [Python (includes Gluon)](../api/python/index.html) | ||
| - [C++](../api/c++/index.html) | ||
| - [Clojure](../api/clojure/index.html) | ||
| - Java (coming soon) | ||
| - [Julia](../api/julia/index.html) | ||
| - [Perl](../api/perl/index.html) | ||
| - [R](../api/r/index.html) | ||
| - [Scala](../api/scala/index.html) | ||
| - [Java](../api/java/index.html) | ||
|
|
||
| <hr> | ||
|
|
||
| ## Build Instructions by Operating System | ||
|
|
||
| Detailed instructions are provided per operating system. Each of these guides also covers how to install the specific [Language Bindings](#installing-mxnet-language-bindings) you require. | ||
|
|
@@ -160,7 +161,7 @@ More information on turning these features on or off are found in the following | |
| ## Build Configurations | ||
|
|
||
| There is a configuration file for make, | ||
| [`make/config.mk`](https://github.com/apache/incubator-mxnet/blob/master/make/config.mk), that contains all the compilation options. You can edit it and then run `make` or `cmake`. `cmake` is recommended for building MXNet (and is required to build with MKLDNN), however you may use `make` instead. | ||
| [`make/config.mk`](https://github.com/apache/incubator-mxnet/blob/master/make/config.mk), that contains all the compilation options. You can edit it and then run `make` or `cmake`. `cmake` is recommended for building MXNet (and is required to build with MKLDNN), however you may use `make` instead. For building with Java/Scala/Clojure, only `make` is supported. | ||
|
|
||
| <hr> | ||
|
|
||
|
|
@@ -203,68 +204,82 @@ It is recommended to set environment variable NCCL_LAUNCH_MODE to PARALLEL when | |
|
|
||
| ### Build MXNet with C++ | ||
|
|
||
| * To enable C++ package, just add `USE_CPP_PACKAGE=1` when you run `make` or `cmake`. | ||
| * To enable C++ package, just add `USE_CPP_PACKAGE=1` when you run `make` or `cmake` (see examples). | ||
|
|
||
| <hr> | ||
|
|
||
| ### Usage Examples | ||
|
|
||
| * `-j` runs multiple jobs against multi-core CPUs. | ||
|
|
||
| For example, you can specify using all cores on Linux as follows: | ||
|
|
||
| ```bash | ||
| cmake -j$(nproc) | ||
| mkdir build && cd build | ||
| cmake -GNinja . | ||
| ninja -v | ||
| ``` | ||
|
|
||
|
|
||
| #### 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 | ||
| mkdir build && cd build | ||
| cmake -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -DUSE_MKLDNN=1 -GNinja . | ||
| ninja -v | ||
| ``` | ||
|
|
||
| #### 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 | ||
| mkdir build && cd build | ||
| cmake -DBLAS=open -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -GNinja . | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a build system (https://ninja-build.org/). I believe CMake generates the ninja configuration files and then ninja performs the actual build. |
||
| ninja -v | ||
| ``` | ||
|
|
||
| #### 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 | ||
| mkdir build && cd build | ||
| cmake -DUSE_CUDA=0 -DUSE_MKLDNN=1 -GNinja . | ||
| ninja -v | ||
| ``` | ||
|
|
||
| #### 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 | ||
| mkdir build && cd build | ||
| cmake -DUSE_CUDA=0 -DBLAS=open -GNinja . | ||
| ninja -v | ||
| ``` | ||
|
|
||
| #### Other Examples | ||
|
|
||
| * Build without using OpenCV: | ||
|
|
||
| ```bash | ||
| cmake USE_OPENCV=0 | ||
| mkdir build && cd build | ||
| cmake -DUSE_OPENCV=0 -GNinja . | ||
| ninja -v | ||
| ``` | ||
|
|
||
| * 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 | ||
| mkdir build && cd build | ||
| cmake -DBLAS=apple -DUSE_OPENCV=0 -DUSE_OPENMP=0 -GNinja . | ||
| ninja -v | ||
| ``` | ||
|
|
||
| * 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 | ||
| mkdir build && cd build | ||
| cmake -DBLAS=apple -DUSE_OPENMP=1 -GNinja . | ||
| ninja -v | ||
| ``` | ||
|
|
||
| <hr> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.