danaus@bananapif3
-----------------
█ █ █ █ █ █ █ █ █ █ █ OS: Armbian (24.5.0-trunk) riscv64
███████████████████████ Host: spacemit k1-x deb1 board
▄▄██ ██▄▄ Kernel: 6.1.15-legacy-k1
▄▄██ ███████████ ██▄▄ Uptime: 6 mins
▄▄██ ██ ██ ██▄▄ Packages: 1292 (dpkg)
▄▄██ ██ ██ ██▄▄ Shell: bash 5.2.15
▄▄██ ██ ██ ██▄▄ Resolution: 1680x1050
▄▄██ █████████████ ██▄▄ DE: GNOME 45.2
▄▄██ ██ ██ ██▄▄ WM: Mutter
▄▄██ ██ ██ ██▄▄ WM Theme: Adwaita
▄▄██ ██ ██ ██▄▄ Theme: Flat-Remix-GTK-Light-Solid [GTK2/3]
▄▄██ ██▄▄ Icons: Flat-Remix-Green-Light [GTK2/3]
███████████████████████ Terminal: x-terminal-emul
█ █ █ █ █ █ █ █ █ █ █ CPU: Spacemit X60 (8) @ 1.600GHz
Memory: 652MiB / 3805MiB
Experience Building Neovim in RiscV64 Banana Pi BPI-F3
September 21, 2024 —
Andres H
Hmm. It had been a while from my last post, but I received not too much time ago a riscv SBC. I was pretty excited, to just check it out but after testing out spacemiT bianbuOS I was dissapointed about the performance.
I decided to try and install terminal based code editor such as neovim/helix, but after apt-get returned no results for the architecture, I was pretty surprised but I thought (meh it has to be that at this moment that is not the focus). So I just decided "why not experiment building from source some fun stuff", so I tried to compile helix-editor as Rust was available for riscv, then when trying to compile hit a wall as kernel 6.1.15 had a nasty error and well had to be patched at kernel level, then I had to decide, should I continue? should I wait for a new kernel to be released? I chose the second.
Then while waiting (at the time of this blog post yet we are all waiting for kernel 6.6 to be released for this SBC) I decided to try a different editor, something maybe not that uncommon like and I jump ahead and tried to build Neovim
And as I stated before, I let the output of an attempt to install neovim from repository.
I went ahead to neovim's repo and selected 0.10 release and read the docs about building it.
First tried quick install so lets build prerequisites as the docs suggested:
sudo apt-get install ninja-build gettext cmake unzip curl build-essential
Then quickly continue on clonning the repo and try to make the installation.
But it was not able to complete. Here is the summary:
Quick inspection, and Eureka I needed some deps and use the manual installation with external dependencies (easy piece, right?). For Neovim version 0.10 I will need to install:
libuv libluv libvterm luajit lua-lpeg lua-mpack msgpack-c tree-sitter tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
Let's go ahead. And try to install most of things.
sudo apt-get install lua5.1 sudo apt-get install lua-luv lua-luv-dev
No issues, next install LuaJit
So as stated before it seems that there is no native riscv64 LuaJit then I cannot continue. Hmm pretty annoying. Checking the source of LuaJit yet riscv64 is not supported. I decided to search for a port of the library. And I was very very lucky that already there is one available here, just not easy to find.
Waiting a while gave me the following:
Then to check if my deps were helping me to progress in the build process I decided to try a compile on neovim again
Pretty rookie mistake Lua was missing but I am pretty sure I had installed, I soon realize that I had installed runtime instead of dev files.
sudo apt-get install liblua5.1-0-dev
Another try.
Yeah, dependencies completed. I crossed my fingers and then attemped the final build.
Even lua worked
Success!
Tags: tech