Fork me on GitHub
#graalvm
<
2020-04-12
>
Nico11:04:06

can you cross-compile graalvm apps for other architectures, like ARM?

Nico11:04:26

also, can you use cljfx in a graalvm app?

borkdude11:04:54

no, you can't crosscompile

borkdude11:04:23

and yes, JavaFX should work, at least, there are examples around. you'll need a java11 graalvm version

Nico11:04:46

ah ok, is there a graalvm compiler for the raspberry pi then if I can't crosscompile for it, or would I have to run under JVM on the pi?

borkdude11:04:40

@sogaiu probably can tell you more. He made babashka and clj-kondo working on an Android tablet with the aarch64 graalvm version

sogaiu11:04:21

i used 2 methods

sogaiu11:04:42

in one method i built using an android tablet with a proot environment

sogaiu11:04:00

in the other method i set up qemu to emulate an aarch64 architecture machine

sogaiu11:04:46

for raspberry pi, some models can do aarch64 iiuc, however, i think raspbian is not aarch64 -- you may need to find a community provided distribution that is aarch64

sogaiu11:04:10

but rpi is limited in memory -- even the highest end rpi4 only has 4gb iiuc

sogaiu11:04:12

when i built on the android tablet that had 6gb, the os would kill the app running the proot environment if i tried to use more than 4gb iirc. a 4gb build on the tablet took 20 min for babashka.

sogaiu11:04:19

ah, also, the qemu builds are much slower. despite the fact that i was able to allocate more cores, more memory, and more disk.

sogaiu11:04:53

admittedly i was not using the latest qemu (only 4.0.0 -- i think there is now a 5.0.0rc2 or something)

Nico11:04:14

so currently for raspberry pi it seems like graalvm isn't really totally viable, even though it does work? The pis I have are 1GB so would run out of memory almost immediately

sogaiu11:04:33

which rpi do you have? is it 2, 3, or 4? i have heard those can do aarch64. for building i would guess that 1gb would not be enough -- for intel chips, too low a memory has lead to unsuccessful builds. i do not know if on arm it would just take longer and finish eventually.

Nico11:04:25

currently I have a pi 3

sogaiu11:04:53

ah, i guess there is some chance it could work. i only have an rpi2 and have not tested.

sogaiu11:04:26

also, it may depend a bit on what exactly you are going to build.

sogaiu11:04:20

if you don't mind going the qemu route, at least one can build successfully and transfer the binary to an rpi running an aarch64 distribution. i think it's possible that could work.

sogaiu11:04:42

fwiw, i transferred the binary i built on android to the qemu environment and that worked.

sogaiu11:04:27

not sure if it's relevant but according to: https://wiki.qemu.org/Documentation/Platforms/ARM -- there is support for raspi2 emulation for qemu-system-aarch64.

Nico12:04:38

I'll try builds in qemu, it will be slow but I don't really fancy running them on the pi if it's just going to run out of memory

Nico12:04:26

thank you!

👍 4