Linking in Kotlin native is the big, slow part, is...
# kotlin-native
v
Linking in Kotlin native is the big, slow part, isn't it? I tried a gradle build on my Raspberry Pi, and Gradle wanted 3Gb of RAM to do the linking! Back on my Win PC, I've got a single large Kotlin enum with a bytestream (about 83kb) and linking my otherwise small project now takes about 2 or 3 minutes 😞.
🤞 2
b
Just do the linking on wsl and only copy the executable to the pi
v
Oh, yes, that's what I'm doing. Just alarmed that linking is so greedy for memory.
n
Gradle is well known for being very memory hungry (even with trivial build setups). Many JVM applications use too much memory, which is all too common unfortunately 😦.
☹️ 2
💯 2
v
Added a second C library... only 4kb. Compilation times are now at, well, still linking after 9 minutes.
b
Odd, i never had it this bad and I was linking with GTK3!
👍 1
Longest it took was 3mins for me. I'm on linux pc if that changes anything...
Can you try linking it on ubuntu vm with at least 8gb ram allocated to see if it changes anything?
v
Been a while since I even booted up a VM! I'm at 22 minutes now. I'll try a few things.
n
Note that a VM will add significant overhead to the compilation process.
v
I set up an Ubuntu VM, and gave it 10Gb of RAM. Same problem, compilation just stalls at the linking stage. If anyone wants to try, this branch compiles: https://github.com/v79/WaveShareTests and this one does not: https://github.com/v79/WaveShareTests/tree/libbmp . I guess I've done something wrong in compiling the
libbmp
C library, which I'm trying to include as a static library. For now, I am stumped.