[foreign-jextract] RFR 8237577 minimal jextract tool on jextract API

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Jan 22 12:42:03 UTC 2020


On 22/01/2020 02:31, Ty Young wrote:
>
> On 1/21/20 10:38 AM, Maurizio Cimadamore wrote:
>>
>> On 21/01/2020 16:32, Ty Young wrote:
>>>
>>> On 1/21/20 10:11 AM, Maurizio Cimadamore wrote:
>>>>
>>>> On 21/01/2020 16:09, Ty Young wrote:
>>>>>
>>>>> On 1/21/20 7:07 AM, sundararajan.athijegannathan at oracle.com wrote:
>>>>>> Please review.
>>>>>>
>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8237577
>>>>>>
>>>>>> Webrev: 
>>>>>> http://cr.openjdk.java.net/~sundar/minimal_jextract/webrev.00/index.html 
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> -Sundar
>>>>>>
>>>>>
>>>>> Is this the same jextract tool used to generate the clang code then?
>>>>
>>>> Yes - a bit more polished version of that.
>>>
>>>
>>> Nice!
>>>
>>>
>>> I assume the command line arguments are the same, correct?
>>
>> A lot of them have been removed - we'll start simple(r) and see what 
>> is really required. But usual commands like -L, -I apply. The 
>> filtering option got simpler and now just accepts a regex - so that 
>> only symbols defined in an header whose path matches the regex are 
>> actually included.
>>
>> Sundar will soon be adding more tests, so that it will be more clear 
>> how these options work.
>
>
> Right, NVML went from:
>
>
> jextract -t org.nvidia.nvml -L /usr/lib -lnvidia-ml 
> --record-library-path /opt/cuda/targets/x86_64-linux/include/nvml.h -o 
> org.nvidia.nvml.jar
>
>
> to:
>
>
> jextract -t org.nvidia.nvml -L /usr/lib -l nvidia-ml 
> /opt/cuda/targets/x86_64-linux/include/nvml.h
>
>
> So yeah, only slightly different... and there is no option to compile 
> directly to a jar. Not the end of the world but it would be nice if 
> the option was readded.
>
>
> So... first impressions are more or less what I've been expected: lots 
> of technical boilerplate. This result was inevitable anyway and isn't 
> surprising, TBH. Without a higher level abstraction I don't think I'm 
> personally going to be using this as-is. Hopefully the jextract API 
> really lets me improve things otherwise I think I'm going to do 
> everything myself so that the bindings more closely resemble the old API.
>
>
> Not only that but... it uses Linux Sysv layouts which may cause issues 
> on Windows. The expectation by Nvidia is that you build and compile 
> your software using the Linux headers on Linux and then adapt for 
> Windows(same library, different name and OS). The current jextract 
> behavior isn't desirable.

I believe that you should get Linux layouts if you extract on Linux - if 
you extract on Windows you should get the windows one. If this isn't 
happening then it's a bug.

Maurizio

>
>
> P.S. wasn't the ability to detect platform ABI added? What 
> module/package is it in?
>
>
>
>
>>
>> Maurizio
>>
>>>
>>>
>>>>
>>>> Maurizio
>>>>
>>>>>
>>>>>


More information about the panama-dev mailing list