Hi all
I’m still in the beginning of my nerves development, but I’m fascinated by the possibilities it offers.
Currently I’m trying to get a simple ratatouille app to get working on nerves. It occurs to me to be a really cool solution to bring a CLI app to a raspi 400 with a small monitor.
My problem is that the ratatouille package won’t compile for aarch64 architecture (actually one of its dependencies). Since it contains C code I guess it tries to cross-compile the given code.
I read the documentation about Compiling Non-BEAM Code but I must admit I’m not really into the cross compiling matters yet.
Under the hood the dependency ex_termbox is required and causing the problem.
I get the following error message trying to mix deps.compile
:
Nerves environment
MIX_TARGET: rpi4
MIX_ENV: dev
==> ex_termbox
/Users/daniel/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-darwin_x86_64-1.5.0/bin/aarch64-nerves-linux-gnu-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -O2 -I/Users/daniel/.nerves/artifacts/nerves_system_rpi4-portable-1.18.1/staging/usr/include -I/Users/daniel/.asdf/installs/erlang/24.1/erts-12.1/include -Ic_src/termbox/src -fPIC --sysroot=/Users/daniel/.nerves/artifacts/nerves_system_rpi4-portable-1.18.1/staging -shared -dynamiclib -undefined dynamic_lookup -o priv/termbox_bindings.so c_src/termbox_bindings.c c_src/termbox/build/src/libtermbox.a
aarch64-nerves-linux-gnu-gcc: error: dynamic_lookup: No such file or directory
make: *** [priv/termbox_bindings.so] Error 1
could not compile dependency :ex_termbox, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ex_termbox", update it with "mix deps.update ex_termbox" or clean it with "mix deps.clean ex_termbox"
==> rata_nerv
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.
To replay my scenario just create a nerves app and add the depenency {:ratatouille, "~> 0.5"}
to your mix.exs.
Any help or hints are appreciated.
Thanks
Daniel