Software build dependency

Hey everyone I hope you’re all doing well, I have been talking to the developers of Sonic 3 A.I.R to debug and improve the Linux documentation and solve some issues, on Manjaro x64 there wasn’t any issues but on Arm64 it seems like there is a dependency that that Raspberry pi OS has and I wanted to see if Manjaro Arm64 has it.

Here is the log

/usr/bin/ld: cannot find -lbcm_host: No such file or directory
/usr/bin/ld: skipping incompatible /home/corey/sonic3air/Oxygen/sonic3air/build/_cmake/../../../../Oxygen/sonic3air/source/external/discord_game_sdk/lib/x86_64/libdiscord_game_sdk.so when searching for -ldiscord_game_sdk
/usr/bin/ld: cannot find -ldiscord_game_sdk: No such file or directory
/usr/bin/ld: skipping incompatible /home/corey/sonic3air/Oxygen/sonic3air/build/_cmake/../../../../Oxygen/sonic3air/source/external/discord_game_sdk/lib/x86_64/libdiscord_game_sdk.so when searching for -ldiscord_game_sdk
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/Sonic3AIR.dir/build.make:955: /home/corey/sonic3air/Oxygen/sonic3air/sonic3air_linux] Error 1
make[1]: *** [CMakeFiles/Makefile2:446: CMakeFiles/Sonic3AIR.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

From what the developer said and I quote
" bcm_host seems to be a library that you need to install as part of the libraspberrypi-dev / kernel header packages. At least that’s what https://raspberrypi.stackexchange.com/questions/36121/fatal-error-bcm-host-h-no-such-file-or-directory-compilation-terminated says. It’s suggested there to use."

Do we have a package for bcm_host at all since it can’t find it ?

It is in the raspberrypi-userland-aarch64-git package and lives in /opt/vc/lib/. It should be installed.

[ray@jellyfin ~]$ ls /opt/vc/lib
libbcm_host.so   libdebug_sym_static.a  libvchiq_arm.so  libvcos.so
libdebug_sym.so  libdtovl.so            libvchostif.a    pkgconfig

If you do have raspberrypi-userland-aarch64-git installed I do not know why the linker can not find it as the path shows up in ldconfig:

[ray@jellyfin ~]$ ldconfig -v 2>/dev/null | grep -v ^$‘\t’
/usr/lib/libfakeroot: (from /etc/ld.so.conf.d/fakeroot.conf:1)
/opt/vc/lib: (from /etc/ld.so.conf.d/raspberrypi-userland.conf:1)
/usr/lib: (from :0)

The /opt/vc/lib/pkgconfig/bcm_host.pc file seems to be in order:

[ray@jellyfin ~]$ cat /opt/vc/lib/pkgconfig/bcm_host.pc
prefix=/opt/vc
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: bcm_host
Description: Broadcom VideoCore host API library
Version: 1
Libs: -L${libdir} -lbcm_host -lvcos -lvchiq_arm -pthread
Cflags: -I${includedir} -I${includedir}/interface/vmcs_host/linux -I${includedir}/interface/vcos/pthreads -DUSE_VCHIQ_ARM

1 Like

Even with bcm_host, this is not going to build because they ship a binary blob libdiscord_game_sdk.so which is x86_64-only.

Oh that part can be skipped, that’s no issue there, it’s the other part that’s the issue but thanks to this info I will be able to pass it on to the developers

Thank you so much for the information! I will pass this on the the developers and let you know if there is any other issues :grin::+1:

1 Like

Oh just to add, do I need raspberrypi-userland-aarch64-git or should it be fine as is and the developer just need to add some additional code/changes to find it and work?

You have to have raspberrypi-userland-aarch64-git installed. That is the required libs/headers for rpi related development projects on your end.

Oh alright thanks for letting me know tho that’s odd because I already have it installed so I guess the developer will have to fix something on their end

Here is something else that may be pertinent to your issue. RPi has recently depreciated their userland git and moved what was left that was useful in it to another new git. They are now using standard linux API’s for V4L2, DRM/KMS and Mesa. So I removed raspberrypi-userland-aarch64-git so the
/opt/vc/ directory tree no longer exists.

https://github.com/raspberrypi/userland/blob/master/README.md

Oh I see so what the developers are depending on is deprecated and no longer even needed?

No clue what it takes. I am not a coder. I would guess it needs to look for some equivalent to libbcm_host some where now in the standard linux directory tree under /usr/lib (/lib).