Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Re-organize scala maven build
Browse files Browse the repository at this point in the history
1. Automatically detect which platform to build for scala.
2. Remove platform dependend submodules
3. Fix cyclic module dependencies
4. Fix scalatype style check
5. Now mvn can be executed in submodule
6. Maven build can be executed from any directory not only in root project
7. Checkin javah header file, and use verify task to detect native API changes
8. Improve incremental build performance
9. Remove unittest and integration-test profile, use proper task instead
10. Delete generated scala file during maven clean.
  • Loading branch information
frankfliu committed Dec 16, 2018
1 parent aa240cb commit 8b70afd
Show file tree
Hide file tree
Showing 41 changed files with 1,638 additions and 1,574 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ scaladeploylocal:
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")

jnilint:
3rdparty/dmlc-core/scripts/lint.py mxnet-jnicpp cpp scala-package/native/src
3rdparty/dmlc-core/scripts/lint.py mxnet-jnicpp cpp scala-package/native/src --exclude_path scala-package/native/src/main/native/org_apache_mxnet_native_c_api.h

rclean:
$(RM) -r R-package/src/image_recordio.h R-package/NAMESPACE R-package/man R-package/R/mxnet_generated.R \
Expand Down
2 changes: 1 addition & 1 deletion contrib/clojure-package/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-gpu "1.2.1"]

;;; CI
[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-cpu "1.5.0-SNAPSHOT"]
[org.apache.mxnet/mxnet-full_2.11 "1.5.0-SNAPSHOT"]

[org.clojure/tools.logging "0.4.0"]
[org.apache.logging.log4j/log4j-core "2.8.1"]
Expand Down
20 changes: 11 additions & 9 deletions scala-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The MXNet Scala/Java Package brings flexible and efficient GPU/CPU computing and
- The Scala/Java Inferece APIs provides an easy out of the box solution for loading pre-trained MXNet models and running inference on them.

Pre-Built Maven Packages
------------
------------------------

### Stable ###

Expand Down Expand Up @@ -114,30 +114,32 @@ Also, add the dependency which corresponds to your platform to the ```dependenci
**Note:** ```<version>[1.5.0,)<\version>``` indicates that we will fetch packages with version 1.5.0 or higher. This will always ensure that the pom.xml is able to fetch the latest and greatest jar files from Maven Snapshot repository.

Build From Source
------------
-----------------

Checkout the [Installation Guide](http://mxnet.incubator.apache.org/install/index.html) contains instructions to install mxnet package and build it from source.
If you have built MXNet from source and are looking to setup Scala from that point, you may simply run the following from the MXNet source root:
Checkout the [Installation Guide](http://mxnet.incubator.apache.org/install/index.html) contains instructions to install mxnet package and build it from source. Scala maven build assume you already have a ``lib/libmxnet.so`` file.
If you have built MXNet from source and are looking to setup Scala from that point, you may simply run the following from the MXNet source root, Scala build will detect your platform (OSX/Linux) and libmxnet.so flavor (CPU/GPU):

```bash
make scalapkg
cd scala-package
mvn install
```

You can also run the unit tests and integration tests on the Scala Package by :

```bash
make scalaunittest
make scalaintegrationtest
cd scala-package
mvn integration-test
```

Or run a subset of unit tests, for e.g.,

```bash
make SCALA_TEST_ARGS=-Dsuites=org.apache.mxnet.NDArraySuite scalaunittest
cd scala-package
mvn -DSCALA_TEST_ARGS=-Dsuites=org.apache.mxnet.NDArraySuite integration-test
```

If everything goes well, you will find jars for `assembly`, `core` and `example` modules.
Also it produces the native library in `native/{your-architecture}/target`, which you can use to cooperate with the `core` module.
Also it produces the native library in `native/target`, which you can use to cooperate with the `core` module.

Examples & Usage
-------
Expand Down
131 changes: 0 additions & 131 deletions scala-package/assembly/linux-x86_64-cpu/pom.xml

This file was deleted.

This file was deleted.

131 changes: 0 additions & 131 deletions scala-package/assembly/linux-x86_64-gpu/pom.xml

This file was deleted.

Loading

0 comments on commit 8b70afd

Please sign in to comment.