[graalvm-users] GraalVM native images in embedded IoT-context

Johan Vos johan.vos at gluonhq.com
Fri Oct 9 05:22:14 PDT 2020


We build on e.g. Linux AMD64 systems, targeting AARCH64. But we use Gluon
Substrate, which exits the native-image process after the object file is
generated.
Linking the object file with the required libs (static JDK and JavaFX libs)
is then done on the Pi itself.
Note that indeed this only works on 64-bit systems at this moment, as there
is no 32-bit arm generation yet in GraalVM native-image.

- Johan

On Fri, Oct 9, 2020 at 2:12 PM Samuel Audet <samuel.audet at gmail.com> wrote:

> Johan,
>
> How do you guys create your images for aarch64?
>
> Samuel
>
> On 10/9/20 8:53 PM, Ramsey Gurley wrote:
> > Someone can correct me if I am wrong, since I haven't tried.
> >
> > According to what I've read, images built with jaotc are processor
> > dependent and considered very beta quality. images built with
> > native-image are not. There is no arm 32 bit native-image, because there
> > is no graalvm for arm except for aarch64, but jaotc is included with
> > java 10+.
> >
> > I'm under the impression it is possible to cross compile a native image,
> > but you would need a copy of the target graalvm as well as libc and
> > other things. It is probably hard and you're better off compiling on
> > aarch64 if you can :)
> >
> > My guess is you would be okay building native-image on gravitons to
> > deploy on whatever aarch64 device you want. Even with limited ram, you
> > could build on device with enough swap, but that's just going to be
> > really painfully slow.
> >
> >
> > On 10/9/20 4:12 PM, Thorsten Schöning wrote:
> >> Guten Tag Ramsey Gurley,
> >> am Donnerstag, 8. Oktober 2020 um 12:44 schrieben Sie:
> >>
> >>> I haven't gotten to the point of deploying one yet, but I've built
> >>> them on aarch64. It takes a lot of memory. A hello world vertx
> >>> application built with native-image takes nearly 4GB of RAM to
> >>> build. You will probably want to build your native images on AWS
> >>> graviton2 instances for more speed and available memory.
> >> Thanks for mentioning that, didn't have that in mind at all. :-)
> >>
> >> How identical need the build server be to the system where things get
> >> deployed to in the end? Same CPU, but different amount of RAM only? Or
> >> is a different CPU OK if it's the same ARM-architecture? Like all
> >> aarch64 are OK, regardless model, number of cores or alike? Is there
> >> any cross-compiling possible for aarch64 native images on x86-64?
> >>
> >> I'm wondering because the SoC discussed for me currently is only
> >> available with 256 MiB of RAM at all, so one really would need to
> >> build somewhere else. Besides the fact that it might not even be 64
> >> Bit and might not work at all with native image. :-/
> >>
> >> Mit freundlichen Grüßen,
> >>
> >> Thorsten Schöning
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20201009/eb9ff454/attachment-0001.html 


More information about the GraalVM-Users mailing list