From Panama 17 to 19, ability to get M1?
Martin Pernollet
martin.pernollet at protonmail.com
Fri Jan 20 19:09:49 UTC 2023
Thank you, that was indeed confusing but this now "works".
One last point that I could not figure out is why I can't build this :
[image.png]
If you don't get the image, [this line of the teapot](https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java#L82) can't build saying :
glutDisplayFunc#callback cannot be resolved
I only found in generated source glut_h_3
publicstaticMethodHandleglutDisplayFunc$MH(){
returnRuntimeHelper.requireNonNull(constants$185.glutDisplayFunc$MH,"glutDisplayFunc");
}
publicstaticvoidglutDisplayFunc(Addressablefunc){
varmh$=glutDisplayFunc$MH();
try {
mh$.invokeExact(func);
} catch (Throwable ex$) {
thrownewAssertionError("should not reach here",ex$);
}
}
And no glutDisplayFunc$callback (But this was seamingly the same with version 17)
Should I expect a function to be named this way or is this something dynamic I am missing?
Any hint appreciated :)
Martin
------- Original Message -------
Le vendredi 20 janvier 2023 à 18:59, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> a écrit :
> Please, get jextract from here:
>
> https://jdk.java.net/jextract/
>
> And JDK 19 from here:
>
> https://jdk.java.net/19/
>
> These two should work well together.
>
> 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.
>
> Cheers
> Maurizio
>
> On 20/01/2023 17:54, Martin Pernollet wrote:
>
>> Hi all,
>>
>> 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
>>
>> import java.lang.foreign.MemorySession;
>>
>> import java.lang.foreign.SegmentAllocator;
>>
>> And indeed, as shown by this picture, java.lang has no foreign subfolder in JDK 19
>>
>> [image.png]
>>
>> However, I found foreign packages to still appear in jdk.incubator module.
>>
>> May this be due to me downloading JDK19 from the panama page? https://jdk.java.net/panama/
>>
>> Envoyé avec la messagerie sécurisée [Proton Mail](https://proton.me/).
>>
>> ------- Original Message -------
>> Le lundi 2 janvier 2023 à 11:57, Jorn Vernee [<jorn.vernee at oracle.com>](mailto:jorn.vernee at oracle.com) a écrit :
>>
>>> Hi Martin,
>>>
>>> On 23/12/2022 17:20, Martin Pernollet wrote:
>>>
>>>> Hi,
>>>>
>>>> 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
>>>>
>>>> locator
>>>>
>>>> .allocateArray(
>>>>
>>>> new
>>>>
>>>> ValueLayout.OfDouble(
>>>>
>>>> , and deal with all other datatypes, strings, etc).
>>>
>>> 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.
>>>
>>>> One additional question : when will ARM be supported to run panama on Apple M1?
>>>
>>> MacOs/AArch64 (i.e ARM) has been supported since Java 17 [1]
>>>
>>> Jorn
>>>
>>> [1]: https://github.com/openjdk/jdk/pull/3617
>>>
>>>> Regards,
>>>>
>>>> Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230120/746261b1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 85092 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230120/746261b1/image-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 171721 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230120/746261b1/image-0003.png>
More information about the panama-dev
mailing list