You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/04/02 07:02:14 UTC

[GitHub] [incubator-mxnet] larroy commented on a change in pull request #14534: [DOC] Update ubuntu install instructions from source

larroy commented on a change in pull request #14534: [DOC] Update ubuntu install instructions from source
URL: https://github.com/apache/incubator-mxnet/pull/14534#discussion_r271156761
 
 

 ##########
 File path: docs/install/ubuntu_setup.md
 ##########
 @@ -170,44 +191,72 @@ If building on CPU and using OpenBLAS:
 ```bash
     git clone --recursive https://github.com/apache/incubator-mxnet.git
     cd incubator-mxnet
-    echo "USE_OPENCV = 1" >> ./config.mk
-    echo "USE_BLAS = openblas" >> ./config.mk
-    make -j $(nproc)
+```
+
+
+```bash
+    rm -rf build
+    mkdir -p build && cd build
+    cmake -GNinja \
+        -DUSE_CUDA=OFF \
+        -DUSE_MKL_IF_AVAILABLE=OFF \
+        -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
+        -DCMAKE_C_COMPILER_LAUNCHER=ccache \
+        -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+    ..
+    ninja
 ```
 
 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/docs/tutorials/mkldnn/MKLDNN_README.md)):
 
 ```bash
-    git clone --recursive https://github.com/apache/incubator-mxnet.git
-    cd incubator-mxnet
-    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)
+    rm -rf build
+    mkdir -p build && cd build
+    cmake -GNinja \
+        -DUSE_CUDA=OFF \
+        -DUSE_MKL_IF_AVAILABLE=ON \
+        -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
+        -DCMAKE_C_COMPILER_LAUNCHER=ccache \
+        -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+    ..
+    ninja
 ```
 
-If building on GPU and you want OpenCV and OpenBLAS (make sure you have installed the [CUDA dependencies first](#cuda-dependencies)):
+If building on GPU (make sure you have installed the [CUDA dependencies first](#cuda-dependencies)):
+Cuda 10.1 in Ubuntu 18.04 builds fine but is not currently tested in CI.
 
 ```bash
-    git clone --recursive https://github.com/apache/incubator-mxnet.git
-    cd incubator-mxnet
-    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)
+    rm -rf build
+    mkdir -p build && cd build
+    cmake -GNinja \
+        -DUSE_CUDA=ON \
+        -DUSE_MKL_IF_AVAILABLE=OFF \
+        -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
+        -DCMAKE_C_COMPILER_LAUNCHER=ccache \
+        -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+    ..
+    ninja
 ```
 
-*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).
+*Note* - You can explore and use more compilation options in `CMakeLists.txt` and also review common [usage examples](build_from_source.html#usage-examples).
+You can also use a scripted version of the above with an editable CMake options file by doing the
+following:
+
+```bash
+cp cmake/cmake_options.yml .
+# Edit to your taste
+$EDITOR cmake_options.yml
+# Launch a local CMake build
+./dev_menu.py menu 1
+```
 
-Building from source creates a library called ```libmxnet.so``` in the `lib` folder in your MXNet project root.
+Building from source creates a library called ```libmxnet.so``` in the `build` folder in your MXNet project root.
 
-You may also want to add the MXNet shared library to your `LD_LIBRARY_PATH`:
+You may also want to add the MXNet shared library to your `LD_LIBRARY_PATH` and `MXNET_LIBRARY_PATH` accordingly:
 
 ```bash
-export LD_LIBRARY_PATH=$PWD/lib
+export LD_LIBRARY_PATH=`realpath build`
+export MXNET_LIBRARY_PATH=`realpath build/libmxnet.so`
 
 Review comment:
   MXNET_LIBRARY_PATH when loading the library from python. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services