Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi 2 build #17

Closed
NF3RN0 opened this issue Feb 15, 2015 · 20 comments
Closed

Raspberry Pi 2 build #17

NF3RN0 opened this issue Feb 15, 2015 · 20 comments

Comments

@NF3RN0
Copy link
Contributor

NF3RN0 commented Feb 15, 2015

Fresh build on a Raspberry pi 2.

SDL2 is missing the Raspberry PI Driver. You will not be able to run mupen64plus in the console.

I keep running into this and it won't continue the build. What can do? I have tried to run autoconf on SDL2 and build again but that did not help.

@ricrpi
Copy link
Owner

ricrpi commented Feb 16, 2015

It should continue to build even when the build script outputs this error, do you get any error messages?

@NF3RN0
Copy link
Contributor Author

NF3RN0 commented Feb 16, 2015

Libtools was Not installed for some reason but I did not think that was an issue. I installed libtools and removed all the SDL2 componients and tried again. it goes on a few lines after that and says SDL2 is installed at usr/lib/ or something like that. I'll have to run it again when I get home to see the exact location it said. But it does not go any further. Is there a verbose mode on the build.sh?

@ricrpi
Copy link
Owner

ricrpi commented Feb 16, 2015

Afraid not.

Only mupen64plus makefiles can be verbose if you use V=1 ./build.sh. I have tried to build the script to output a meaningful error message if the scrip fails. What line does the script fail on?

@NF3RN0
Copy link
Contributor Author

NF3RN0 commented Feb 16, 2015

It fails I think on line 333 of build.sh, it says "SDL2 2.0.3 located at ..." And then just quits. I am still not home to actually print exactly what it said but that is what I recall, and it's pretty close.

@NF3RN0
Copy link
Contributor Author

NF3RN0 commented Feb 17, 2015

Ok. I am dumb and did not give it enough memory because I thought the boosted memory could handle it. I set GPU memory to 32MB. However, Now I am runing into SDL2 not being compiled with GLES.

../../src/api/vidext_sdl2_compat.h:34:2: error: #error SDL is not build with OpenGL ES2 support. Try USE_GLES=0

I am asuming that the RPI has the GLES 2 headers somewhere that is unusual and SDL2 cannot find them when it compiles.

Going back and looking at the SDL2 checks for GLES, the output is:

checking for OpenGL ES v1 headers... no
checking for OpenGL ES v2 headers... no

Also I would like to note that when I did compile the build.sh for the second time around SLD2 gave me a warining:

libtool: install: warning: remember to run `libtool --finish /usr/local/lib'

Which as the script kept running it failed at:

../../src/api/frontend.c:30:17: fatal error: SDL.h: No such file or directory
compilation terminated.
Makefile:630: recipe for target '_obj/api/frontend.o' failed

So I did `libtool --finish /usr/local/lib' to remedy this and it continued untill it failed where it told me SDL2 was not compiled with GLES.

I am not sure where the GLES2 headers are on the raspberry pi.

@ricrpi
Copy link
Owner

ricrpi commented Feb 17, 2015

GLES2 headers are normally installed by default with Raspbian. Can't remote in to check for you but think they are in /opt/vc/. If they are no where on your system then they can be downloaded from official raspberrypi repo

@NF3RN0
Copy link
Contributor Author

NF3RN0 commented Feb 17, 2015

pi@raspberrypi /opt/vc/include $ ls
bcm_host.h EGL GLES GLES2 IL interface KHR vcinclude VG WF
pi@raspberrypi /opt/vc/include $ cd GLES2
pi@raspberrypi /opt/vc/include/GLES2 $ ls
gl2ext.h gl2.h gl2platform.h

They seem to be there. Do you have any idea why SDL2 did not find them?

@ricrpi
Copy link
Owner

ricrpi commented Feb 17, 2015

Maybe SDL2 got confused due to script failing so could you try running:

CLEAN=1 CLEAN_SDL2=1 ./build.sh

It will try and configure and rebuild everything again so sorry for the 2h wait.

@NF3RN0
Copy link
Contributor Author

NF3RN0 commented Feb 17, 2015

I will try that.

Cout it be that SDL2 does not know that it is a Raspberry pi 2?

I think it just tries to build it as armv7.

@ricrpi
Copy link
Owner

ricrpi commented Feb 17, 2015

