• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

example/H03-May-2022-6,0074,016

include/mxnet-cpp/H04-Nov-2021-5,5103,501

scripts/H04-Nov-2021-631508

tests/H04-Nov-2021-14158

.travis.ymlH A D04-Nov-20211.5 KiB6555

README.mdH A D04-Nov-20213.9 KiB6332

cpp-package.mkH A D04-Nov-20211.5 KiB4619

README.md

1<!--- Licensed to the Apache Software Foundation (ASF) under one -->
2<!--- or more contributor license agreements.  See the NOTICE file -->
3<!--- distributed with this work for additional information -->
4<!--- regarding copyright ownership.  The ASF licenses this file -->
5<!--- to you under the Apache License, Version 2.0 (the -->
6<!--- "License"); you may not use this file except in compliance -->
7<!--- with the License.  You may obtain a copy of the License at -->
8
9<!---   http://www.apache.org/licenses/LICENSE-2.0 -->
10
11<!--- Unless required by applicable law or agreed to in writing, -->
12<!--- software distributed under the License is distributed on an -->
13<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->
14<!--- KIND, either express or implied.  See the License for the -->
15<!--- specific language governing permissions and limitations -->
16<!--- under the License. -->
17
18# MXNet C++ Package
19
20The MXNet C++ Package provides C++ API bindings to the users of MXNet.  Currently, these bindings are not available as standalone package.
21The users of these bindings are required to build this package as mentioned below.
22
23## Building C++ Package
24
25The cpp-package directory contains the implementation of C++ API. As mentioned above, users are required to build this directory or package before using it.
26**The cpp-package is built while building the MXNet shared library, *libmxnet.so*.**
27
28### Steps to build the C++ package:
291.  Building the MXNet C++ package requires building MXNet from source.
302.  Clone the MXNet GitHub repository **recursively** to ensure the code in submodules is available for building MXNet.
31	```
32	git clone --recursive https://github.com/apache/incubator-mxnet mxnet
33	```
34
353.  Install the [prerequisites](<https://mxnet.apache.org/install/build_from_source#prerequisites>), desired [BLAS libraries](<https://mxnet.apache.org/install/build_from_source#blas-library>) and optional [OpenCV, CUDA, and cuDNN](<https://mxnet.apache.org/install/build_from_source#optional>) for building MXNet from source.
364.  There is a configuration file for make, [make/config.mk](<https://github.com/apache/incubator-mxnet/blob/master/make/config.mk>) that contains all the compilation options. You can edit this file and set the appropriate options prior to running the **make** command.
375.  Please refer to  [platform specific build instructions](<https://mxnet.apache.org/install/build_from_source#build-instructions-by-operating-system>) and available [build configurations](https://mxnet.apache.org/install/build_from_source#build-configurations) for more details.
385.  For enabling the build of C++ Package, set the **USE\_CPP\_PACKAGE = 1** in [make/config.mk](<https://github.com/apache/incubator-mxnet/blob/master/make/config.mk>). Optionally, the compilation flag can also be specified on **make** command line as follows.
39	```
40	make -j USE_CPP_PACKAGE=1
41	```
42
43## Usage
44
45In order to consume the C++ API please follow the steps below.
46
471. Ensure that the MXNet shared library is built from source with the **USE\_CPP\_PACKAGE = 1**.
482. Include the [MxNetCpp.h](<https://github.com/apache/incubator-mxnet/blob/master/cpp-package/include/mxnet-cpp/MxNetCpp.h>) in the program that is going to consume MXNet C++ API.
49	```
50	#include <mxnet-cpp/MxNetCpp.h>
51	```
523. While building the program, ensure that the correct paths to the directories containing header files and MXNet shared library.
534. The program links the MXNet shared library dynamically. Hence the library needs to be accessible to the program during runtime. This can be achieved by including the path to the shared library in the environment variable  **LD\_LIBRARY\_PATH** for Linux, Mac. and Ubuntu OS and **PATH** for Windows OS.
54
55
56## Tutorial
57
58A basic tutorial can be found at <https://mxnet.apache.org/api/cpp/docs/tutorials/basics>.
59
60## Examples
61
62The example directory contains examples for you to get started. Please build the MXNet C++ Package before building the examples.
63