From Panama 17 to 19, ability to get M1?

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Jan 20 22:00:50 UTC 2023


That is odd - all the functions should be there and generated statically 
- there's nothing dynamic going on.

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.

But that doesn't explain the other errors on the more plain 
glutDisplayFunc - those symbols should be there.

(btw, all of this works on Linux).

Maurizio

On 20/01/2023 19:09, Martin Pernollet wrote:
> 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://urldefense.com/v3/__https://github.com/openjdk/jextract/blob/master/samples/opengl/Teapot.java*L82__;Iw!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS8Oin0GzQ$> 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://urldefense.com/v3/__https://proton.me/__;!!ACWV5N9M2RV99hQ!KHDR-GSa3Kh7FBYMI8DbfdImUc9um9r4usRG4l50tL0MiYsh0GfVPDgkxkfyhmjiQ33KB1BfFVzbsQdGNoUX5YCUFQ3nWS_6VosVXA$>. 
>>>
>>>
>>> ------- Original Message -------
>>> Le lundi 2 janvier 2023 à 11:57, Jorn Vernee 
>>> <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/55bd2cc2/attachment-0001.htm>
-------------- 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/55bd2cc2/image-0002.png>
-------------- 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/55bd2cc2/image-0003.png>


More information about the panama-dev mailing list