3

I'm creating my first Python program using a Respberry Pi 4 to connect to a 16x32 LED Hub75 board. From what I've researched, this rpi-rgb-led-matrix library is the only one compatible with this board.

I created the following Dockerfile to install the library and import my code:

FROM balenalib/raspberrypi4-64-debian:latest

RUN apt-get update && apt-get install -y \
    git python3 python3-pip python3-dev cython3 \
    build-essential g++ curl cmake \
    libgraphicsmagick++-dev libboost-python-dev \
    libboost-system-dev

RUN git clone --recursive https://github.com/hzeller/rpi-rgb-led-matrix.git

RUN ls -R /rpi-rgb-led-matrix/

WORKDIR /rpi-rgb-led-matrix

RUN make clean && make -j$(nproc)

RUN ls -R /rpi-rgb-led-matrix/lib/

WORKDIR /rpi-rgb-led-matrix/bindings/python
RUN python3 setup.py build_ext --inplace
RUN python3 setup.py install

WORKDIR /app

COPY . /app

CMD ["python3", "display_gifs.py"]

However, installing the library both manually and via the Dockerfile is giving the error that the core.cpp file cannot be found. I have tried several times to uninstall and install it again, so I created a Dockerfile because it would be a completely independent virtualization and zero installation. The following error follows:

=> ERROR [ 9/12] RUN python3 setup.py build_ext --inplace                                            1.8s
------
 > [ 9/12] RUN python3 setup.py build_ext --inplace:
1.320 running build_ext
1.345 building 'core' extension
1.347 creating build
1.350 creating build/temp.linux-aarch64-3.9
1.350 creating build/temp.linux-aarch64-3.9/rgbmatrix
1.350 aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../include -I/usr/include/python3.9 -c rgbmatrix/core.cpp -o build/temp.linux-aarch64-3.9/rgbmatrix/core.o -O3 -Wall
1.386 aarch64-linux-gnu-gcc: error: rgbmatrix/core.cpp: No such file or directory
1.389 aarch64-linux-gnu-gcc: fatal error: no input files
1.389 compilation terminated.
1.390 error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
------
Dockerfile:28
--------------------
  27 |     WORKDIR /rpi-rgb-led-matrix/bindings/python
  28 | >>> RUN python3 setup.py build_ext --inplace
  29 |     RUN python3 setup.py install
  30 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c python3 setup.py build_ext --inplace" did not complete successfully: exit code: 1

From what I've researched, other people have had this error and the library owner recommended reinstalling it, but it's not working with my Dockerfile.

Can anyone see what I'm doing wrong or provide an alternative solution?

From what I've researched, other people have had this error and the library owner recommended reinstalling it, but it's not working with my Dockerfile.

1
  • Have you confirmed that cython is installed? I ran into a similar issue, but not using docker. The issue was I was missing cython. Once I installed cything and added make build-python before make install-python, then error about core.cpp missing went away. (It looks like earlier distros of the rgbmatrix library included the compiled cython, but newer ones do not in favor of the user building it upon install.) Commented May 13 at 18:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.