Project Panama & dynamic library loading

Ty Young youngty1997 at gmail.com
Fri Sep 6 23:58:43 UTC 2019


On 9/6/19 6:36 PM, Ty Young wrote:
>
>
> On Fri, Sep 6, 2019 at 6:34 PM, Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com> wrote:
>> Hi Ty, you are not forced to save the library path in the generated 
>> extracted jar with the --record-library-path  option. If you can also 
>> omit that option, and then set java.library.path (or LD_LIBRARY_PATH) 
>> accordingly when it's time to run your application.


Can java.library.path be modified in code or does it have to be a launch 
option to work? I've always assumed it was a launch option only and 
haven't thought much of it.


It would really be nice if the whole thing was dynamic with zero 
hardcoded values, even if startup time was sacrificed due to library 
searching. With how fragmented the Linux ecosystem specifically is, 
there is never any guarantee that any hardcoded values(s) will work for 
all Linux distros.


>> One thing that we'd also like to improve longer term is how the 
>> default value of the java.library.path is populated across the 
>> various OS/distros. The values under linux e.g. do not make a lot of 
>> sense (apart from /usr/lib) - and we need a better way to talk to the 
>> system linker.


Sounds like a fun game of wackamole.


>> Maurizio On 07/09/2019 00:24, Ty Young wrote:
>>
>>     Hi, I mentioned this before in a linked article I did, but
>>     another major issue with current jextract/java library pathing
>>     is that it is static instead of dyanamic(that is, a specific
>>     path). This causes huge problems not only with cross-platform
>>     libraries but also in the heavily fragmented Linux ecosystem.
>>     NVML(Nvidia Management Library) for example exists in entirely
>>     different locations in /usr/lib in Ubuntu, Arch, and Fedora as
>>     well as in Windows. As a result, bindings have to be generated
>>     multiple times even on the same platform in order to work
>>     correctly. Can a way to dynamically specify the library path from
>>     within Java be added? 
>>


More information about the panama-dev mailing list