Currently mxnet supports two different build system files: Makefile and CMakeLists.txt. Contributors use the cmake file to add depenencies / modify the build settings while developers use the Makefile to build mxnet from source.

The issue with these two build system files is that it slows down development. Contributors modify the CMakeLists.txt to build mxnet and test their code. After their feature has been added, the contributor then needs to make the analogous changes to the Makefile. The intention behind maintaining the Makefile is that it not require developers who wish to build from source to have cmake dependency. And when including 3party dependencies, the Makefile build system also assumes that the library includes binaries already in the repository. Additionally, developers already need cmake if they wish to build windows mxnet from source.

Pros:

  • Consolidates build systems into one file
  • Supports adding libraries that does not include binaries

Cons:

  • Add cmake a dependency 
  • Building with cmake on devices like raspberry pi may be old

Steps to make cmake default build system.

  • Add shell script to install cmake on all platforms (find this script)
  • Jenkins tests need to start building with CMakeLists.txt as opposed to Makefile.
  • Need to update mxnet build from source documentation (only for Linux distributions and Mac) to instruct users to use cmake with analogous flags (shown below)


Current Makefile flags

USE_OPENCV
USE_BLAS
USE_CUDA
USE_CUDA_PATH
USE_CUDNN
USE_NCCL
USE_NCCP_PATH
USE_OPENMP
USE_OPENMP

To preserve backwards compatibility issues we should keep our current Makefile in the root until the above steps have been complete.






  • No labels

2 Comments

  1. Hey Alex, really like this suggestion.  A quick comment to say that:

    "Jenkins tests need to start building with CMakeLists.txt as opposed to Makefile."

    I added support for this some time ago.  This is what all the tasks labelled cmake are.

    We're also making progress on building using cmake for arm devices via cross-compilation, so that might also not be a huge issue.


  2. Only cmake is supported starting MXNet 2