This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-982] Provide example to illustrate usage of CSVIter in C++ API #12636
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0e3f771
Adding the example to demonstrate the usage of CSVIter
leleamol 735def8
Addressed the review comments to make the example configurable. Moved…
leleamol 46b4ced
Updated the code to address the cpp lint errors.
leleamol 87ca45c
Removed the author tag.
leleamol bdf34f3
Fixing the lint errors and usage message.
leleamol 02e784a
Update README file for cpp-package and provide README file for exampl…
leleamol f922509
Revert "Update README file for cpp-package and provide README file fo…
leleamol a315f74
Addressed the review comments regarding usage of atoi and avoiding st…
leleamol 387f2a4
Updated to use strtol instead of atoi
leleamol e8a9b14
Merge branch 'master' of https://github.com/apache/incubator-mxnet
leleamol 7ce4da0
Merge branch 'master' of https://github.com/apache/incubator-mxnet
leleamol 1d07b2e
Merge branch 'master' of https://github.com/apache/incubator-mxnet
leleamol b8338f0
Merge branch 'master' of https://github.com/apache/incubator-mxnet
leleamol 52dd094
Merge branch 'master' of https://github.com/apache/incubator-mxnet
leleamol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,21 @@ | ||
# MXNet C++ Package | ||
|
||
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. | ||
To build the C++ package, please refer to [this guide](<https://mxnet.incubator.apache.org/install/build_from_source#build-the-c-package>). | ||
|
||
## Building C++ Package | ||
|
||
The cpp-package directory contains the implementation of C++ API. As mentioned above, 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*.** | ||
|
||
###Steps to build the C++ package: | ||
1. Building the MXNet C++ package requires building MXNet from source. | ||
2. Clone the MXNet github repository **recursively** to ensure the code in submodules is available for building MXNet. | ||
3. Install the [prerequisites](<https://mxnet.incubator.apache.org/install/build_from_source#prerequisites>), desired [BLAS libraries](<https://mxnet.incubator.apache.org/install/build_from_source#blas-library>) and optional [OpenCV, CUDA, and cuDNN](<https://mxnet.incubator.apache.org/install/build_from_source#optional>) for building MXNet from source. | ||
4. 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. | ||
5. Please refer to [platfrom specific build instructions](<https://mxnet.incubator.apache.org/install/build_from_source#build-instructions-by-operating-system>) and available [build configurations](https://mxnet.incubator.apache.org/install/build_from_source#build-configurations) for more details. | ||
5. 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: | ||
``` | ||
make -j USE_CPP_PACKAGE=1 | ||
``` | ||
|
||
## Usage | ||
|
||
In order to consume the C++ API please follow the steps below | ||
|
||
1. Ensure that the MXNet shared library is built from source with the **USE__CPP__PACKAGE = 1**. | ||
2. 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. | ||
``` | ||
#include <mxnet-cpp/MxNetCpp.h> | ||
``` | ||
3. While building the program, ensure that the correct paths to the directories containing header files and MxNet shared library. | ||
4. The program links MxNet shared library dynamically. Hence the library needs to be accessible to the program during the runtime. This can be achieved by including the path to shared library to environment variable such as LD_LIBRARY_PATH. | ||
A basic tutorial can be found at <https://mxnet.incubator.apache.org/tutorials/c++/basics.html>. | ||
|
||
The example directory contains examples for you to get started. | ||
|
||
## Tutorial | ||
## Building C++ examples in examples folder | ||
|
||
A basic tutorial can be found at <https://mxnet.incubator.apache.org/tutorials/c++/basics.html>. | ||
From cpp-package/examples directory | ||
- Build all examples in release mode: **make all** | ||
- Build all examples in debug mode : **make debug** | ||
|
||
## Examples | ||
By default, the examples are build to be run on GPU. | ||
To build examples to run on CPU: | ||
- Release: **make all MXNET_USE_CPU=1** | ||
- Debug: **make debug MXNET_USE_CPU=1** | ||
|
||
The example directory contains examples for you to get started. | ||
|
||
The makefile will also download the necessary data files and store in data folder. (The download will take couple of minutes, but will be done only once on a fresh installation.) |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all laptops/computers have GPU, can you make CPU the default.