<div style="font-family: Arial; font-size: 14px;">Stupid me! One year ago we discussed this and the solution was to use $func on macOS instead of $callback on Linux. I do not remember the reason for this, but that would be handy to have a single name pattern across all OS :)</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">So thanks to your help I succeeded bumping to JDK19 an can run all tests and demos of PanamaGL on macOS. </div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Now a last issue - probably my IDE rather than FFM/JExtract but maybe you have a suggestion : </div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;"><p style="margin:0px;font:12px Helvetica;color:rgb(225, 30, 70)">Error: LinkageError occurred while loading main class demos.panamagl.macos.swing.DemoTeapot_Onscreen_macOS_Swing</p><p style="margin:0px;font:12px Helvetica;color:rgb(225, 30, 70)"><span style="white-space:pre"> </span>java.lang.UnsupportedClassVersionError: demos/panamagl/macos/swing/DemoTeapot_Onscreen_macOS_Swing (class file version 61.65535) was compiled with preview features that are unsupported. This version of the Java Runtime only recognizes preview features for class file version 63.65535</p> </div><div style="font-family: Arial; font-size: 14px;">Is triggered as soon as I edit a file that depend on a maven artifact containing the bindings. </div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">To avoid this, I clean install the module containing the demo and this fix it.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">My Eclipse IDE is configured for using JDK 19.0.2 like Maven, and I am sure I depend on bindings built with JDK 19.0.2.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Would you at least confirm if those class file are related to JDK 17 and 19? </div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Cheers,</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Martin</div><div class="protonmail_quote">
------- Original Message -------<br>
Le vendredi 20 janvier 2023 à 23:00, Maurizio Cimadamore <maurizio.cimadamore@oracle.com> a écrit :<br><br>
<blockquote class="protonmail_quote" type="cite">
<p>That is odd - all the functions should be there and generated
statically - there's nothing dynamic going on.</p>
<p>That said, I seem to recall that the name of
"glutIdleFunc$callback" really depends on the version of glut you
are using. In some the parameter is called "callback" in others is
called in some other way, so the binding will be diiferent.</p>
<p>But that doesn't explain the other errors on the more plain
glutDisplayFunc - those symbols should be there.</p>
<p>(btw, all of this works on Linux).</p>
<p>Maurizio<br>
</p>
<div class="moz-cite-prefix">On 20/01/2023 19:09, Martin Pernollet
wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;">Thank you, that
was indeed confusing but this now "works".</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">One last point
that I could not figure out is why I can't build this : </div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;"><img alt="image.png" class="proton-embedded" src="cid:part1.gPjI23ft.H5hRJY2t@oracle.com"><br>
</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">If you don't get
the image, <a target="_blank" rel="noreferrer nofollow noopener" href="https://urldefense.com/v3/__https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java*L82__;Iw!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8Oin0GzQ$" title="this line of the teapot">this line of the teapot</a> can't build
saying :</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">glutDisplayFunc#callback
cannot be resolved</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">I only found in
generated source glut_h_3</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">
<p style="margin:0px;font:12px Helvetica;color:rgb(30, 181, 64)"><span style="color:rgb(204, 108, 29)">public</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(204, 108, 29)">static</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(62, 171, 230)">MethodHandle</span><span style="color:rgb(217, 232, 247)"> </span>glutDisplayFunc$MH<span style="color:rgb(249, 250, 244)">()</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(249, 250, 244)">{</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(18, 144,
195)"><span style="color:rgb(217, 232, 247)"><span> </span></span><span style="color:rgb(204, 108, 29)">return</span><span style="color:rgb(217, 232, 247)"> </span>RuntimeHelper<span style="color:rgb(230, 230, 250)">.</span><span style="color:rgb(150, 236, 63)"><i>requireNonNull</i></span><span style="color:rgb(249, 250, 244)">(</span>constants$185<span style="color:rgb(230, 230, 250)">.</span><span style="color:rgb(141, 218, 248)"><b><i>glutDisplayFunc$MH</i></b></span><span style="color:rgb(230, 230, 250)">,</span><span style="color:rgb(23, 198, 163)">"glutDisplayFunc"</span><span style="color:rgb(249, 250, 244)">)</span><span style="color:rgb(230, 230, 250)">;</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(217, 232,
247)"><span> </span><span style="color:rgb(249, 250, 244)">}</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(204, 108,
29)"><span style="color:rgb(217, 232, 247)"><span> </span></span>public<span style="color:rgb(217, 232, 247)"> </span>static<span style="color:rgb(217, 232, 247)"> </span>void<span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(30, 181, 64)">glutDisplayFunc</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(249, 250, 244)">(</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(128, 242, 246)">Addressable</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(121, 171, 255)">func</span><span style="color:rgb(249, 250, 244)">)</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(249, 250, 244)">{</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(150, 236,
63)"><span style="color:rgb(217, 232, 247)"><span> </span></span><span style="color:rgb(204, 108, 29)">var</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(242, 242, 0)">mh$</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(230, 230, 250)">=</span><span style="color:rgb(217, 232, 247)"> </span><i>glutDisplayFunc$MH</i><span style="color:rgb(249, 250, 244)">()</span><span style="color:rgb(230, 230, 250)">;</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(217, 232,
247)"><span> </span><span style="color:rgb(204, 108,
29)">try</span> <span style="color:rgb(249, 250, 244)">{</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(217, 232,
247)"><span> </span><span style="color:rgb(243,
236, 121)">mh$</span><span style="color:rgb(230, 230, 250)">.</span><span style="color:rgb(167, 236, 33)">invokeExact</span><span style="color:rgb(249, 250, 244)">(</span><span style="color:rgb(121, 171, 255)">func</span><span style="color:rgb(249, 250, 244)">)</span><span style="color:rgb(230, 230, 250)">;</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(217, 232,
247)"><span> </span><span style="color:rgb(249, 250,
244)">}</span> <span style="color:rgb(204, 108, 29)">catch</span>
<span style="color:rgb(249, 250, 244)">(</span><span style="color:rgb(18, 144, 195)">Throwable</span> <span style="color:rgb(242, 242, 0)">ex$</span><span style="color:rgb(249, 250, 244)">)</span> <span style="color:rgb(249, 250, 244)">{</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(23, 198,
163)"><span style="color:rgb(217, 232, 247)"><span>
</span></span><span style="color:rgb(204, 108, 29)">throw</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(204, 108, 29)">new</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(167, 236, 33)">AssertionError</span><span style="color:rgb(249, 250, 244)">(</span>"should not reach
here"<span style="color:rgb(230, 230, 250)">,</span><span style="color:rgb(217, 232, 247)"> </span><span style="color:rgb(243, 236, 121)">ex$</span><span style="color:rgb(249, 250, 244)">)</span><span style="color:rgb(230, 230, 250)">;</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(217, 232,
247)"><span> </span><span style="color:rgb(249, 250,
244)">}</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(217, 232,
247)"><span> </span><span style="color:rgb(249, 250, 244)">}</span></p>
And no glutDisplayFunc$callback (<span>But this was seamingly
the same with version 17)</span><br>
<span></span></div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">Should I expect
a function to be named this way or is this something dynamic I
am missing?</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">Any hint
appreciated :)</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">Martin</div>
<div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div class="protonmail_quote"> ------- Original Message -------<br>
Le vendredi 20 janvier 2023 à 18:59, Maurizio Cimadamore
<a href="mailto:maurizio.cimadamore@oracle.com" class="moz-txt-link-rfc2396E" rel="noreferrer nofollow noopener" target="_blank"><maurizio.cimadamore@oracle.com></a> a écrit :<br>
<br>
<blockquote class="protonmail_quote" type="cite">
<p>Please, get jextract from here:</p>
<p><a href="https://urldefense.com/v3/__https://jdk.java.net/jextract/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8IP6L77Q$" class="moz-txt-link-freetext" rel="noreferrer nofollow noopener" target="_blank">https://jdk.java.net/jextract/</a></p>
<p>And JDK 19 from here:</p>
<p><a href="https://urldefense.com/v3/__https://jdk.java.net/19/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8E0vIwhA$" class="moz-txt-link-freetext" rel="noreferrer nofollow noopener" target="_blank">https://jdk.java.net/19/</a></p>
<p>These two should work well together.</p>
<p>The Panama early access binaries are now obsolete, and
should not be used. In fact, I think it might be time to
remove them, as they are a constant source of confusion.</p>
<p>Cheers<br>
Maurizio<br>
</p>
<div class="moz-cite-prefix">On 20/01/2023 17:54, Martin
Pernollet wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;">Hi all,</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">Just tried
to switch to JExtract samples for JDK 19. I am suprised by
the fact that the following imports shown in the JExtract
Teapot sample (on master banch, hence v19) can't be
resolved</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">
<p style="margin:0px;font:12px Helvetica;color:rgb(217,
232, 247)"><span style="color:rgb(204, 108, 29)">import</span>
<span style="text-decoration:underline">java</span><span style="text-decoration:underline;color:rgb(230, 230,
250)">.</span><span style="text-decoration:underline">lang</span><span style="text-decoration:underline;color:rgb(230, 230,
250)">.</span><span style="text-decoration:underline">foreign</span><span style="color:rgb(230, 230, 250)">.</span>MemorySession<span style="color:rgb(230, 230, 250)">;</span></p>
<p style="margin:0px;font:12px Helvetica;color:rgb(217,
232, 247)"><span style="color:rgb(204, 108, 29)">import</span>
<span style="text-decoration:underline">java</span><span style="text-decoration:underline;color:rgb(230, 230,
250)">.</span><span style="text-decoration:underline">lang</span><span style="text-decoration:underline;color:rgb(230, 230,
250)">.</span><span style="text-decoration:underline">foreign</span><span style="color:rgb(230, 230, 250)">.</span>SegmentAllocator<span style="color:rgb(230, 230, 250)">;</span></p>
<br>
</div>
<div style="font-family: Arial; font-size: 14px;">And
indeed, as shown by this picture, java.lang has no foreign
subfolder in JDK 19</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;"><img class="proton-embedded" alt="image.png" src="cid:part2.lpH7ObgJ.00COq7re@oracle.com"><br>
</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">However, I
found foreign packages to still appear in jdk.incubator
module.</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">May this
be due to me downloading JDK19 from the panama page? <span><a class="moz-txt-link-freetext" href="https://urldefense.com/v3/__https://jdk.java.net/panama/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8hi7axdQ$" rel="noreferrer nofollow noopener" target="_blank">https://jdk.java.net/panama/</a></span></div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family:
Arial; font-size: 14px;" class="protonmail_signature_block">
<div class="protonmail_signature_block-user
protonmail_signature_block-empty"> </div>
<div class="protonmail_signature_block-proton"> Envoyé
avec la messagerie sécurisée <a rel="noreferrer nofollow noopener" href="https://urldefense.com/v3/__https://proton.me/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS_6VosVXA$" target="_blank">Proton Mail</a>. </div>
</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div class="protonmail_quote"> ------- Original Message
-------<br>
Le lundi 2 janvier 2023 à 11:57, Jorn Vernee <a href="mailto:jorn.vernee@oracle.com" class="moz-txt-link-rfc2396E" rel="noreferrer nofollow noopener" target="_blank"><jorn.vernee@oracle.com></a>
a écrit :<br>
<br>
<blockquote type="cite" class="protonmail_quote">
<p>Hi Martin,<br>
</p>
<div class="moz-cite-prefix">On 23/12/2022 17:20, Martin
Pernollet wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;">Hi,</div>
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">Would
anyone suggest examples showing how to use Panama 19
instead of 17? A couple of things have changed (
e.g. how to use the new
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9,8pt"><span style="color:#9876aa">locator</span>.allocateArray(<span style="color:#cc7832">new </span>ValueLayout.OfDouble(</pre>
, and deal with all other datatypes, strings, etc).</div>
</blockquote>
The general idea is to either use one of the layout
constants in the ValueLayout class, such as JAVA_DOUBLE.
Or use a layout generated by jextract for a specific
type. For strings the type would be a pointer, so the
ValueLayout.ADDRESS layout or the C_POINTER layout
generated by jextract can be used for instance.<br>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">One
additional question : when will ARM be supported to
run panama on Apple M1? <br>
</div>
</blockquote>
<p>MacOs/AArch64 (i.e ARM) has been supported since Java
17 [1]<br>
</p>
<p>Jorn</p>
<p>[1]: <a target="_blank" rel="noreferrer nofollow noopener" class="moz-txt-link-freetext" href="https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/3617__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS-LQIElmg$">https://github.com/openjdk/jdk/pull/3617</a><br>
</p>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
<div class="protonmail_signature_block-user
protonmail_signature_block-empty"> </div>
<div class="protonmail_signature_block-proton">Regards,</div>
<div class="protonmail_signature_block-proton"><br>
</div>
<div class="protonmail_signature_block-proton">Martin</div>
</div>
</blockquote>
</blockquote>
<br>
</div>
</blockquote>
</blockquote>
<br>
</div>
</blockquote>
</blockquote><br>
</div>