The Allegro Wiki is migrating to github at

Install Allegro5 From Git/Linux/Debian

From Allegro Wiki
< Install Allegro5 From Git
Revision as of 22:42, April 15, 2011 by Thomas Fjellstrom (talk | contribs) (Optional Dependencies)
Jump to: navigation, search

Install Allegro 5 from SVN on Debian

Install_Allegro5_From_SVN/Linux/Debian|Installing Allegro 5 from SVN 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
  • Subversion (subversion) - Can't get allegro from its SVN repo without subversion
  • 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 subversion cmake xorg-dev libgl1-mesa-dev libglu-dev
Optional Dependencies
apt-get install libpng-dev libcurl4-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 svn:

svn co allegro-5.0

If you care to know what that means, co stands for "checkout", I use the shortform because I'm lazy. The long, LONG url passed is the location for the 5.0 branch (or version) of allegro, and last but not least, the last argument is the location you want to save the source code.

Once that is all done, you now have a allegro-5.0 directory containing allegro's latest source code!

Now you need to change directory into the new allegro-5.0 dir, and create a "build" sub directory, and enter it:

cd allegro-5.0; 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.

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.