Power & Source of Big Ideas

Could not find mmal libraries

Moderators: chensy, FATechsupport

Hardware: NanoPi M4

Hello,
I used the friendlyelec core image based on unbuntu from the friendly elec google drive: rk3399-sd-friendlycore-bionic-4.4-arm64-20181219.img.zip

I wish I could managed CAM1320 using C language and in order to achieve this, I wanted to try Raspicam library.

Raspicam:
C++ library for controlling Raspberry Pi Camera (with/without OpenCV)
https://sourceforge.net/projects/raspicam/

While trying to install Raspicam, I was faced to 'Could not find mmal libraries' error message.

---------------------------------------------------------
$ ~/raspicam/raspicam-0.1.6/build$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:45 (MESSAGE):
Could not find mmal libraries

-- Configuring incomplete, errors occurred!
See also "/home/pi/raspicam/raspicam-0.1.6/build/CMakeFiles/CMakeOutput.log".
---------------------------------------------------------

Digging on the web to find how to get mmal librairies, I understand that these should come from 'userland' package available on the Raspberry Pi github.

Raspberry Pi github:
https://github.com/raspberrypi/
Source code for ARM side libraries for interfacing to Raspberry Pi GPU
https://github.com/raspberrypi/userland

-----------
This repository contains the source code for the ARM side libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib and includes source for the ARM side code to interface to: EGL, mmal, GLESv2, vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG.

Use buildme to build. It requires cmake to be installed and an arm cross compiler. It is set up to use this one: https://github.com/raspberrypi/tools/tr ... f-raspbian
-----------

Here is the result:
----------------------------------
$ ~/userland$ sudo ./buildme
~/userland/build/arm-linux/release ~/userland
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- broken
CMake Error at /usr/local/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"/usr/bin/arm-linux-gnueabihf-gcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/pi/userland/build/arm-linux/release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_73af5/fast"
/usr/bin/make -f CMakeFiles/cmTC_73af5.dir/build.make CMakeFiles/cmTC_73af5.dir/build
make[1]: Entering directory '/home/pi/userland/build/arm-linux/release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_73af5.dir/testCCompiler.c.o
/usr/bin/arm-linux-gnueabihf-gcc -U_FORTIFY_SOURCE -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -marm -o CMakeFiles/cmTC_73af5.dir/testCCompiler.c.o -c /home/pi/userland/build/arm-linux/release/CMakeFiles/CMakeTmp/testCCompiler.c
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mfloat-abi=hard’
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-marm’; did you mean ‘-fasm’?
CMakeFiles/cmTC_73af5.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_73af5.dir/testCCompiler.c.o' failed
make[1]: *** [CMakeFiles/cmTC_73af5.dir/testCCompiler.c.o] Error 1
make[1]: Leaving directory '/home/pi/userland/build/arm-linux/release/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_73af5/fast' failed
make: *** [cmTC_73af5/fast] Error 2

CMake will not be able to correctly generate this project.

Call Stack (most recent call first):
CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!
----------------------------------

Any idea how to add mmal librairies under NanoPI M4 FriendlyElec Ubuntu Core environment?

Thank you
If I understand correctly, MMAL - it's a Broadcom lib for their VideoCore IV GPU(and use OpenMax as lower level API), used in RaspberryPI. and can be used only with VideoCore based chips/board(RPi and similar), while Nano M4 use ARM Mali GPU/ISP and not compatible with MMAL. Theoretically, you can port MMAL to this board, but it may required weeks/months of work.


to access camera from C/C++ you may use Video4Linux v2 or GStreamer API and many camera apps, based on this API's (including some from RPI, but not a raspicam)
Hello Ayaromenok,
Thank you for your reply.

Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 9 guests