From 1a3211f084be1fae66bdc0bd7730c54549b1f6d9 Mon Sep 17 00:00:00 2001 From: "Huang, Guangtai" Date: Fri, 27 Sep 2019 16:03:06 +0800 Subject: [PATCH] add 'Release' cmake flag --- cmake/cmake_options.yml | 2 +- .../src/pages/get_started/build_from_source.md | 16 ++++++++-------- .../src/pages/get_started/c_plus_plus.md | 2 +- .../src/pages/get_started/ubuntu_setup.md | 3 +++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cmake/cmake_options.yml b/cmake/cmake_options.yml index 81138241dfc6..6df148323df8 100644 --- a/cmake/cmake_options.yml +++ b/cmake/cmake_options.yml @@ -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" diff --git a/docs/static_site/src/pages/get_started/build_from_source.md b/docs/static_site/src/pages/get_started/build_from_source.md index 5f4c2731afb6..d3f1b032bb92 100644 --- a/docs/static_site/src/pages/get_started/build_from_source.md +++ b/docs/static_site/src/pages/get_started/build_from_source.md @@ -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 ``` @@ -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 ``` @@ -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 ``` @@ -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 ``` @@ -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 ``` @@ -288,7 +288,7 @@ ninja -v ```bash mkdir build && cd build -cmake -DUSE_OPENCV=0 -GNinja .. +cmake -DUSE_OPENCV=0 -DCMAKE_BUILD_TYPE=Release -GNinja .. ninja -v ``` @@ -296,7 +296,7 @@ ninja -v ```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 ``` @@ -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 ``` diff --git a/docs/static_site/src/pages/get_started/c_plus_plus.md b/docs/static_site/src/pages/get_started/c_plus_plus.md index a32496dd68a7..9f4800cd99bf 100644 --- a/docs/static_site/src/pages/get_started/c_plus_plus.md +++ b/docs/static_site/src/pages/get_started/c_plus_plus.md @@ -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 ``` diff --git a/docs/static_site/src/pages/get_started/ubuntu_setup.md b/docs/static_site/src/pages/get_started/ubuntu_setup.md index 7b309c27cbd6..4be921e26394 100644 --- a/docs/static_site/src/pages/get_started/ubuntu_setup.md +++ b/docs/static_site/src/pages/get_started/ubuntu_setup.md @@ -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 ``` @@ -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 ``` @@ -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 ```