Skip to content

Commit

Permalink
Merge pull request #2940 from matsim-org/jogl
Browse files Browse the repository at this point in the history
Jogl
  • Loading branch information
kainagel authored Nov 17, 2023
2 parents cf073d4 + e62e4b4 commit c262911
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 86 deletions.
166 changes: 95 additions & 71 deletions contribs/otfvis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
<exclude>**/*$*</exclude> <!-- exclude all inner classes -->
<exclude>org/matsim/vis/otfvis/checklists/**/*.java</exclude> <!-- manual otfvis tests -->
</excludes>
<forkMode>once</forkMode>

<!-- <forkMode>once</forkMode>-->
<!-- (no longer exists. kai, nov'23) -->

<!-- avoid out of memory errors: -->
<argLine>-Xmx700m -Djava.awt.headless=true</argLine>
<enableAssertions>false</enableAssertions> <!-- this should be set to true, but we still have some tests that don't
Expand All @@ -28,98 +31,119 @@
<artifactId>otfvis</artifactId>
<name>otfvis</name>
<properties>
<jogl.version>2.4.0-matsim-1</jogl.version>
<!-- The jogl version is given in the pom.xml at the matsim-all level. kai, nov'23-->

<!-- <jogl.version>2.5.0</jogl.version>-->
<!-- (This is already in the pom.xml of matsim-all. kai, nov'23)-->

<!-- <jogl.version>2.4.0-matsim-1</jogl.version>-->
<!-- (This version has problems with the mac osx ARM architecture. One can make it work when using an x86 implementation of Java ... it-->
<!-- then presumably runs via Rosetta and presumably more slowly than it could otherwise. kai, nov'23)-->

<!-- <jogl.version>v2.4.0-rc4</jogl.version>-->
<!-- For me, this fails with java.lang.UnsatisfiedLinkError: Can't load library:-->
<!-- (For me, this fails with java.lang.UnsatisfiedLinkError: Can't load library:-->
<!-- /Users/kainagel/git/matsim-all/code-examples-matsim/natives/macosx-universal/gluegen_rt. Don't know if this means that I have to-->
<!-- install something locally; I seem to remember that for the "matsim" release we were able to do without that. kai, jan'23-->
<!-- install something locally; I seem to remember that for the "matsim" release we were able to do without that. kai, jan'23) -->

</properties>

<repositories>
<repository>
<id>jogl</id>
<url>https://jogamp.org/deployment/maven/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>net.java.dev.timingframework</groupId>
<artifactId>timingframework</artifactId>
<version>1.0</version>
</dependency>

<!-- Using the -main version means that the native libraries are loaded automagically. See-->
<!-- https://jogamp.org/wiki/index.php/Maven#Add_dependencies_on_the_correct_packages-->
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-macosx-universal</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-i586</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-i586</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-amd64</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<artifactId>gluegen-rt-main</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-amd64</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-macosx-universal</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-i586</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-i586</classifier>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-amd64</classifier>
</dependency>
<!-- (This is already in pom.xml of matsim-all. kai, nov'23)-->



<!-- <dependency>-->
<!-- <groupId>org.jogamp.gluegen</groupId>-->
<!-- <artifactId>gluegen-rt</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-macosx-universal</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.gluegen</groupId>-->
<!-- <artifactId>gluegen-rt</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-linux-i586</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.gluegen</groupId>-->
<!-- <artifactId>gluegen-rt</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-windows-i586</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.gluegen</groupId>-->
<!-- <artifactId>gluegen-rt</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-windows-amd64</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.gluegen</groupId>-->
<!-- <artifactId>gluegen-rt</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-linux-amd64</classifier>-->
<!-- </dependency>-->

<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<artifactId>jogl-all-main</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-amd64</classifier>
</dependency>
<!-- (This is already in pom.xml of matsim-all. kai, nov'23)-->

<!-- <dependency>-->
<!-- <groupId>org.jogamp.jogl</groupId>-->
<!-- <artifactId>jogl-all</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-macosx-universal</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.jogl</groupId>-->
<!-- <artifactId>jogl-all</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-linux-i586</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.jogl</groupId>-->
<!-- <artifactId>jogl-all</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-windows-i586</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.jogl</groupId>-->
<!-- <artifactId>jogl-all</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-windows-amd64</classifier>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.jogl</groupId>-->
<!-- <artifactId>jogl-all</artifactId>-->
<!-- <version>${jogl.version}</version>-->
<!-- <classifier>natives-linux-amd64</classifier>-->
<!-- </dependency>-->
<dependency>
<groupId>org.jxmapviewer</groupId>
<artifactId>jxmapviewer2</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.matsim</groupId>
<artifactId>matsim</artifactId>
<version>16.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ public OTFVisFrame(Component canvas, OTFServer server, OTFControlBar controlBar,
buildMenu(saver);
log.info("created HostControlBar");
log.info("created drawer");

log.warn("under win, the following tends to fail with com.jogamp.opengl.GLException: ");
log.warn("Unable to determine GraphicsConfiguration: WindowsWGLGraphicsConfiguration ...");
log.warn("It then seems to help to add the following to the Java VM options: ");
log.warn("--add-exports java.base/java.lang=ALL-UNNAMED");
log.warn("--add-exports java.desktop/sun.awt=ALL-UNNAMED");
log.warn("--add-exports java.desktop/sun.java2d=ALL-UNNAMED");
log.warn("See https://github.com/matsim-org/matsim-libs/pull/2940 and/or https://jogamp.org/bugzilla/show_bug.cgi?id=1317#c21 .");

getContentPane().add(compositePanel, BorderLayout.CENTER);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class T0_RunWithQSim {

public static void main(String[] args) {
OTFVis.playConfig("test/scenarios/equil/config-qsim.xml");
OTFVis.playConfig("contribs/otfvis/test/scenarios/equil/config-qsim.xml");
}

}
30 changes: 20 additions & 10 deletions contribs/vsp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
<artifactId>vsp</artifactId>
<name>vsp</name>

<repositories>
<repository>
<id>jogl</id>
<url>https://jogamp.org/deployment/maven/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.matsim.contrib</groupId>
Expand Down Expand Up @@ -74,16 +81,19 @@
<!-- <artifactId>core</artifactId>-->
<!-- <version>3.0.1</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
<version>2.3.2</version>
</dependency>

<!-- <dependency>-->
<!-- <groupId>org.jogamp.gluegen</groupId>-->
<!-- <artifactId>gluegen-rt-main</artifactId>-->
<!-- <version>2.3.2</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jogamp.jogl</groupId>-->
<!-- <artifactId>jogl-all-main</artifactId>-->
<!-- <version>2.3.2</version>-->
<!-- </dependency>-->
<!-- (Do not repeat the jogl dependencies. They are defined in contrib/otfvis/pom.xml (and enforced from matsim-all/pom.xml). kai, nov'23)-->

<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>otfvis</artifactId>
Expand Down
22 changes: 18 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<jts.version>1.19.0</jts.version>
<guice.version>7.0.0</guice.version>
<jackson.version>2.16.0</jackson.version>
<jogl.version>2.5.0</jogl.version>
</properties>

<scm>
Expand All @@ -56,10 +57,17 @@
<enabled>true</enabled>
</releases>
</repository>

<repository>
<id>matsim</id>
<url>https://repo.matsim.org/repository/matsim</url>
</repository>

<repository>
<id>jogl</id>
<url>https://jogamp.org/deployment/maven/</url>
</repository>

</repositories>

<distributionManagement>
Expand Down Expand Up @@ -250,16 +258,22 @@
<version>3.0.2</version>
</dependency>

<!-- Using the -main version means that the native libraries are loaded automagically. See-->
<!-- https://jogamp.org/wiki/index.php/Maven#Add_dependencies_on_the_correct_packages-->
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>2.4.0-matsim-1</version>
<!-- <artifactId>gluegen-rt</artifactId>-->
<artifactId>gluegen-rt-main</artifactId>
<!-- <version>2.4.0-matsim-1</version>-->
<version>${jogl.version}</version>
</dependency>

<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>2.4.0-matsim-1</version>
<!-- <artifactId>jogl-all</artifactId>-->
<artifactId>jogl-all-main</artifactId>
<!-- <version>2.4.0-matsim-1</version>-->
<version>${jogl.version}</version>
</dependency>

<dependency>
Expand Down

0 comments on commit c262911

Please sign in to comment.