Closed mfoo closed 2 years ago
Looks like https://github.com/smcameron/open-simplex-noise-in-c is being used - would it be simpler to use a Python implementation? E.g. https://pypi.org/project/opensimplex/ is MIT licensed so should be fine to include.
Hi @mfoo - we were originally using https://pypi.org/project/opensimplex/ - but it's so slow on the Raspberry Pi, it causes animations to look quite jerky! I presume you're running a 64-bit Ubuntu distribution on your Raspberry Pi (which we don't officially support, just the 32-bit Raspberry Pi OS desktop version). That said you should be able to get our software on Ubuntu (at least it's Debian based, so not too dissimilar). Basically you're going to need to build an aarch64 version of the .so file (as the x64 library you found is for amd64) and get Python to try linking to your own version.
To build the library for aarch64. first apt install docker qemu qemu-user-static binfmt-support
and then run the following script:
cat > Dockerfile <<\EOF
FROM debian:buster-20210111
RUN apt update && apt install -y git build-essential
RUN git clone https://github.com/smcameron/open-simplex-noise-in-c /root/OpenSimplex
WORKDIR /root/OpenSimplex
RUN gcc -O2 -fPIC -c -o open-simplex-noise.o open-simplex-noise.c
RUN gcc -O2 -shared -o open-simplex-noise.so open-simplex-noise.o
EOF
docker image rm debian:buster-20210111 # Work around Docker not supporting several platform-specific versions of the same image.
docker build --platform linux/arm64/v8 -t build-simplex-aarch64 .
docker run --rm --entrypoint cat build-simplex-aarch64 /root/OpenSimplex/open-simplex-noise.so > open-simplex-noise-aarch64.so
chmod +x open-simplex-noise-aarch64.so
This script successfully generated a file when I just ran it, but I haven't actually tested that it's possible to link to. You can package the resulting .so next to the other versions in the daemon. Finally _platform_variant
in standard_library.py needs to be modified to detect and return 'aarch64'
so the correct .so is linked. Hope that's some help!
Worked first time, thanks!
I'll have a think about this, maybe there's some improvement we can make here that doesn't involve including multiple .so
binaries in the repo!
Hello!
I've now got the Lumicube running after building with Maven using a new flashed Ubuntu Server 22.04.1 LTS image. I had some trouble with
install.py
(for another issue when I have time!) and so had to run locally instead, meaning I had to install a bunch of dependencies manually. I'm hoping that this is the cause of the issue.The issue exists only with the Lava Lamp example. I can see the following exception in the log coming from Python:
However I can see that the file does exist and is a 64 bit dynamically linked shared object file compiled for x86-64, but
ldd
is having problems showing the contents (maybe this is because it's statically linked and thefile
output saying "dynamically linked" is incorrect?):Either way, I definitely can't load it:
I've attached the
readelf
output if that's useful:Any help would be appreciated!