<div dir="ltr">There is no jextract for JDK 20 or Panama JDK20 Preview API with the Arena refactor available at the moment, you'll have to build both of them from source unfortunately<div>The OpenJDK 20 EA26 builds don't contain the Arena changes or the jextract tool</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 28, 2022 at 11:24 AM Martin Pernollet <<a href="mailto:martin.pernollet@protonmail.com">martin.pernollet@protonmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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">About JExtract containing samples seamingly to JDK20 : where can I find JDK20 for Panama? </div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">I just downloaded <a href="https://jdk.java.net/20/" title="JDK20 EA Build here" target="_blank">JDK20 EA Build here</a> but jextract was not part of the distribution.</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">Thanks,</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">Martin</div><div style="font-family:Arial;font-size:14px"><br></div>
<div style="font-family:Arial;font-size:14px">
<div>
</div>
<div>
Envoyé avec la messagerie sécurisée <a href="https://proton.me/" rel="noopener noreferrer" target="_blank">Proton Mail</a>.
</div>
</div>
<div style="font-family:Arial;font-size:14px"><br></div><div>
------- Original Message -------<br>
Le mercredi 28 décembre 2022 à 17:01, Martin Pernollet <<a href="mailto:martin.pernollet@protonmail.com" target="_blank">martin.pernollet@protonmail.com</a>> a écrit :<br><br>
<blockquote type="cite">
<div style="font-family:Arial;font-size:14px">Thank you. I know these documents and rather lacks complete exemples that can work for an identified JDK version.</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">I went back to JExtract samples, especially the opengl <a title="teapot" href="https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java" rel="noreferrer nofollow noopener" target="_blank">teapot</a>, but I can't compile it with JDK 19... seamingly the <a title="imports refer to the JDK 20 package names" href="https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java#L32" rel="noreferrer nofollow noopener" target="_blank">imports refer to the JDK 20 package names</a>.</div><div style="font-family:Arial;font-size:14px"><br></div><div style="font-family:Arial;font-size:14px">What I still miss is <p style="margin:0px;font:12px Helvetica;color:rgb(128,128,128)">import static jdk.incubator.foreign.CLinker.C_INT</p><p style="margin:0px;font:12px Helvetica;color:rgb(128,128,128)"><br></p><p style="margin:0px;font:12px Helvetica;color:rgb(128,128,128)"><span style="font-family:Arial;font-size:14px;color:rgb(0,0,0)">and other C_TYPE. </span></p><p style="margin:0px;font:12px Helvetica;color:rgb(128,128,128)"><span style="font-family:Arial;font-size:14px;color:rgb(0,0,0)"><br></span></p><p style="margin:0px;font:12px Helvetica;color:rgb(128,128,128)"><span style="font-family:Arial;font-size:14px;color:rgb(0,0,0)">They where static constants in JDK17 but then have gone. Where should we find this as of JDK19?</span></p></div><div style="font-family:Arial;font-size:14px"><div><br></div><div>Thanks in advance!</div><div><br></div></div><div>
------- Original Message -------<br>
Le mercredi 28 décembre 2022 à 14:34, Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com" target="_blank">maurizio.cimadamore@oracle.com</a>> a écrit :<br><br>
<blockquote type="cite">
<p>Hi,<br>
I suggest you start looking at some of the documents we have
available to get started - for JDK 19 you can look here:</p>
<p><a rel="noreferrer nofollow noopener" href="https://github.com/openjdk/panama-foreign/blob/21452ec32b27ba906ec06253e4a7af9037728174/doc/panama_memaccess.md" target="_blank">https://github.com/openjdk/panama-foreign/blob/21452ec32b27ba906ec06253e4a7af9037728174/doc/panama_memaccess.md</a></p>
<p>In short, you always need to provide a layout constant of the
right kind when doing allocation using an allocator (and also when
doing dereference).</p>
<p>Value layout constants are provided in the ValueLayout class
(e.g. ValueLayout.JAVA_DOUBLE).</p>
<p>If you use jextract, additional constants (e.g. C_INT, C_LONG,
...) will be provided.<br>
</p>
<div>On 23/12/2022 16: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:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace"><span style="color:rgb(152,118,170)">locator</span>.allocateArray(<span style="color:rgb(204,120,50)">new </span>ValueLayout.OfDouble(</pre>
, and deal with all other datatypes, strings, etc).</div>
<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>Apple M1 is mostly supported on JDK 19 - modulo few corner cases
which have been addressed in Java 20.</p>
<p>Maurizio<br>
</p>
<blockquote type="cite">
<div style="font-family:Arial;font-size:14px"><br>
</div>
<div style="font-family:Arial;font-size:14px">
<div> </div>
<div>Regards,</div>
<div><br>
</div>
<div>Martin</div>
</div>
</blockquote>
</blockquote><br>
</div>
</blockquote><br>
</div></blockquote></div>