@gizmo98 knows more about compiling for Pi2. I tink SDL2 should still compile but you will need some tweaks to the RaspianList file for Pi2 I think.

@ricrpi
Copy link
Owner

ricrpi commented Feb 17, 2015

I've created a new Build list for the Pi2. You should only need to use the following command to get Pi2 optimizations:

./build.sh RaspbianList_Pi2

@NF3RN0
Copy link
Contributor Author

NF3RN0 commented Feb 17, 2015

I think I got SDL2 to build with GLES2.

./configure --disable-video-opengl --disable-video-x11 CPPFLAGS=-I/opt/vc/include

SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic power filesystem threads timers file loadso cpuinfo assembly
Assembly Math :
Audio drivers : disk dummy oss alsa(dynamic) pulse(dynamic) esd(dynamic)
Video drivers : dummy opengl_es1 opengl_es2
Input drivers : linuxev linuxkd
Using libudev : YES
Using dbus : YES

It is compiling now and I will report back soon.

@NF3RN0
Copy link
Contributor Author

NF3RN0 commented Feb 18, 2015

Alright! I got everything to complie properly. Took me a while and it probably could be done better but here is what I did. I am pretty sure that the ./configure in SDL2 does not have a specific instructions for the Raspberry Pi 2 and therfore does not know where the VC libraries are. It just assumes it is a generic Armv7 device.

SDL2 variables:

sudo ./configure --disable-video-opengl --disable-video-x11 --host=armv7l-raspberry-linux-gnueabihf --enable-video

SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic power filesystem threads timers file loadso cpuinfo assembly
Assembly Math :
Audio drivers : disk dummy oss alsa(dynamic) pulse(dynamic) esd(dynamic)
Video drivers : dummy opengl_es1 opengl_es2
Input drivers : linuxev linuxkd
Using libudev : YES
Using dbus : YES

I think that others might run into the same problem when compling from just the build.sh. I was looking at Retropie and how they compile SDL2 and the invoke something similar in their script. I am not sure if I am using the armv7 compiler to its full potential as it was jus trial and error to get it to complie the video driver and GLES2 support.

Also, Even with the RPI2 list NEON did not properly build in GLES2N64, had to add another CFLAG to the ifdef statement to get it to properly compile.

CFLAGS += -mfpu=neon

@ricrpi
Copy link
Owner

ricrpi commented Feb 18, 2015

Is there a test I can do in the build script e.g. uname or /pro/cpuinfo to distinguish between pi and pi2?
If so I'll teak it to pull the correct list and add the SDL2 compiler option

@gizmo98
Copy link
Collaborator

gizmo98 commented Feb 18, 2015

You can use uname and test armv6l (rpi) and armv7l (rpi2).

@ricrpi
Copy link
Owner

ricrpi commented Feb 18, 2015

cheers

@ricrpi
Copy link
Owner

ricrpi commented Feb 25, 2015

Added test for armv7l and armv6l so should build without needin to pass in Pi2 list

@ghost
Copy link

ghost commented May 14, 2015

This problem is still not fixed. Not sure why this one was closed.

You have to add following to the SDL_CFG in build.sh to let SDL2 find the EGL/Gles2 headers:

 SDL_CFG="--disable-video-opengl --host=armv7l-raspberry-linux-gnueabihf --enable-video"

@alkemist
Copy link

alkemist commented Aug 1, 2015

Same problem :(
./build.sh RaspbianList_Pi2 => "../../src/api/vidext_sdl2_compat.h:34:2: error: #error SDL is not build with OpenGL ES2 support. Try USE_GLES=0
Makefile:630: recipe for target '_obj/api/vidext.o' failed
make: *** [_obj/api/vidext.o] Error 1"

@Smorganbord
Copy link

I am having the EXACT same problem on Raspberry Pi 3 model B. I am new to both Linux and the Pi. I have tried everything in this forum so far and nothing has worked. Any suggestions?!? Or more info that I can give you?
----------My error-----------------
In file included from ../../src/api/vidext.c:38:0:
../../src/api/vidext_sdl2_compat.h:34:2: error: #error SDL is not built with OpenGL ES2 support. Try USE_GLES=0
MakeFile:630: recipe for target '_obj/api/vidext.o' failed
make: *** [obj/api/vidext.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants