2010-07-17, 12:06
First off, this is probably a bad idea and not useful at all!
I honestly can't tell a difference performance wise, but I like knowing I've done all I can to improve things!
Doing this might break your setup in all sorts of ways I can't help to fix! Only try this if you don't mind reinstalling your system.
I've only tried this on Ubuntu Lucid. You should probably uninstall any XBMC packages you have installed before trying it!
To compile XBMC for the Atom processor GCC 4.5 is needed since it adds support for the Atom through the -march=atom compile flag.
To install GCC 4.5 on lucid you need to add the toolchain-test repository:
To enable easy switching between GCC 4.4 and GCC 4.5:
Select GCC 4.5, obviously.
Checkout the XBMC svn and run bootstrap it:
Create an script in the svn directory for easy updating later. Paste this info a text file and make it executable with chmod +x update.sh:
Run the script with ./update.sh
To update to latest revision, compile and install XBMC in the future, just run the script again.
You'll have backups from all previously compiled revisions in your svn directory.
Some explanations of the options used:
-march=atom #produces code specifically for the Atom CPU's in order pipeline execution
-fexcess-precision=fast # disables the GCC 4.5 strict floating point C99 standards conformance for improved floating point performance
-floop-parallelize-all -ftree-parallelize-loops=4 # Enable the new automatic parallelization of loops introduced in GCC 4.5.
-ffast-math #I doubt XBMC does any math functions, but since I don't know for sure and XBMC doesn't need to follow IEEE or ISO rules/specifications it can't hurt either.
--with-cpu=host #builds the internal ffmpeg for the host cpu only
Again, only try this if you don't mind reinstalling your system.
Good luck!
---
Could someone with better knowledge of the code tell me what parts of XBMC ignores the CFLAGS and CXXFLAGS variables? I'm sure ffmpeg does, and for a good reason, but maybe there are more.
I honestly can't tell a difference performance wise, but I like knowing I've done all I can to improve things!
Doing this might break your setup in all sorts of ways I can't help to fix! Only try this if you don't mind reinstalling your system.
I've only tried this on Ubuntu Lucid. You should probably uninstall any XBMC packages you have installed before trying it!
To compile XBMC for the Atom processor GCC 4.5 is needed since it adds support for the Atom through the -march=atom compile flag.
To install GCC 4.5 on lucid you need to add the toolchain-test repository:
Code:
sudo apt-add-repositoriy ppa:ubuntu-toolchain/test
sudo apt-get install gcc-4.5 g++-4.5
sudo apt-get update
sudo apt-get dist-upgrade
To enable easy switching between GCC 4.4 and GCC 4.5:
Code:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 30 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4
sudo update-alternatives --config gcc
Checkout the XBMC svn and run bootstrap it:
Code:
svn checkout http://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk xbmc
cd xbmc
./bootstrap
Create an script in the svn directory for easy updating later. Paste this info a text file and make it executable with chmod +x update.sh:
Code:
#!/bin/bash
FLAGS="-march=atom -ffast-math -fexcess-precision=fast -floop-parallelize-all \
-ftree-parallelize-loops=4 -pipe -fomit-frame-pointer"
export CFLAGS="$FLAGS"
export CXXFLAGS="$FLAGS"
svn up
svn=$(svn info | awk '/^Revision:/{print $2}')
./configure --disable-debug --prefix=/usr --with-cpu=host \
&& make -j2 \
&& sudo checkinstall --pkgname=xbmc --pkgversion=1:10.08~svn$svn-lucid1 -y
Run the script with ./update.sh
To update to latest revision, compile and install XBMC in the future, just run the script again.
You'll have backups from all previously compiled revisions in your svn directory.
Some explanations of the options used:
-march=atom #produces code specifically for the Atom CPU's in order pipeline execution
-fexcess-precision=fast # disables the GCC 4.5 strict floating point C99 standards conformance for improved floating point performance
-floop-parallelize-all -ftree-parallelize-loops=4 # Enable the new automatic parallelization of loops introduced in GCC 4.5.
-ffast-math #I doubt XBMC does any math functions, but since I don't know for sure and XBMC doesn't need to follow IEEE or ISO rules/specifications it can't hurt either.
--with-cpu=host #builds the internal ffmpeg for the host cpu only
Again, only try this if you don't mind reinstalling your system.
Good luck!
---
Could someone with better knowledge of the code tell me what parts of XBMC ignores the CFLAGS and CXXFLAGS variables? I'm sure ffmpeg does, and for a good reason, but maybe there are more.