libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.34k stars 1.84k forks source link

Raspberry Pi4: fatal error: bcm_host.h: No such file or directory #9727

Open ZedeN1 opened 5 years ago

ZedeN1 commented 5 years ago

Description

Fatal error when compiling on Raspbian running on Raspberry Pi 4 4Gb.

Expected behavior

Compiles successfully

Actual behavior

CC gfx/drivers/dispmanx_gfx.c gfx/drivers/dispmanx_gfx.c:17:10: fatal error: bcm_host.h: No such file or directory

include

      ^~~~~~~~~~~~

compilation terminated. make: [Makefile:213: obj-unix/release/gfx/drivers/dispmanx_gfx.o] Error 1 make: Waiting for unfinished jobs....

./configure output available on PasteBin make -j4 output available on PasteBin

Steps to reproduce the bug

  1. git clone https://github.com/libretro/RetroArch.git
  2. sudo apt-get install build-essential libxkbcommon-dev zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm libavformat-dev libavdevice-dev libswresample-dev libavresample-dev libswscale-dev libv4l-dev libgl*-mesa-dev
  3. CFLAGS='-mfpu=neon' ./configure --enable-alsa --enable-udev --enable-floathard --enable-neon --enable-dispmanx --disable-opengl1 --disable-videocore --enable-opengles --enable-opengles3
  4. make -j4

Bisect Results

./configure output available on PasteBin make -j4 output available on PasteBin

Version/Commit

You can find this information under Information/System Information

Environment information

Solution to get further but to a different error:

Add -I/opt/vc/include to CFLAGS: CFLAGS='-mfpu=neon -I/opt/vc/include' ./configure --enable-alsa --enable-udev --enable-floathard --enable-neon --enable-dispmanx --disable-opengl1 --disable-videocore --enable-opengles --enable-opengles3

GIves a different error:

CC led/drivers/led_rpi.c
LD retroarch
/usr/bin/ld: obj-unix/release/gfx/drivers/dispmanx_gfx.o: undefined reference to symbol 'vc_dispmanx_display_close'
/usr/bin/ld: //opt/vc/lib/libbcm_host.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:208: retroarch] Error 1
hizzlekizzle commented 5 years ago

Have you tried the solution from this post? https://raspberrypi.stackexchange.com/questions/36121/fatal-error-bcm-host-h-no-such-file-or-directory-compilation-terminated

ZedeN1 commented 5 years ago

Have you tried the solution from this post? https://raspberrypi.stackexchange.com/questions/36121/fatal-error-bcm-host-h-no-such-file-or-directory-compilation-terminated

Yes I have, didn't work. running rpi-update didn't work either.

I managed to get further in the compile process by adding -I/opt/vc/include to CFLAGS but the compile still dies with error:

CC led/drivers/led_rpi.c
LD retroarch
/usr/bin/ld: obj-unix/release/gfx/drivers/dispmanx_gfx.o: undefined reference to symbol 'vc_dispmanx_display_close'
/usr/bin/ld: //opt/vc/lib/libbcm_host.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:208: retroarch] Error 1
ZedeN1 commented 5 years ago

I was able to compile without dispmanx:

CFLAGS='-mfpu=neon' ./configure --enable-alsa --enable-udev --enable-floathard --enable-neon --disable-opengl1 --disable-videocore --enable-opengles --enable-opengles3 --disable-dispmanx

Anyone know why dispmanx is giving me issues?

asavah commented 5 years ago

Pi4 does not support or use dispmanx and proprietary (legacy) firmware based GL* drivers (those from /opt/vc). For pi4 standard opensource mesa drivers should be used over drm/kms, x11 or wayland. https://github.com/raspberrypi/firmware/issues/1171#issuecomment-507306827

zoltanvb commented 11 months ago

Configure scripts should nowadays handle RPi4 without extra options, guide also available: https://docs.libretro.com/guides/rpi/ I believe this one can be closed.