Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add java-17-openjdk #5610

Merged
merged 12 commits into from
Feb 24, 2023
Merged

add java-17-openjdk #5610

merged 12 commits into from
Feb 24, 2023

Conversation

hgy59
Copy link
Contributor

@hgy59 hgy59 commented Feb 18, 2023

Description

create a package for Java 17 OpenJDK the current LTS version.

Closes #5605, Closes #4912

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • New Package

@hgy59 hgy59 force-pushed the add_openjdk17 branch 3 times, most recently from 1e090bc to 94b5654 Compare February 18, 2023 11:44
@hgy59 hgy59 mentioned this pull request Feb 18, 2023
6 tasks
@arnebjarne
Copy link
Contributor

arnebjarne commented Feb 18, 2023

I think you need

diff --git a/cross/java-17-openjdk/Makefile b/cross/java-17-openjdk/Makefile
index 650c442f..8e21dea2 100644
--- a/cross/java-17-openjdk/Makefile
+++ b/cross/java-17-openjdk/Makefile
@@ -42,6 +42,8 @@ PRE_COMPILE_TARGET = java-17-openjdk_pre_compile
 # Fix symlinks
 POST_INSTALL_TARGET = java-17-openjdk_post_compile

+include ../../mk/spksrc.archs.mk
+
 CONFIGURE_ARGS  = --openjdk-target=$(TC_TARGET)
 CONFIGURE_ARGS += --with-boot-jdk=$(WORK_DIR)/../../../native/openjdk-17/work-native/jdk-17
 CONFIGURE_ARGS += --with-version-build=$(JAVA_RELEASE)
@@ -58,8 +60,12 @@ CONFIGURE_ARGS += --with-libpng=system
 CONFIGURE_ARGS += --with-lcms=system
 CONFIGURE_ARGS += --with-stdc++lib=dynamic
 CONFIGURE_ARGS += --disable-javac-server
+ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH))
 CONFIGURE_ARGS += --with-jvm-variants=zero
+endif
+ifneq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH))
 CONFIGURE_ARGS += --with-jvm-features=shenandoahgc,-zgc
+endif
 CONFIGURE_ARGS += --disable-warnings-as-errors
 CONFIGURE_ARGS += --with-cups=$(INSTALL_DIR)/$(INSTALL_PREFIX)
 CONFIGURE_ARGS += --with-fontconfig=$(INSTALL_DIR)/$(INSTALL_PREFIX)

Since ZGC is not supported on ARM other than AARCH64. And for some reason Fedora only build zero on PPC platforms.

@hgy59
Copy link
Contributor Author

hgy59 commented Feb 18, 2023

I think you need

Thanks @arnebjarne, I have already fixed the build for 32-bit ARM (but not yet pushed, since I try to remove obsolete x-libraries first)
The PPC archs are obsolete, the last models with PPC arch are DS213+ and DS413 and there is no DSM 7 available for PPC.

@hgy59
Copy link
Contributor Author

hgy59 commented Feb 18, 2023

@arnebjarne in java-11-openjdk package we disabled ZGC for all packages and built the zero variant.

Is there any reason to build another jvm variant than zero?

IFAICR we choose the zero variant to minimize the package size.

EDIT:
the current build (x86_64) is:

Configuration summary:
* Name:           linux-x86_64-zero-release
* Debug level:    release
* HS debug level: product
* JVM variants:   zero
* JVM features:   zero: 'epsilongc g1gc jni-check jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs zero'
* OpenJDK target: OS: linux, CPU architecture: x86, address length: 64
* Version string: 17.0.6+7-LTS (17.0.6)

@arnebjarne
Copy link
Contributor

@arnebjarne in java-11-openjdk package we disabled ZGC for all packages and built the zero variant.

Is there any reason to build another jvm variant than zero?

IFAICR we choose the zero variant to minimize the package size.

--with-jvm-features=shenandoahgc,-zgc

Is a leftover from the Java 11 package. I cannot remember why i used the shenandoahgc GC - maybe its faster on SoC chips like ARM etc. I need to research that...

@arnebjarne
Copy link
Contributor

https://wiki.openjdk.org/display/shenandoah/Main#Main-JDKSupport

Ah, it was optional in Java 11. In Java 17 its standard so

CONFIGURE_ARGS += --with-jvm-features=shenandoahgc,-zgc

should be omitted.

@arnebjarne arnebjarne mentioned this pull request Feb 18, 2023
10 tasks
@mreid-tt
Copy link
Contributor

@hgy59, I've installed the java-17-openjdk_x64-7.1_17.0.6.9-1.spk on my DS916+ (VirtualDSM) running DSM 7.1.1-42962 Update 4. The installation log looked fairly normal (https://pastebin.com/6C3SbRLf). I was also able to confirm that java is running well with the following SSH session:

