HOW-TO:Compile Kodi for Ubuntu
This guide will show you how to compile XBMC for Ubuntu.
We currently recommend Ubuntu Precise(12.04) or later. A gfx-adapter with OpenGL acceleration is highly recommended and 24/32 bitdepth is required with OpenGL.
1 Getting the source code
Enter the following into the command line.
sudo apt-get install git-core cd $HOME git clone git://github.com/xbmc/xbmc.git xbmc
2 Installing the required Ubuntu packages
Two methods exist to install the required Ubuntu packages:
2.1 Use a single command to get all build dependencies
You can get all build dependencies used for building the packages on the PPA
Add the unstable and build-depends PPAs:
sudo apt-get install python-software-properties software-properties-common sudo add-apt-repository ppa:team-xbmc/unstable sudo add-apt-repository ppa:team-xbmc/xbmc-ppa-build-depends sudo apt-get update
Here is the magic command to get the build dependencies (used to compile the version on the PPA).
sudo apt-get build-dep xbmc
Optional: If you do not want xbmc to be installed via PPA, you can removed the PPAs again:
sudo add-apt-repository -r ppa:team-xbmc/unstable sudo add-apt-repository -r ppa:team-xbmc/xbmc-ppa-build-depends
For developers and anyone else who compiles frequently it is recommended to use ccache
sudo apt-get install ccache
A tip for those with multiple computers at home is to check out distcc (totally unsupported from xbmc of course)
sudo apt-get install distcc
2.2 Alternative: Manual dependency installation
For Ubuntu (all versions >= 7.04):
For >= 10.10:
sudo apt-get install autopoint libltdl-dev
On 8.10 and older versions, libcurl is outdated and thus XBMC will not compile properly. In this case you will have to manually compile the latest version.
wget http://curl.sourceforge.net/download/curl-7.19.7.tar.gz tar -xzf curl-7.19.7.tar.gz cd curl-7.19.7 ./configure --disable-ipv6 --without-libidn --disable-ldap --prefix=/usr make sudo make install
For >= 12.10
sudo apt-get install libtag1-dev
For <= 12.04.
- We need a new version of taglib than what is available. We supply a Makefile in lib/taglib to make it easy to install into /usr/local.
sudo apt-get remove libtag1-dev make -C lib/taglib sudo make -C lib/taglib install
Unless you are proficient with how linux libraries and versions work, do not try to provide it yourself, as you will likely mess up for other programs.
3 How to compile
To create the XBMC executable manually perform these steps:
- A full listing of supported options can be viewed by typing
- By adding -j<number> to the make command, you describe how many concurrent jobs will be used. So for dualcore the command is:
- You may need to run this with sudo (sudo make install) if your user doesn't have write permissions to the prefix you have provided (as in the default case, /usr/local).
- Enter the following into the command line
cd $HOME/xbmc/ ./bootstrap ./configure make make install
This will install XBMC in the prefix provided in 4.1 as well as a launcher script.
To override the location that XBMC is installed, use PREFIX=<path>. For example:
make install DESTDIR=$HOME/xbmc
3.1 Test Suite
XBMC has a test suite which uses the Google C++ Testing Framework. The framework is provided directly in XBMC's source tree and has very little requirements in order to build and run. See the README file for the framework at 'lib/gtest/README' for specific requirements.
To compile and run XBMC's test suite, the configure option '--enable-gtest' has to be explicitely set during the configure stage. Once configured, to build the testsuite, type the following.
To compile the test suite without running it, type the following.
The test suite program can be run manually as well. The name of the test suite program is 'xbmc-test' and will build in the XBMC source tree. To bring up the 'help' notes for the program, type the following.
The most useful options are,
- List the names of all tests instead of running them. The name of TEST(Foo, Bar) is "Foo.Bar".
- Run only the tests whose name matches one of the positive patterns but none of the negative patterns. '?' matches any single character; '*' matches any substring; ':' separates two patterns.
4 How to run
How to run xbmc depends on the type of installation you have done. It is possible to run XBMC without the requirement to install xbmc anywhere else. In this case, type the following from the top source directory.
If you chose to install XBMC using '/usr' or '/usr/local' as the PREFIX, you can just issue 'xbmc' in a teminal session.
If you overridden PREFIX to install XBMC into some non-standard location, you will have to run xbmc by directly running 'xbmc.bin'. For example.
sudo apt-get remove xbmc*
make uninstall" ("
sudo make uninstall" if you user doesn't have write permission to the install directory) from your source tree. If you would like to also remove any settings and 3rd party addons (skins, scripts, etc) you should also run
rm -rf ~/.xbmc