Install Allegro5 From Git/Linux/Debian

From Allegro Wiki

Jump to: navigation, search


Install Allegro 5 from Git on Debian

Installing Allegro 5 from Git on Debian, and Debian like distros is fairly easy and straight forward.


However this process has quite a few direct, and indirect dependencies, so you are going to have to install a few things before we procede.

Direct Dependencies

  • Build Essentials (build-essential) - things like GCC, make, binutils
  • Git (git) - Can't get allegro from its Git repo without git
  • CMake (cmake) - Allegro's new Build system
  • X11 (xorg-dev) - Development libraries for X11
  • OpenGL (libgl1-mesa-dev, libglu-dev) - Devel libs for OpenGL
Note, this one may overwrite some files from your graphics drivers if you installed 3rd party binary drivers (ie: fglrx or nvidias binaries)
If you experience problems, (ie: OpenGL performance is TERRIBLE) you may want to reinstall your graphics drivers.

Optional Dependencies

  • PNG (libpng-dev) - Devel libs for PNG
  • zlib (libz-dev) - Devel libs for zlib
  • CURL (libcurl4-dev) - Devel libs for CURL (simple URL transfer lib)
  • FreeType (libfreetype6-dev) - Devel libs for the FreeType TTF rendering lib
  • JPEG (libjpeg-dev) - Devel libs for JPEG (Compressed picture format)
  • OGG, Voribs (libvorbis-dev) - Devel libs for Vorbis decoding (Compressed audio format)
  • OpenAL (libopenal-dev) - Devel libs for OpenAL (3D positional Audio)
  • PhysicsFS (libphysfs-dev) - Devel libs for PhysicsFS (compressed archive loading)
  • Gtk2.0 (libgtk2.0-dev) - Devel libs for GTK (native dialog support)
  • ALSA (libasound-dev) - Devel libs for ALSA
  • PulseAudio (libpulse-dev) - Devel libs for PulseAudio (see below)
  • FLAC (libflac-dev) - Devel libs for FLAC (lossless compressed audio)
  • DUMB (libdumb1-dev) - Devel libs for DUMB (mod audio player)

Documentation Dependencies

  • exuberant-ctags
  • dvi2ps
  • dvipdfmx
  • latex2html
  • pandoc

Note: Some of these packages will pull in quite a lot of other packages, don't be surprised to see a LOT of packages being installed. Also some pull in other optional dependencies, so if you're installing packages individually don't be surprised if a package is already installed before you get to it.

Installing Dependencies

Before you start installing packages, you're going to want to make sure your apt repo list is up to date, and setup properly. Some of the dependencies live in Debian's "non-free" repository, so you're going to want to add that to your sources.list file.

To do that, you're going to have to open up the /etc/apt/sources.list file in an editor and find the line that looks something like:

deb lenny main

Then make sure both 'non-free' and 'contrib' are following the "lenny" text (which can also be: stable, testing, squeeze, unstable, sid, and experimental, but this document assumes you're running lenny)

The following apt-get commands will need to be run as root to install the various packages you need and may want to install. There are two ways of doing so, either by using sudo apt-get blah or by using su, entering your password, and running apt-get in the new shell.

Last but not least, you need to update the repo list by running:

apt-get update
Required Dependencies
apt-get install build-essential git cmake cmake-curses-gui xorg-dev libgl1-mesa-dev libglu-dev
Optional Dependencies
apt-get install libpng-dev libcurl4-openssl-dev libfreetype6-dev libjpeg-dev libvorbis-dev libopenal-dev libphysfs-dev \
 libgtk2.0-dev libasound-dev libpulse-dev libflac-dev libdumb1-dev
Documentation Dependencies
apt-get install exuberant-ctags dvi2ps dvipdfmx latex2html pandoc

Getting Allegro

Now that we have all of the software we are going to need to build allegro, we fetch allegro from git:

git clone git://

Once that is all done, you now have a allegro directory containing allegro's latest source code! Navigate to that directory:

cd allegro

By default the WIP unstable 5.1 branch is fetched. If you want to build the latest stable release do:

 git checkout 5.0

Now onward with building Allegro. Create a "build" sub directory, and enter it:

mkdir build; cd build

Running CMake

Now for the fun part. You have a couple options, you can use cmake directly, use the bundled ccmake (curses) gui, or a Qt based graphical interface. I normally use ccmake, so that is what I'm going to explain here.


ccmake allows you to specify build settings on the command line, as well as inside the curses interface. Here I've told it to set the install prefix (where allegro is going to install to) to /usr. Why? It's cuts out a couple steps, adding /usr/local/lib to /etc/ and running ldconfig as root.

Once you've run that, press "c" twice, and then "g". You should now be back to a console.

You can however change any setting you like in the list, like disabling certain optional features. If you want to build static libraries, set SHARED to OFF.

Compiling Allegro

Now its time to get down to it. Time to run make.


Yes it really is that easy. You may have to wait a few minutes for this to finish.

If you know what icecream or distcc are, and have them setup, you will want to run make with the -j argument set to an appropriate value:

make -j8

Installing Allegro

Almost done. Time to install. If you left the CMAKE_INSTALL_PREFIX as default, or used my suggestion to install to /usr, you are going to want to install as root, either using sudo, or su.

make install

Congratulations, you now have Allegro 5 installed.

Personal tools