Skip to content

Compiling on the Raspberry Pi (Raspbian Jessie)

Andrew Mickelson edited this page May 4, 2016 · 23 revisions

Steps to install Attract-Mode on Raspbian Jessie:

  • Create a build environment

cd ~ mkdir develop ```````

  • Install "sfml-pi" and Attract-Mode dependencies

sudo apt-get install cmake libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg62-turbo-dev libfreetype6-dev libudev-dev libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavresample-dev libfontconfig1-dev ```````

  • Download and build sfml-pi

cd ~/develop git clone --depth 1 https://github.com/mickelson/sfml-pi sfml-pi mkdir sfml-pi/build;cd sfml-pi/build cmake .. -DSFML_RPI=1 -DEGL_INCLUDE_DIR=/opt/vc/include -DEGL_LIBRARY=/opt/vc/lib/libEGL.so -DGLES_INCLUDE_DIR=/opt/vc/include -DGLES_LIBRARY=/opt/vc/lib/libGLESv1_CM.so sudo make install sudo ldconfig ```````

  • Download and build Attract-Mode

cd ~/develop git clone --depth 1 https://github.com/mickelson/attract attract cd attract make USE_GLES=1 sudo make install ```````

If all those steps worked, then it should be ready to go!

Additional Notes

Forum Thread 1 Forum Thread 2

Alternative version (X environment required)

An alternative version that requires running the X environment can be installed. In addition to the dependencies installed in the instructions above, you would also need to install the following:

sudo apt-get install libx11-dev libx11-xcb-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util0-dev libxcb-ewmh-dev libxcb-keysyms1-dev libxcb-icccm4-dev libxrandr2 libxrandr-dev libgles2-mesa-dev

An instead of installing "sfml-pi" above, install an alternative (X dependent) version of SFML as follows:

cd ~/develop
it clone -b rpi https://github.com/mickelson/SFML sfml
mkdir sfml/build;cd sfml/build
cmake -DEGL_INCLUDE_DIR=/opt/vc/include -DEGL_LIBRARY=/opt/vc/lib/libEGL.so -DFREETYPE_INCLUDE_DIR_freetype2=/usr/include -DFREETYPE_INCLUDE_DIR_ft2build=/usr/include/freetype2 -DGLES_INCLUDE_DIR=/opt/vc/include -DGLES_LIBRARY=/opt/vc/lib/libGLESv1_CM.so -DSFML_BCMHOST=1 -DSFML_OPENGL_ES=1 ..
sudo make install
sudo ldconfig

(Its possible you may need to patch some sfml libraries first from here

Notes for RetroPie

If you don't use the sfml-pi version of SFML, then Attract mode will need an X environment to run (which RetroPie does not ship with)

to get it to work you can do

sudo apt-get install xinit

then to start attract mode you type xinit attract in the terminal