gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
302 stars 99 forks source link

Choose which particular combination of JDK/SWT version to use for the displays of 1.8.2 release #3219

Closed AlexisDrogoul closed 2 years ago

AlexisDrogoul commented 2 years ago

It seems that, due to the relative deprecation of JOGL on one hand and the AWT-SWT bridge on the other, which both support our display technologies (OpenGL and Java2D), the choice of the JDK and SWT version on which to run GAMA is particularly sensitive. There have been reports of Java2D displays failing under JDK 11 on macOS, combination of JDK 17 and SWT 2021-06 that make JOGL fail, Java2D and OpenGL failing when used in combination under JDK 11, etc. It is a bit of a mess.

In terms of JDK, we can restrict ourselves to JDK 11 (latest version 11.0.12), in its hotspot or J9 incarnation, JDK 15.0.2 (proved to work quite well across the environments) and JDK 17 (which would allow us a long period of tranquility ahead, as it is a LTS version like JDK 11). That makes 4 choices.

Regarding the OSes, 3 are probably enough (although we might want to include the M1 architecture of macOS or some exotic flavours of Linux): macOS (BigSur, but w. Monterey to test), Windows 10 (with 11 to test), Ubuntu.

Finally, regarding the SWT versions, we can restrict to 3: 2021-03, 2021-06, 2021-09.

That makes around 4 3 3 = 36 combinations to test. !

Should we split the work ? (answers in comments please)

RoiArthurB commented 2 years ago
JDK 11 HotSpot JDK 11 OpenJ9 JDK 15 HotSpot JDK 15 OpenJ9 JDK 16 HotSpot JDK 16 OpenJ9
SWT 2021-03 ๐ŸชŸ? ๐ŸŽ? ๐Ÿง๐Ÿ‘ ๐ŸชŸ? ๐ŸŽ? ๐Ÿง๐Ÿ‘ ๐ŸชŸ? ๐ŸŽ? ๐Ÿง๐Ÿ‘ ๐ŸชŸ? ๐ŸŽ? ๐Ÿง๐Ÿ‘ ๐ŸชŸ? ๐ŸŽ? ๐Ÿง๐Ÿ‘ ๐ŸชŸ? ๐ŸŽ? ๐Ÿง๐Ÿ‘
SWT 2021-06 ๐ŸชŸ? ๐ŸŽ? ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽ? ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽ? ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽ? ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽ? ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽ? ๐ŸงโŒ
SWT 2021-09 ๐ŸชŸ? ๐ŸŽโŒ ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽโŒ ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽโŒ ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽ๐Ÿ‘ ๐ŸงโŒ ๐ŸชŸ? ๐ŸŽโŒ ๐Ÿง โŒ ๐ŸชŸ? ๐ŸŽโŒ ๐ŸงโŒ

Let's roll ๐Ÿค“๐Ÿค“๐Ÿค“


EDIT : Added JDK 16 and removed JDK 17 which isn't supported by Tycho yet (see here)

RoiArthurB commented 2 years ago

I'll make All this combinaison in this repo quickly : https://github.com/RoiArthurB/GAMA-182-test-builder, I'll comment back when releases will be ready :)

RoiArthurB commented 2 years ago

Here we go, you all can try above combination for each OS : https://github.com/RoiArthurB/GAMA-182-test-builder/releases/tag/latest

hqnghi88 commented 2 years ago

first remark on win 11 about j9, it create a big dump file , i just launch a model with 2 opengl display and it crash, maybe the problem of my machine. i report more detail later. image

AlexisDrogoul commented 2 years ago

Just to mention that Eclipse Temurin 17.01+12, the latest "AdoptOpenJDK" release, is out. Available here: https://adoptium.net . I have it successfully run the macOS version with the NEWT displays (with just one error, or so it seems, in reading the .plist), unfortunately not the one with the "regular" SWT OpenGL displays. So nothing really new, but I think it might be time to decide to move everything to JDK 17 (incl. the code base). @gama-platform/committers your thoughts ?

AlexisDrogoul commented 2 years ago

Eclipse Temurin 17.01+12 has also been tested on Windows 11 (with the NEWT displays) and so far so good...

RoiArthurB commented 2 years ago

@AlexisDrogoul the maven build fail with the new Temurin JDK 17. The problem comes from Tycho which (still) doens't support JDK 17 :/

Seems that tycho is release with Eclipse versions, so we have to wait for December...

AlexisDrogoul commented 2 years ago

Hi all. When testing the different combinations, can you please make sure to test at least the model below (and its 3 experiments) ?

model test