$ java --version
openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (build 17.0.6+9-LTS)
OpenJDK 64-Bit Server VM (build 17.0.6+9-LTS, mixed mode)

I also tested some of the simple Java programs from https://www.cs.uic.edu/~sloan/CLASSES/java/ and they worked file:

$ java HelloWorld.java 
Hello World!
$ java FunctionCall.java 
Inside main
Inside funct1
About to call funct2
Inside funct2 with param 8
funct2 returned a value of 16
About to call funct2 again
Inside funct2 with param -3
funct2 returned a value of -6

All in all it seems good to go.

@arnebjarne
Copy link
Contributor

@hgy59, I've installed the java-17-openjdk_x64-7.1_17.0.6.9-1.spk on my DS916+ (VirtualDSM) running DSM 7.1.1-42962 Update 4. The installation log looked fairly normal (https://pastebin.com/6C3SbRLf). I was also able to confirm that java is running well with the following SSH session:

$ java --version
openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (build 17.0.6+9-LTS)
OpenJDK 64-Bit Server VM (build 17.0.6+9-LTS, mixed mode)

I also tested some of the simple Java programs from https://www.cs.uic.edu/~sloan/CLASSES/java/ and they worked file:

$ java HelloWorld.java 
Hello World!
$ java FunctionCall.java 
Inside main
Inside funct1
About to call funct2
Inside funct2 with param 8
funct2 returned a value of 16
About to call funct2 again
Inside funct2 with param -3
funct2 returned a value of -6

All in all it seems good to go.

It would be interresting to see some execution times. I remember when i made the Java 11 version that speed was very different depending if I build server,hotspot or zero variant.

@mreid-tt
Copy link
Contributor

It would be interresting to see some execution times. I remember when i made the Java 11 version that speed was very different depending if I build server,hotspot or zero variant.

Do you have a specific test methodology in mind?

@hgy59
Copy link
Contributor Author

hgy59 commented Feb 19, 2023

It would be interresting to see some execution times. I remember when i made the Java 11 version that speed was very different depending if I build server,hotspot or zero variant.

Here are the results of a benchmark test of the latest build on my DS218+ with DSM 7.1.1-42962 Update 3 and 8GB RAM
Linux XXXXXX 4.4.180+ #42962 SMP Tue Oct 18 15:05:01 CST 2022 x86_64 GNU/Linux synology_apollolake_218+.

$ java jnt.scimark2.commandline

SciMark 2.0a

Composite Score: 785.3310522660255
FFT (1024): 486.1317522739512
SOR (100x100):   790.0594890915852
Monte Carlo : 334.81191713519564
Sparse matmult (N=1000, nz=5000): 615.3614692851966
LU (100x100): 1700.2906335441985

java.vendor: N/A
java.version: 17.0.6
os.arch: amd64
os.name: Linux
os.version: 4.4.180+

But I Have no reference to compare the results...

@mreid-tt
Copy link
Contributor

mreid-tt commented Feb 19, 2023

Adding to the results from my VirtualDSM:

openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (build 17.0.6+9-LTS)
OpenJDK 64-Bit Server VM (build 17.0.6+9-LTS, mixed mode)

$ java jnt.scimark2.commandline

SciMark 2.0a

Composite Score: 585.030324120158
FFT (1024): 308.8244627800061
SOR (100x100):   779.5125051960619
Monte Carlo : 237.97469060912437
Sparse matmult (N=1000, nz=5000): 406.92953053449213
LU (100x100): 1191.9104314811054

java.vendor: N/A
java.version: 17.0.6
os.arch: amd64
os.name: Linux
os.version: 4.4.180+

@hgy59
Copy link
Contributor Author

hgy59 commented Feb 19, 2023

The results with the current Java 11 OpenJDK (on the same NAS as above):

SciMark 2.0a

Composite Score: 17.639867473823365
FFT (1024): 7.672792693909747
SOR (100x100):   32.576328680042785
Monte Carlo : 3.189584652084032
Sparse matmult (N=1000, nz=5000): 15.735688597327623
LU (100x100): 29.024942745752647

java.vendor: Oracle Corporation
java.version: 11.0.12
os.arch: amd64
os.name: Linux

@hgy59
Copy link
Contributor Author

hgy59 commented Feb 19, 2023

@arnebjarne you are right, the server variant has much more performance than the zero variant:

still on the same NAS with the Zero VM:

openjdk version "17.0.6" 2023-01-17 LTS
OpenJDK Runtime Environment (build 17.0.6+7-LTS)
OpenJDK 64-Bit Zero VM (build 17.0.6+7-LTS, interpreted mode)

