What are the actual commands to build from source on linux?

I am building on Ubuntu Linux.

I did the following:

  • clone mxnet and switched to the 1.7.0 branch path is /opt/mxnet
  • create a build folder mkdir build
  • run cmake with build flags from /opt/mxnet/build:
    • cmake -DUSE_CUDA=1 \
        -DUSE_CUDNN=1 \
        -DMXNET_CUDA_ARCH=7.5 \
        -DUSE_OPENCV=1 \
        -DUSE_NCCL=1 \
        -DUSE_OPENMP=0 \
        -DUSE_CXX14_IF_AVAILABLE=1 \
  • run cmake --build . --parallel 8

but I get make: *** No rule to make target 'build'. Stop.

am I in the wrong directory? Was I supposed to manually create a make file or?


okay worked out that it was due to opencv and it not finding opencv properly.

So now I set an env variable OpenCV_DIR and it can start compiling.
Now I got an issue with:

error: ‘shared_timed_mutex’ in namespace ‘std’ does not name a type

Which happens at:

In file included from /opt/mxnet/src/c_api/../operator/custom/../../profiler/./profiler.h:29,
                 from /opt/mxnet/src/c_api/../operator/custom/../../profiler/custom_op_profiler.h:26,
                 from /opt/mxnet/src/c_api/../operator/custom/custom-inl.h:46,
                 from /opt/mxnet/src/c_api/c_api_function.cc:32:
/opt/mxnet/include/dmlc/thread_group.h:77:26: error: ‘shared_timed_mutex’ in namespace ‘std’ does not name a type
   77 | using SharedMutex = std::shared_timed_mutex;
      |                          ^~~~~~~~~~~~~~~~~~