-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-1232] fix demo and add Eclipse support #13979
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
# MXNet Java Sample Project | ||
This is an project created to use Maven-published Scala/Java package with two Java examples. | ||
## Setup | ||
You can use the `Makefile` to make the Java package. Simply do the following: | ||
```Bash | ||
make javademo | ||
You are required to use Maven to build the package with the following commands: | ||
``` | ||
mvn package | ||
``` | ||
This will load the default parameter for all the environment variable. | ||
If you want to run with GPU on Linux, just simply add `USE_CUDA=1` when you run the make file | ||
|
||
This command will pick the default values specified in the [pom](/~https://github.com/apache/incubator-mxnet/blob/master/scala-package/mxnet-demo/java-demo/pom.xml) file. | ||
|
||
Note: If you are planning to use GPU, please add `-Dmxnet.profile=linux-x86_64-gpu` | ||
|
||
### Use customized version set | ||
You can use the following instruction as an alternative to achieve the same result: | ||
User are required to use `mvn package` to build the package, | ||
which are shown below: | ||
You may use `mvn package` to build the package, | ||
using the following commands: | ||
```Bash | ||
export SCALA_VERSION_PROFILE=2.11 | ||
export SCALA_PKG_PROFILE= | ||
|
@@ -71,9 +73,15 @@ If you want to test run on GPU, you can set a environment variable as follows: | |
export SCALA_TEST_ON_GPU=1 | ||
``` | ||
## Clean up | ||
Clean up for Maven package is simple, you can run the pre-configed `Makefile` as: | ||
Clean up for Maven package is simple: | ||
```Bash | ||
make javaclean | ||
mvn clean | ||
``` | ||
|
||
## Convert to Eclipse project (Optional) | ||
You can convert the maven project to the eclipse one by running the following command: | ||
``` | ||
mvn eclipse:eclipse | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a repeat of before... why is this here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is specifically for users trying to use Eclipse in their demo project |
||
``` | ||
|
||
## Q & A | ||
|
@@ -87,4 +95,4 @@ sudo apt install libopencv-imgcodecs3.4 | |
Is there any other version available? | ||
|
||
You can find nightly release version from [here](https://repository.apache.org/#nexus-search;gav~org.apache.mxnet~~1.5.0-SNAPSHOT~~). | ||
Please keep the same version in the Makefile or [above version](https://repository.apache.org/#nexus-search;gav~org.apache.mxnet~~~~) to run this demo. | ||
Please keep the same version in the pom file or [other versions in here](https://repository.apache.org/#nexus-search;gav~org.apache.mxnet~~~~) to run this demo. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,13 @@ | |
<version>1.0-SNAPSHOT</version> | ||
<name>MXNet Java Demo</name> | ||
|
||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<mxnet.version>[1.5.0-SNAPSHOT, )</mxnet.version> | ||
<mxnet.scalaprofile>2.11</mxnet.scalaprofile> | ||
</properties> | ||
|
||
<profiles> | ||
<profile> | ||
<id>ci-nightly</id> | ||
|
@@ -21,7 +28,30 @@ | |
<mxnet.version>[1.5.0-SNAPSHOT, )</mxnet.version> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
<profile> | ||
<id>osx-x86_64</id> | ||
<activation> | ||
<os> | ||
<family>mac</family> | ||
</os> | ||
</activation> | ||
<properties> | ||
<mxnet.profile>osx-x86_64-cpu</mxnet.profile> | ||
</properties> | ||
</profile> | ||
<profile> | ||
<id>linux-x86_64</id> | ||
<activation> | ||
<os> | ||
<family>unix</family> | ||
<name>Linux</name> | ||
</os> | ||
</activation> | ||
<properties> | ||
<mxnet.profile>linux-x86_64-cpu</mxnet.profile> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will always pick the cpu artifact. The existing code allows one to pick up the gpu artifacts as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In order to simplify the process, I decided to get rid of the makefile entirely. To address your concern, I add a noteline in the README to inform then using GPU to run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. removing makefile was a good riddance :) I'm fine with adding it to the README. |
||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
<repositories> | ||
<repository> | ||
|
@@ -30,12 +60,6 @@ | |
</repository> | ||
</repositories> | ||
|
||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<mxnet.version>[1.5.0-SNAPSHOT, )</mxnet.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.mxnet</groupId> | ||
|
This file was deleted.
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.
From what directory? Is this known or should you mention it?
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.
This is known, mvn command could only execute in a folder that has a pom file.
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.
I also add one line to explain that