SciMark 2.0a

Composite Score: 14.407162070627725
FFT (1024): 6.730985387281214
SOR (100x100):   26.03430390984582
Monte Carlo : 2.832075498743714
Sparse matmult (N=1000, nz=5000): 15.851393972789094
LU (100x100): 20.58705158447879

java.vendor: N/A
java.version: 17.0.6
os.arch: amd64
os.name: Linux
os.version: 4.4.180+

@arnebjarne
Copy link
Contributor

Maybe snatch some building tricks from

https://github.com/adoptium/temurin-build

;)

@arnebjarne
Copy link
Contributor

arnebjarne commented Feb 19, 2023

Maybe snatch some building tricks from

https://github.com/adoptium/temurin-build

;)

Its worth to notice that Adoptium use the correct supported GCC 10.3 to compile Java and their default is to build the hotspot variant.

@mreid-tt
Copy link
Contributor

Updating feedback for current install... (log -- https://pastebin.com/uWN3szYq)

$ java --version
openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM (build 17.0.6+10-LTS, mixed mode)

Performance is fairly similar...

$ java jnt.scimark2.commandline

SciMark 2.0a

Composite Score: 590.4280737543511
FFT (1024): 317.5966145827671
SOR (100x100):   786.5122328555813
Monte Carlo : 241.9427423279763
Sparse matmult (N=1000, nz=5000): 405.79566323840925
LU (100x100): 1200.2931157670216

java.vendor: N/A
java.version: 17.0.6
os.arch: amd64
os.name: Linux
os.version: 4.4.180+

@arnebjarne
Copy link
Contributor

Speed comparison DS418

Compiled with target hotspot and feature=server

java --version

openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM (build 17.0.6+10-LTS, mixed mode)

java -classpath scimark2lib.jar jnt.scimark2.commandline

SciMark 2.0a

Composite Score: 205.78632413749855
FFT (1024): 120.55851467593463
SOR (100x100): 316.7250119924242
Monte Carlo : 106.47975634609791
Sparse matmult (N=1000, nz=5000): 134.90324463423264
LU (100x100): 350.2650930388034

java.vendor: N/A
java.version: 17.0.6
os.arch: aarch64
os.name: Linux
os.version: 4.4.180+

compiled with target hotspot, feature zero:

java --version
openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (build 17.0.6+10-LTS)
OpenJDK 64-Bit Zero VM (build 17.0.6+10-LTS, interpreted mode)

Composite Score: 8.368952648493377
FFT (1024): 4.858067620566487
SOR (100x100): 16.040848382013383
Monte Carlo : 1.475309214095528
Sparse matmult (N=1000, nz=5000): 8.519134619914277
LU (100x100): 10.951403405877205

java.vendor: N/A
java.version: 17.0.6
os.arch: aarch64
os.name: Linux
os.version: 4.4.180+

So staying away from zero is the way to go

BTW: @hgy59

--with-vendor-name=SynoCommunity
?

(hint sh ./work-*/jdk17u-jdk-17.0.6-10/build/.configure-support/generated-configure.sh --help for compile time arguments)

@arnebjarne
Copy link
Contributor

@hgy59

I have added all the Debian patches and it compiles

Check

arnebjarne@79c239d

- remove obsolete x-libraries
- fix build for 32-bit arm archs (shenandoahgc not supported)
- remove configure warnings: move arguments from environment to command line
- fix build of ARMv7
- remove build of jvm variant zero
@hgy59
Copy link
Contributor Author

hgy59 commented Feb 22, 2023

I finally updated my ds115j to DSM 7 - and I can confirm that #4912 is fixed with this OpenJDK 17 package.
and it runs the SciMark 2.0a with only 256MB:

SciMark 2.0a

Composite Score: 36.63173444921949
FFT (1024): 25.931265484995222
SOR (100x100):   47.621465366110336
Monte Carlo : 32.41974210833395
Sparse matmult (N=1000, nz=5000): 36.473730241166855
LU (100x100): 40.71246904549112

java.vendor: SynoCommunity
java.version: 17.0.6
os.arch: arm
os.name: Linux
os.version: 3.2.101

@hgy59 hgy59 merged commit 5a59224 into SynoCommunity:master Feb 24, 2023
@hgy59 hgy59 deleted the add_openjdk17 branch February 24, 2023 19:13
@hgy59 hgy59 added the status/published Published and activated (may take up to 48h until visible in DSM package manager) label Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Package Request] Java 17 OpenJDK - New LTS Version of Java OpenJDK 11 broken on armada38x
3 participants