experiment parent_experiment virtual: true {
    rgb bg <- rnd_color(255);
    output {
        layout #split navigator: false consoles: false toolbars: true tabs: true;
        display "parent_display" virtual: true background:bg {
            chart "Population epidemiological states evolution" background: bg;
            graphics Title {
                draw "Test display" color: #black;
            }

        }
    }

}

experiment OpenGL type: gui parent: parent_experiment {
    output {
        display "first" parent: parent_display type: opengl {}
        display "second" parent: parent_display type: opengl {}
        display "third" parent: parent_display type: opengl {}
        display "fourth" parent: parent_display type: opengl {}     
        display "fifth" parent: parent_display type: opengl {}
    }
}

experiment Java2D type: gui parent: parent_experiment {
    output {
        display "first" parent: parent_display type: java2D {}
        display "second" parent: parent_display type: java2D {}
        display "third" parent: parent_display type: java2D {}
        display "fourth" parent: parent_display type: java2D {}     
        display "fifth" parent: parent_display type: java2D {}
    }
}

experiment Mixed type: gui parent: parent_experiment {
    output {
        display "first" parent: parent_display type: opengl {}
        display "second" parent: parent_display type: java2D {}
        display "third" parent: parent_display type: opengl {}
        display "fourth" parent: parent_display type: java2D {}     
        display "fifth" parent: parent_display type: opengl {}
    }
}

Thanks !

AlexisDrogoul commented 2 years ago

So far, all environments seem to work fine with :

Can you confirm this ?

RoiArthurB commented 2 years ago

Except the compilation... :roll_eyes: Still waiting for Tycho's new version

hqnghi88 commented 2 years ago

I confirm that combination work well on windows 11. @RoiArthurB did you push the snapshot of tycho? i hope there will have no big change, just an adaptation then, so the snapshot is nearly the pre-release you can use for gama release.

AlexisDrogoul commented 2 years ago

Just to mention in this thread that a new patched version of JOGL (normally working with M1/M2 processors) is maintained in https://github.com/jzy3d/jogl. I will try to incorporate it in GAMA and report there any incompatibilities ...

RoiArthurB commented 2 years ago

@AlexisDrogoul Any update of the new JOGL ? Maybe it can fix Linux's compatibility with SWT > 2021-03 (main problem not documented in this issue, but well experienced/tested by us)

AlexisDrogoul commented 2 years ago

I think it might be worth linking this to https://github.com/jzy3d/jogl/issues. Shall we post an issue ?

RoiArthurB commented 2 years ago

The new GAMA 1.8.2 with new JDK has been built and released here : https://github.com/gama-platform/gama/releases/tag/1.8.2 :partying_face::partying_face::partying_face:

Please, try your version and report your results below :smile:


EDIT : From my first quick test, the current build using JDK 17 LTS and Eclipse 2021-12 seems to have OpenGL displays broken... ๐Ÿ˜•๐Ÿ˜•

AlexisDrogoul commented 2 years ago

One strange bug (and even stranger workaround) with M1 processors / macOS Monterrey : https://bugs.eclipse.org/bugs/show_bug.cgi?id=578883

Putting it here for reference.

AlexisDrogoul commented 2 years ago

@RoiArthurB @lesquoyb Should we try to generate another round of binaries with Eclipse 2021-12 (or 2022-03) and JDK Temurin 17.0.2+8 ?

RoiArthurB commented 2 years ago
RoiArthurB commented 2 years ago

FYI : In case, I rebuild with every SWT over JDK 17 for each OS : https://github.com/RoiArthurB/GAMA-182-test-builder/releases/tag/latest Feel free to test them :)


EDIT : For an unknown reason, Gama.ini (at least on Linux) have some strange last lines... Please remove everything starting line 40 and below :

--add-opens
java.base/java.lang=ALL-UNNAMED
--add-exports
java.desktop/sun.awt=ALL-UNNAMED
java.desktop/sun.java2d=ALL-UNNAMED

@AlexisDrogoul does it look like anything you know ? ๐Ÿค”


EDIT 2 : Still same OpenGL problem with SWT 2022-03, and no problem on 2021-03 ๐Ÿคท๐Ÿคท๐Ÿคท

AlexisDrogoul commented 2 years ago

Yes -- these options have been added to the .product partly by Benoit (problem of libraries not loading) and myself (problem with JOGL).

By the way, with JDK 17 and Eclipse 2022-03, I think we have now a winner ! (cf. #3199 )

RoiArthurB commented 2 years ago

Hey, rebuild again with Alexis's latest commit, please try it over each OS to verify that it doesn't break anything for anyone ๐Ÿ™๐Ÿ™๐Ÿ™ https://github.com/RoiArthurB/GAMA-182-test-builder/releases

AlexisDrogoul commented 2 years ago

Closing this issue : JDK 17 Temurin is the winner. Thanks to all who tested !