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

Add CMake flag CMAKE_BUILD_TYPE=Release #16294

Merged
merged 1 commit into from
Sep 30, 2019
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
2 changes: 1 addition & 1 deletion cmake/cmake_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ USE_SIGNAL_HANDLER: "ON" # Print stack traces on segfaults.
USE_TENSORRT: "OFF" # Enable infeference optimization with TensorRT.
USE_ASAN: "OFF" # Enable Clang/GCC ASAN sanitizers.
ENABLE_TESTCOVERAGE: "OFF" # Enable compilation with test coverage metric output
CMAKE_BUILD_TYPE: "Debug"
CMAKE_BUILD_TYPE: "Release"
CMAKE_CUDA_COMPILER_LAUNCHER: "ccache"
CMAKE_C_COMPILER_LAUNCHER: "ccache"
CMAKE_CXX_COMPILER_LAUNCHER: "ccache"
16 changes: 8 additions & 8 deletions docs/static_site/src/pages/get_started/build_from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ For example, you can specify using all cores on Linux as follows:

```bash
mkdir build && cd build
cmake -GNinja ..
cmake -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand All @@ -251,7 +251,7 @@ ninja -v

```bash
mkdir build && cd build
cmake -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -DUSE_MKLDNN=1 -GNinja ..
cmake -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -DUSE_MKLDNN=1 -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand All @@ -260,7 +260,7 @@ ninja -v

```bash
mkdir build && cd build
cmake -DBLAS=open -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -GNinja ..
cmake -DBLAS=open -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand All @@ -269,7 +269,7 @@ ninja -v

```bash
mkdir build && cd build
cmake -DUSE_CUDA=0 -DUSE_MKLDNN=1 -GNinja ..
cmake -DUSE_CUDA=0 -DUSE_MKLDNN=1 -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand All @@ -278,7 +278,7 @@ ninja -v

```bash
mkdir build && cd build
cmake -DUSE_CUDA=0 -DBLAS=open -GNinja ..
cmake -DUSE_CUDA=0 -DBLAS=open -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand All @@ -288,15 +288,15 @@ ninja -v

```bash
mkdir build && cd build
cmake -DUSE_OPENCV=0 -GNinja ..
cmake -DUSE_OPENCV=0 -DCMAKE_BUILD_TYPE=Release -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
mkdir build && cd build
cmake -DBLAS=apple -DUSE_OPENCV=0 -DUSE_OPENMP=0 -GNinja ..
cmake -DBLAS=apple -DUSE_OPENCV=0 -DUSE_OPENMP=0 -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand All @@ -305,7 +305,7 @@ ninja -v
```bash
brew install llvm
mkdir build && cd build
cmake -DBLAS=apple -DUSE_OPENMP=1 -GNinja ..
cmake -DBLAS=apple -DUSE_OPENMP=1 -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand Down
2 changes: 1 addition & 1 deletion docs/static_site/src/pages/get_started/c_plus_plus.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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
cmake -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -DUSE_MKLDNN=1 -DUSE_CPP_PACKAGE=1 -GNinja ..
cmake -DUSE_CUDA=1 -DUSE_CUDA_PATH=/usr/local/cuda -DUSE_CUDNN=1 -DUSE_MKLDNN=1 -DUSE_CPP_PACKAGE=1 -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja -v
```

Expand Down
3 changes: 3 additions & 0 deletions docs/static_site/src/pages/get_started/ubuntu_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ Build with CMake and ninja, without GPU and without MKL.
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
..
ninja
```
Expand All @@ -228,6 +229,7 @@ If building on CPU and using MKL and MKL-DNN (make sure MKL is installed accordi
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
..
ninja
```
Expand All @@ -244,6 +246,7 @@ Cuda 10.1 in Ubuntu 18.04 builds fine but is not currently tested in CI.
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
..
ninja
```
Expand Down