graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
Nico 2020-04-12T11:21:06.047500Z

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

Nico 2020-04-12T11:22:26.048Z

also, can you use cljfx in a graalvm app?

borkdude 2020-04-12T11:24:54.048200Z

no, you can't crosscompile

borkdude 2020-04-12T11:25:23.048800Z

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

Nico 2020-04-12T11:35:46.049600Z

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?

borkdude 2020-04-12T11:42:40.050300Z

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

2020-04-12T11:43:21.050600Z

i used 2 methods

2020-04-12T11:43:42.051100Z

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

2020-04-12T11:44:00.051600Z

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

2020-04-12T11:44:46.052500Z

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

2020-04-12T11:45:10.053Z

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

2020-04-12T11:46:12.054300Z

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.

2020-04-12T11:47:12.055Z

some of these details are summarized starting here: https://github.com/borkdude/babashka/issues/241#issuecomment-610688377

2020-04-12T11:50:19.055800Z

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

2020-04-12T11:50:53.056400Z

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

Nico 2020-04-12T11:51:27.056600Z

ok

Nico 2020-04-12T11:52:14.057700Z

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

2020-04-12T11:53:33.059Z

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.

Nico 2020-04-12T11:54:25.059200Z

currently I have a pi 3

2020-04-12T11:54:53.059700Z

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

2020-04-12T11:55:26.060Z

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

2020-04-12T11:56:20.060800Z

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.

2020-04-12T11:57:42.061800Z

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

2020-04-12T11:58:27.062500Z

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.

Nico 2020-04-12T11:58:46.062700Z

cool

2020-04-12T11:59:57.062900Z

💤

Nico 2020-04-12T12:00:38.063800Z

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

2020-04-12T12:13:04.064900Z

this was the best set of instructions i found for qemu with aarch64: https://translatedcode.wordpress.com/2017/07/24/installing-debian-on-qemus-64-bit-arm-virt-board/

Nico 2020-04-12T12:41:26.065200Z

thank you!

👍 1