Skip to content

Commit

Permalink
* Bundle the full version of MKL now that its new license permits it…
Browse files Browse the repository at this point in the history
… (issue #601)
  • Loading branch information
saudet committed Jan 6, 2019
1 parent 84e790d commit 03c5fdf
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Bundle the full version of MKL now that its new license permits it ([issue #601](https://github.com/bytedeco/javacpp-presets/issues/601))
* Bundle libraries from raspberrypi/userland to avoid loading issues on `linux-armhf` devices other than Raspberry Pi ([issue bytedeco/javacv#1118](https://github.com/bytedeco/javacv/issues/1118))
* Bundle the new official Java/Scala API of MXNet via the `jnimxnet` library
* Add `QuickSpinC.h`, `SpinVideoC.h`, and `TransportLayer*C.h` for Spinnaker ([pull #660](https://github.com/bytedeco/javacpp-presets/pull/660))
Expand Down
23 changes: 22 additions & 1 deletion mkl-dnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Java API documentation is available here:

* http://bytedeco.org/javacpp-presets/mkl-dnn/apidocs/

∗ Although MKL-DNN comes bundled with a stripped-down version of MKL known as "MKLML", it is sometimes desirable to link instead with the full version of [Intel MKL](https://software.intel.com/intel-mkl). For that, MKL first needs to be installed in its default location, or available in the system PATH or in the "java.library.path", then we can set the "org.bytedeco.javacpp.mklml.load" system property to `mkl_rt`. We should also set the "org.bytedeco.javacpp.pathsfirst" system property to `true` to ensure that all libraries are actually loaded from the system.
∗ Although MKL-DNN comes bundled with a stripped-down version of MKL known as "MKLML", it is sometimes desirable to link instead with the full version of [Intel MKL](https://software.intel.com/intel-mkl). For that, MKL first needs to be installed in its default location, or available in the system PATH or in the "java.library.path", then we can set the "org.bytedeco.javacpp.mklml.load" system property to `mkl_rt`. We should also set the "org.bytedeco.javacpp.pathsfirst" system property to `true` to ensure that all libraries are actually loaded from the system, unless the `-redist` artifacts listed below are in the class path.


Sample Usage
Expand Down Expand Up @@ -46,6 +46,27 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<artifactId>mkl-dnn-platform</artifactId>
<version>0.17.2-1.4.4-SNAPSHOT</version>
</dependency>

<!-- Additional dependencies to use bundled full version of MKL -->
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>linux-x86_64-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>macosx-x86_64-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>windows-x86_64-redist</classifier>
</dependency>

</dependencies>
</project>
```
Expand Down
35 changes: 34 additions & 1 deletion mkl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Java API documentation is available here:

* http://bytedeco.org/javacpp-presets/mkl/apidocs/

&lowast; MKL also gets used by the [JavaCPP Presets for OpenBLAS](https://github.com/bytedeco/javacpp-presets/tree/master/openblas).
&lowast; MKL also gets used by the [JavaCPP Presets for OpenBLAS](../openblas), the [JavaCPP Presets for MKL-DNN](../mkl-dnn), or any other library that depends on one of them.


Sample Usage
Expand Down Expand Up @@ -46,6 +46,39 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<artifactId>mkl-platform</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
</dependency>

<!-- Additional dependencies to use bundled full version of MKL -->
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>linux-x86-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>linux-x86_64-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>macosx-x86_64-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>windows-x86-redist</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>mkl</artifactId>
<version>2019.1-1.4.4-SNAPSHOT</version>
<classifier>windows-x86_64-redist</classifier>
</dependency>

</dependencies>
</project>
```
Expand Down
78 changes: 78 additions & 0 deletions mkl/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Intel Simplified Software License (Version April 2018)

Copyright (c) 2018 Intel Corporation.

Use and Redistribution. You may use and redistribute the software (the
"Software"), without modification, provided the following conditions are met:

* Redistributions must reproduce the above copyright notice and the following
terms of use in the Software and in the documentation and/or other materials
provided with the distribution.
* Neither the name of Intel nor the names of its suppliers may be used to
endorse or promote products derived from this Software without specific prior
written permission.
* No reverse engineering, decompilation, or disassembly of this Software is
permitted.

Limited patent license. Intel grants you a world-wide, royalty-free,
non-exclusive license under patents it now or hereafter owns or controls to
make, have made, use, import, offer to sell and sell ("Utilize") this Software,
but solely to the extent that any such patent is necessary to Utilize the
Software alone. The patent license shall not apply to any combinations which
include this software. No hardware per se is licensed hereunder.

Third party and other Intel programs. "Third Party Programs" are the files
listed in the "third-party-programs.txt" text file that is included with the
Software and may include Intel programs under separate license terms. Third
Party Programs, even if included with the distribution of the Materials, are
governed by separate license terms and those license terms solely govern your
use of those programs.

DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS
WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE
THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND
ATTORNEYS' FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT
INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE MATERIALS.

LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. YOU AGREE TO INDEMNIFY AND HOLD INTEL
HARMLESS AGAINST ANY CLAIMS AND EXPENSES RESULTING FROM YOUR USE OR UNAUTHORIZED
USE OF THE SOFTWARE.

No support. Intel may make changes to the Software, at any time without notice,
and is not obligated to support, update or provide training for the Software.

Termination. Intel may terminate your right to use the Software in the event of
your breach of this Agreement and you fail to cure the breach within a
reasonable period of time.

Feedback. Should you provide Intel with comments, modifications, corrections,
enhancements or other input ("Feedback") related to the Software Intel will be
free to use, disclose, reproduce, license or otherwise distribute or exploit the
Feedback in its sole discretion without any obligations or restrictions of any
kind, including without limitation, intellectual property rights or licensing
obligations.

Compliance with laws. You agree to comply with all relevant laws and
regulations governing your use, transfer, import or export (or prohibition
thereof) of the Software.

Governing law. All disputes will be governed by the laws of the United States
of America and the State of Delaware without reference to conflict of law
principles and subject to the exclusive jurisdiction of the state or federal
courts sitting in the State of Delaware, and each party agrees that it submits
to the personal jurisdiction and venue of those courts and waives any
objections. The United Nations Convention on Contracts for the International
Sale of Goods (1980) is specifically excluded and will not apply to the
Software.

*Other names and brands may be claimed as the property of others.

49 changes: 26 additions & 23 deletions mkl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<version>2019.1-${project.parent.version}</version>
<name>JavaCPP Presets for MKL</name>

<properties>
<javacpp.platform.oldcompiler>${javacpp.platform.compiler}</javacpp.platform.oldcompiler>
</properties>

<dependencies>
<dependency>
<groupId>org.bytedeco</groupId>
Expand All @@ -36,34 +32,41 @@
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<configuration>
<propertyKeysAndValues>
<property>
<name>platform.root</name>
<value>${javacpp.platform.root}</value>
</property>
<property>
<name>platform.compiler</name>
<value>${javacpp.platform.oldcompiler}</value>
</property>
</propertyKeysAndValues>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>javacpp.compiler</id>
<phase>process-classes</phase>
<id>${javacpp.platform}</id>
<phase>package</phase>
<goals>
<goal>build</goal>
<goal>jar</goal>
</goals>
<configuration>
<copyLibs>false</copyLibs>
<classifier>${javacpp.platform}</classifier>
<includes>
<include>org/bytedeco/javacpp/${javacpp.platform}/*jni*</include>
</includes>
</configuration>
</execution>
<execution>
<id>${javacpp.platform}-redist</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>${javacpp.platform}-redist</classifier>
<includes>
<include>org/bytedeco/javacpp/${javacpp.platform}/</include>
</includes>
<excludes>
<exclude>org/bytedeco/javacpp/${javacpp.platform}/*jni*</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion openblas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Java API documentation is available here:

&lowast; The JNI bindings can instead link with [Intel MKL](https://software.intel.com/intel-mkl), or any other arbitrary library found on the "java.library.path" or on the class path, by specifying it with the "org.bytedeco.javacpp.openblas.load" system property. For example, to use the BLAS library from the [Accelerate framework](https://developer.apple.com/documentation/accelerate) on Mac OS X, we can pass options such as `-Djava.library.path=/usr/lib/ -Dorg.bytedeco.javacpp.openblas.load=blas`, while for a default installation of MKL that would be `-Dorg.bytedeco.javacpp.openblas.load=mkl_rt`.

Intel also offers a stripped-down but free version of MKL named "MKLML" that is bundled with the [JavaCPP Presets for MKL-DNN](../mkl-dnn). After adding the JAR files for MKL-DNN to the class path, it can be accessed with an option like `-Dorg.bytedeco.javacpp.openblas.load=mklml`.
Intel also offers a stripped-down but free version of MKL named "MKLML" that is bundled with the [JavaCPP Presets for MKL-DNN](../mkl-dnn). After adding the JAR files for MKL-DNN to the class path, it can be accessed with an option like `-Dorg.bytedeco.javacpp.openblas.load=mklml`. Moreover, it is now possible to do the same with the full version of MKL and the [JavaCPP Presets for MKL](../mkl) with the `-redist` artifacts in the class path and an option like `-Dorg.bytedeco.javacpp.openblas.load=mkl_rt`.


Sample Usage
Expand Down

0 comments on commit 03c5fdf

Please sign in to comment.