Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1bf871

Browse files
committed
Upgrade test suite java version to run on > 8, upgrade kotlin version
1 parent 6646f1c commit c1bf871

File tree

21 files changed

+115
-62
lines changed

21 files changed

+115
-62
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ Deeplearning4J has quite a few dependencies. For this reason we only support usa
3535
<dependency>
3636
<groupId>org.deeplearning4j</groupId>
3737
<artifactId>deeplearning4j-core</artifactId>
38-
<version>1.0.0-M1.1</version>
38+
<version>1.0.0-M2.1</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>org.nd4j</groupId>
4242
<artifactId>nd4j-native-platform</artifactId>
43-
<version>1.0.0-M1.1</version>
43+
<version>1.0.0-M2.1</version>
4444
</dependency>
4545
</dependencies>
4646
```
@@ -110,6 +110,10 @@ mvn -B -V -U clean install -pl -Dlibnd4j.platform=linux-x86_64 -Dlibnd4j.chip=c
110110

111111
An example of GPU "CC" or compute capability is 61 for Titan X Pascal.
112112

113+
## Running project in Intellij IDEA:
114+
1. Ensure you follow https://stackoverflow.com/questions/45370178/exporting-a-package-from-system-module-is-not-allowed-with-release on jdk 9 or later
115+
2. Ignore all nd4j-shade submodules. Right click on each folder and click: Maven -> Ignore project
116+
113117

114118
## License
115119

contrib/codegen-tools/codegen/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
<junit.version>5.8.0-M1</junit.version>
1919
<junit.platform.launcher.version>1.8.0-M1</junit.platform.launcher.version>
2020
<junit-jupiter.version>5.4.2</junit-jupiter.version>
21-
<java.version>1.8</java.version>
21+
<java.version>11</java.version>
2222
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
2323
<kotlin.version>1.3.50</kotlin.version>
24-
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
24+
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
2525
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
2626
<javapoet.version>1.13.0</javapoet.version>
2727
</properties>
@@ -249,7 +249,7 @@
249249
<plugin>
250250
<groupId>org.apache.maven.plugins</groupId>
251251
<artifactId>maven-compiler-plugin</artifactId>
252-
<version>3.5.1</version>
252+
<version>3.8.1</version>
253253
<executions>
254254
<!-- Replacing default-compile as it is treated specially by maven -->
255255
<execution>
@@ -275,6 +275,7 @@
275275
<configuration>
276276
<source>${java.version}</source>
277277
<target>${java.version}</target>
278+
278279
</configuration>
279280
</plugin>
280281
</plugins>

contrib/codegen-tools/libnd4j-gen/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
<properties>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36-
<maven.compiler.source>1.8</maven.compiler.source>
37-
<maven.compiler.target>1.8</maven.compiler.target>
36+
<maven.compiler.source>11</maven.compiler.source>
37+
<maven.compiler.target>11</maven.compiler.target>
3838
<nd4j.version>1.0.0-SNAPSHOT</nd4j.version>
3939
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
4040
<javaparser.version>3.24.4</javaparser.version>

contrib/version-updater/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<maven.compiler.source>1.8</maven.compiler.source>
17-
<maven.compiler.target>1.8</maven.compiler.target>
16+
<maven.compiler.source>11</maven.compiler.source>
17+
<maven.compiler.target>11</maven.compiler.target>
1818
<picocli.version>4.6.1</picocli.version>
1919
</properties>
2020

datavec/datavec-arrow/src/main/java9/module-info.java

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
open module datavec.arrow {
2+
requires java.nio;
23
requires commons.io;
34
requires slf4j.api;
45
requires arrow.memory.core;

datavec/datavec-data/datavec-data-image/pom.xml

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@
139139
<classpathDependencyExclude>com.google.android:android
140140
</classpathDependencyExclude>
141141
</classpathDependencyExcludes>
142+
<argLine>
143+
--add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED
144+
</argLine>
142145
</configuration>
143146
</plugin>
144147
</plugins>

nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java9/module-info.java

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
open module nd4j.api {
2+
requires java.nio;
23
requires byteunits;
34
requires commons.io;
45
requires commons.net;

nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda-preset/pom.xml

+8-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,14 @@
117117
</execution>
118118
</executions>
119119
<configuration>
120-
<source>8</source>
121-
<target>8</target>
120+
<source>11</source>
121+
<target>11</target>
122+
<compilerArgs>
123+
<arg>--add-exports</arg>
124+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
125+
<arg>--add-opens</arg>
126+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
127+
</compilerArgs>
122128
</configuration>
123129
</plugin>
124130
<plugin>

nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/pom.xml

+10-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
Maximum heap size was set to 6g, as a minimum required value for tests run.
116116
Depending on a build machine, default value is not always enough.
117117
-->
118-
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}</argLine>
118+
<argLine>--add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Ddtype=float -Dfile.encoding=UTF-8 -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}
119+
</argLine>
119120

120121
</configuration>
121122
</plugin>
@@ -231,8 +232,14 @@
231232
</execution>
232233
</executions>
233234
<configuration>
234-
<source>8</source>
235-
<target>8</target>
235+
<source>${maven.compiler.source}</source>
236+
<target>${maven.compiler.target}</target>
237+
<compilerArgs>
238+
<arg>--add-exports</arg>
239+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
240+
<arg>--add-opens</arg>
241+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
242+
</compilerArgs>
236243
</configuration>
237244
</plugin>
238245

nd4j/nd4j-backends/nd4j-backend-impls/nd4j-minimizer-preset/pom.xml

+8-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,14 @@
173173
</execution>
174174
</executions>
175175
<configuration>
176-
<source>8</source>
177-
<target>8</target>
176+
<source>${maven.compiler.source}</source>
177+
<target>${maven.compiler.target}</target>
178+
<compilerArgs>
179+
<arg>--add-exports</arg>
180+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
181+
<arg>--add-opens</arg>
182+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
183+
</compilerArgs>
178184
</configuration>
179185
</plugin>
180186
<plugin>

nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/pom.xml

+8-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,14 @@
159159
</execution>
160160
</executions>
161161
<configuration>
162-
<source>8</source>
163-
<target>8</target>
162+
<source>${maven.compiler.source}</source>
163+
<target>${maven.compiler.target}</target>
164+
<compilerArgs>
165+
<arg>--add-exports</arg>
166+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
167+
<arg>--add-opens</arg>
168+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
169+
</compilerArgs>
164170
</configuration>
165171
</plugin>
166172
<plugin>

nd4j/nd4j-backends/nd4j-backend-impls/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
Maximum heap size was set to 8g, as a minimum required value for tests run.
107107
Depending on a build machine, default value is not always enough.
108108
-->
109-
<argLine>-Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}</argLine>
109+
<argLine>--add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size}</argLine>
110110
<forkedProcessTimeoutInSeconds>240</forkedProcessTimeoutInSeconds>
111111
<forkedProcessExitTimeoutInSeconds>240</forkedProcessExitTimeoutInSeconds>
112112
<parallelTestsTimeoutInSeconds>240</parallelTestsTimeoutInSeconds>
@@ -141,7 +141,7 @@
141141
<activation>
142142
<activeByDefault>false</activeByDefault>
143143
</activation>
144-
144+
145145
<modules>
146146
<module>nd4j-native</module>
147147
<module>nd4j-native-preset</module>

nd4j/nd4j-common/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<name>nd4j-common</name>
3737

3838
<properties>
39-
<maven.compiler.source>8</maven.compiler.source>
40-
<maven.compiler.target>8</maven.compiler.target>
39+
<maven.compiler.source>11</maven.compiler.source>
40+
<maven.compiler.target>11</maven.compiler.target>
4141
<module.name>nd4j.common</module.name>
4242
</properties>
4343

nd4j/samediff-import/pom.xml

+12-6
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747

4848
<properties>
4949
<kotlin.version>1.4.30</kotlin.version>
50-
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
50+
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
5151
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
5252
<junit.version>5.8.0-M1</junit.version>
5353
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5454

5555

56-
<java.version>1.8</java.version>
56+
<java.version>11</java.version>
5757
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
5858
<test.heap.size>2g</test.heap.size>
5959
<test.offheap.size>2g</test.offheap.size>
@@ -160,6 +160,16 @@
160160
<plugin>
161161
<groupId>org.apache.maven.plugins</groupId>
162162
<artifactId>maven-compiler-plugin</artifactId>
163+
<configuration>
164+
<compilerArgs>
165+
<source>${maven.compiler.source}</source>
166+
<target>${maven.compiler.target}</target>
167+
<arg>--add-exports</arg>
168+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
169+
<arg>--add-opens</arg>
170+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
171+
</compilerArgs>
172+
</configuration>
163173
<executions>
164174
<!-- Replacing default-compile as it is treated specially by maven -->
165175
<execution>
@@ -182,10 +192,6 @@
182192
<goals> <goal>testCompile</goal> </goals>
183193
</execution>
184194
</executions>
185-
<configuration>
186-
<source>${java.version}</source>
187-
<target>${java.version}</target>
188-
</configuration>
189195
</plugin>
190196
</plugins>
191197
</pluginManagement>

omnihub/pom.xml

+17-10
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
<junit.version>5.8.0-M1</junit.version>
2323
<junit.platform.launcher.version>1.8.0-M1</junit.platform.launcher.version>
2424
<junit-jupiter.version>5.4.2</junit-jupiter.version>
25-
<java.version>1.8</java.version>
25+
<java.version>11</java.version>
2626
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
27-
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
27+
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
2828
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
2929
<module.name>omnihub</module.name>
3030
</properties>
@@ -157,10 +157,10 @@
157157
<build>
158158
<plugins>
159159

160-
<!-- <plugin>
161-
<groupId>org.moditect</groupId>
162-
<artifactId>moditect-maven-plugin</artifactId>
163-
</plugin>-->
160+
<!-- <plugin>
161+
<groupId>org.moditect</groupId>
162+
<artifactId>moditect-maven-plugin</artifactId>
163+
</plugin>-->
164164

165165
<plugin>
166166
<groupId>org.codehaus.mojo</groupId>
@@ -286,7 +286,7 @@
286286
<plugin>
287287
<groupId>org.apache.maven.plugins</groupId>
288288
<artifactId>maven-compiler-plugin</artifactId>
289-
<version>3.5.1</version>
289+
<version>3.8.1</version>
290290
<executions>
291291
<!-- Replacing default-compile as it is treated specially by maven -->
292292
<execution>
@@ -306,12 +306,19 @@
306306
<execution>
307307
<id>java-test-compile</id>
308308
<phase>test-compile</phase>
309-
<goals> <goal>testCompile</goal> </goals>
309+
<goals> <goal>testCompile</goal>
310+
</goals>
310311
</execution>
311312
</executions>
312313
<configuration>
313-
<source>${java.version}</source>
314-
<target>${java.version}</target>
314+
<source>${maven.compiler.source}</source>
315+
<target>${maven.compiler.target}</target>
316+
<compilerArgs>
317+
<arg>--add-exports</arg>
318+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
319+
<arg>--add-opens</arg>
320+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
321+
</compilerArgs>
315322
</configuration>
316323
</plugin>
317324
</plugins>

platform-tests/pom.xml

+13-7
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@
5656
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
5757

5858
<kotlin.version>1.4.30</kotlin.version>
59-
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
59+
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
6060
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
6161
<junit.version>5.8.0-M1</junit.version>
6262
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6363
<lz4.version>1.8.0</lz4.version>
6464

6565

66-
<java.version>1.8</java.version>
66+
<java.version>11</java.version>
6767
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
6868
<log4j2.version>2.17.2</log4j2.version>
6969
<netty.version>4.1.74.Final</netty.version>
@@ -658,6 +658,16 @@
658658
<groupId>org.apache.maven.plugins</groupId>
659659
<artifactId>maven-compiler-plugin</artifactId>
660660
<version>${maven-compiler-plugin.version}</version>
661+
<configuration>
662+
<source>${java.version}</source>
663+
<target>${java.version}</target>
664+
<compilerArgs>
665+
<arg>--add-exports</arg>
666+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
667+
<arg>--add-opens</arg>
668+
<arg>java.base/java.nio=ALL-UNNAMED</arg>
669+
</compilerArgs>
670+
</configuration>
661671
<executions>
662672
<!-- Replacing default-compile as it is treated specially by maven -->
663673
<execution>
@@ -684,10 +694,6 @@
684694
</goals>
685695
</execution>
686696
</executions>
687-
<configuration>
688-
<source>${java.version}</source>
689-
<target>${java.version}</target>
690-
</configuration>
691697
</plugin>
692698

693699

@@ -823,7 +829,7 @@
823829
</classpathDependencyExclude>
824830
</classpathDependencyExcludes>
825831
<useManifestOnlyJar>false</useManifestOnlyJar>
826-
<argLine>-Dorg.nd4j.arraynogc=${test.nogc} -Dorg.bytedeco.javacpp.logger.debug=true -Dorg.bytedeco.javacpp.nopointergc=${test.nogc} -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size} </argLine>
832+
<argLine> --add-exports java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dorg.nd4j.arraynogc=${test.nogc} -Dorg.bytedeco.javacpp.logger.debug=true -Dorg.bytedeco.javacpp.nopointergc=${test.nogc} -Xmx${test.heap.size} -Dorg.bytedeco.javacpp.maxphysicalbytes=${test.offheap.size} -Dorg.bytedeco.javacpp.maxbytes=${test.offheap.size} </argLine>
827833
<forkedProcessTimeoutInSeconds>240</forkedProcessTimeoutInSeconds>
828834
<forkedProcessExitTimeoutInSeconds>240</forkedProcessExitTimeoutInSeconds>
829835
<parallelTestsTimeoutInSeconds>240</parallelTestsTimeoutInSeconds>

platform-tests/src/test/java/org/eclipse/deeplearning4j/dl4jcore/datasets/iterator/DummyBlockDataSetIteratorTests.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import lombok.extern.slf4j.Slf4j;
2424
import lombok.val;
25-
import lombok.var;
2625
import org.deeplearning4j.BaseDL4JTest;
2726
import org.deeplearning4j.datasets.iterator.DummyBlockDataSetIterator;
2827
import org.eclipse.deeplearning4j.dl4jcore.datasets.iterator.tools.SimpleVariableGenerator;

platform-tests/src/test/java/org/eclipse/deeplearning4j/nd4j/autodiff/opvalidation/TestMiscOpValidation.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import lombok.extern.slf4j.Slf4j;
2424
import lombok.val;
25-
import lombok.var;
2625
import org.datavec.api.records.reader.RecordReader;
2726
import org.datavec.api.records.reader.impl.collection.CollectionRecordReader;
2827
import org.datavec.api.writable.IntWritable;

platform-tests/src/test/java/org/eclipse/deeplearning4j/nd4j/linalg/Nd4jTestsC.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import lombok.extern.slf4j.Slf4j;
2424
import lombok.val;
25-
import lombok.var;
2625
import org.apache.commons.io.FilenameUtils;
2726
import org.apache.commons.math3.stat.descriptive.rank.Percentile;
2827
import org.apache.commons.math3.util.FastMath;

0 commit comments

Comments
 (0)