Build failure due to mmal

I am in the process of creating a Balena app for my robot. It is a Raspberry Pi+. My base OS is balenalib/%%BALENA_MACHINE_NAME%%-ubuntu:bionic.

During a make process I get this error:

– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at raspicam_node/CMakeLists.txt:30 (MESSAGE):
Could not find mmal libraries

– Configuring incomplete, errors occurred!
See also “/ros/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/ros/catkin_ws/build/CMakeFiles/CMakeError.log”.
Makefile:1104: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed"

I’ve been scouring google for any tips and have not yet been able to find it.

Hi @pitosalas,
Could you please let me know which RPi model you have? Is it the RPi 3B+?
Moreover, it would be really helpful if you’d let me know what you are trying to achieve. Did you try to connect a Raspberry Pi camera?
The logs you attach here is a small fraction of the entire log and I cannot tell much about what is happening. Attaching here the entire logs would also help us to better understand what could be the issue here.

Best,
Georgia

1 Like

I really appreciate your help!!!

It’s an RPI 3B+ (I’m pretty sure. Is there a way to definitely determine?)

I haven’t tried yet to connect to the camera because the build “failed”. But I probably should check. I am happy for you to look at my setup in Balena Cloud - https://dashboard.balena-cloud.com/apps/1725224/devices

I am attaching the whole log (but much of the action is happening in underlying scripts and make files.) Let me look if there’s anything else I can provide.logs.log (52.0 KB)

Hello, can you please provide your Dockerfile ?

I really appreciate your looking at this. Here’s the Dockerfile (renamed to .log simply to let discourse let me attach it.)

Dockerfile.log (1.8 KB)

Could you please try running apt-get update && apt-get install -y libraspberrypi libraspberrypi-dev and building again ?

1 Like

I was excited when I saw your response, but alas…

Connecting to 53c26b153c608866f60fbabb15d784df…
Spawning shell…
root@53c26b1:/ros/catkin_ws# apt-get update && apt-get install -y libraspberrypi libraspberrypi-dev
Hit:1 http://packages.ros.org/ros/ubuntu bionic InRelease
Hit:2 http://ppa.launchpad.net/ubuntu-raspi2/ppa/ubuntu bionic InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
Get:4 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease [88.7 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease [74.6 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease [88.7 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports bionic-updates/universe arm64 Packages [1253 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main arm64 Packages [922 kB]
Get:9 http://ports.ubuntu.com/ubuntu-ports bionic-security/universe arm64 Packages [777 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports bionic-security/main arm64 Packages [650 kB]
Fetched 3853 kB in 9s (439 kB/s)
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package libraspberrypi

Hello,

It seems like you are using the 64bit variant of the OS. The base image you are using doesn’t have the sources required to find the package. Can you tried one of the following please?

Hope this helps

1 Like

Thanks, I will try it asap.

I do wonder thought, why if I have a Raspberry Pi 3 Model B Plus Rev 1.3 which is definitely 64bit should I not use a 64 bit OS? ROS likes Ubuntu 18.04. I haven’t tested on Raspian so I am a little concerned.

From my reading ROS has a build for rasping-stretch. Should I therefore use FROM balenalib/rpi-raspbian

Thanks!

Hello,

yes you can try using the raspbian base image.

I do wonder though, why if I have a Raspberry Pi 3 Model B Plus Rev 1.3 which is definitely 64bit should I not use a 64 bit OS?

You can. But given that a lot of raspberry pi specific packages are not available for 64bit userspace you might find it more challenging. This might change in the future considering Raspbian has a 64-bit variant in beta

1 Like

Thanks so much! I did try Option 1 (rpi-raspian) and sadly it didn’t work. Maybe it would work with raspian-stretch? I will try your option 2. I appreciate your help as I am teaching a class in Robotics starting tomorrow and I thought I would have had this working by now :slight_smile: :slight_smile:

See attached log.

build.log (53.1 KB)

Looks like this RUN apt-get install -y ros-melodic-ros-base is failing

[main]     The following packages have unmet dependencies:
[main]      ros-melodic-ros-base : Depends: ros-melodic-actionlib but it is not going to be installed
[main]                             Depends: ros-melodic-bond-core but it is not going to be installed
[main]                             Depends: ros-melodic-dynamic-reconfigure but it is not going to be installed
[main]                             Depends: ros-melodic-nodelet-core but it is not going to be installed
[main]                             Depends: ros-melodic-ros-core but it is not going to be installed

maybe change the line to RUN apt-get install -y ros-melodic-bond-core ros-melodic-dynamic-reconfigure ros-melodic-nodelet-core ros-melodic-ros-core ros-melodic-ros-base ?

Again no joy. Do you think any of the later Ubuntu base images will have that library? I dont know how to check, e.g. cosmic (18.10), disco (19.04), eoan (19.10) or focal (20.04)?

Hi Pito,

According to the ROS website the latest version is supported on Ubuntu Focal and Debian Buster. You could try using FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:buster in your Dockerfile instead of Ubuntu or Raspbian.

John

Also, for ROS Melodic, you might also try Debian Stretch (instead of Ubuntu Bionic). Their website says Bionic is supported, but it might be worth trying one of the other distros or ROS Noetic.

John

Thanks I will try those! Out of curiosity would this issue be considered a “bug” in the Balena base images?

According to Balena, there’s an ubuntu focal build, but, do you see what I am getting wrong?

FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu:focal

[main] Step 1/21 : FROM balenalib/raspberrypi3-64-ubuntu:focal
[main] manifest for balenalib/raspberrypi3-64-ubuntu:focal not found

Hi,

You might double-check your Dockerfile against the ROS install steps outlined here. I will give it a shot on a 32-bit RPi 3 to see what I get.

John

Also, is your Dockerfile named Dockerfile or Dockerfile.template? You’ll need the latter.

John

John I really appreciate your help.

Do you work at Balena yourself? To answer your question,

I’m quite comfortable that this Dockerfile.template file works. We’ve done a lot of work with ROS. Our Dockerfile with

FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu:bionic

works fine in all respects in Balena except for the “Could not find mmal libraries” error. FYI here’s the GitHub that I am pushing out to Balena Cloud: https://github.com/campusrover/gpg_bran_balena

I am quite mystified why tracking down this error has been so very difficult. Here are the ones that I’ve tested so far and what the error was.

# [main]     manifest for balenalib/raspberrypi3-64-ubuntu:focal not found
# FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu:focal

# [main]     E: Unable to correct problems, you have held broken packages.
# FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:stretch

# [main]     E: Unable to correct problems, you have held broken packages.
# FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu:xenial

Thanks,

Pito Salas
Brandeis Computer Science
Volen 134