The MXNet C++ Package provides C++ API bindings to the users of MXNet. Currently, these bindings are not available as standalone package. The users of these bindings are required to build this package as mentioned below.
The cpp-package directory contains the implementation of C++ API. Users are required to build this directory or package before using it. The cpp-package is built while building the MXNet shared library, libmxnet.so, with USE_CPP_PACKAGE option turned on. Please follow the steps to build the C++ package
Building the MXNet C++ package requires building MXNet from source.
Clone the MXNet GitHub repository recursively to ensure the code in submodules is available for building MXNet.
git clone --recursive https://github.com/apache/mxnet mxnet
Install the recommended dependencies and optional dependencies for building MXNet from source.
There is a configuration file for cmake, config/*.cmake that contains all the compilation options. You can edit this file and set the appropriate options prior to running the cmake command.
Please refer to cmake configuration files for more details on how to configure and compile MXNet.
For enabling the build of C++ Package, set the -DUSE_CPP_PACKAGE = 1 in cmake options.
COMMAND python OpWrapperGenerator.py $<TARGET_FILE:mxnet>
In order to consume the C++ API please follow the steps below.
#include <mxnet-cpp/MxNetCpp.h>
A basic tutorial can be found at https://mxnet.apache.org/api/cpp/docs/tutorials/basics.
The example directory contains examples for you to get started. Please build the MXNet C++ Package before building the examples.