Compiz Fusion 0.5.2 from source on Ubuntu Feisty

O.K. Last night I followed this very well refined Howto on the Compiz Fusion forums. It works like a charm… In fact there isn’t really much to add, but I’ll explain a few steps along the way. And make a few comments where something might be interesting.

The finished CF works really well on my PC (An AMD 3200+ with a rather old and shabby Nvidia 6200 card). Some of the new effects are very cool (your windows can fold up like a paper aeroplane and the Shift Switcher is pretty neat) and the whole thing feels very smooth – especially the cube rotation and expo.

Here we go then.

Firstly, this build is for a normal Ubuntu Feisty setup. That means we are talking Gnome (not KDE or XFCE). Also, as I only have a Nvidia graphics card, that’s what you get here. The HowTo does explain what to do if you have ATI or Intel cards, but I can’t comment.

As a safeguard I strongly recommend you first remove any existing compiz, beryl, compiz fusion stuff you have previously installed. Search through synaptic and uninstall everything that’s relevant.

All building, downloads etc I did in a single directory under my home_dir (~). I called it “compiz”.

This build is from source code and so won’t be recorded in the package manager. Therefore, you will probably want to keep this directory tree around so, you can – in the future – use make uninstall to remove this software; for example when the Ubuntu repo gets updated to include the latest and greatest.

Having just said that – I have read reports that local compilation provides better performance than a “one-size-fits-all” build that you get from a deb repository. I don’t have the time or inclination to test this theory but I am a big fan of building things from source. I do believe you get a better system and much less baggage too. You also grok (really understand) your system much better.

For those who are interested in learning more – I REALLY REALLY recommend you take a look at Linux From Scratch. You will learn more than you ever thought possible, and it will help you in trouble shooting your own systems (whatever they are) when you come back to whatever distro is your preference.

Finally – I also found a script yesterday, that purports to do what you see below automatically. I downloaded it and tried it but it is wanting in a number ways. It failed for me, it made too many assumptions about my system and tried to install stuff that I neither wanted or needed. In short you lost control… It isn’t hard to find it on-line but I don’t recommend it. The whole process below only took me about an hour. Took me much longer to write up though 🙂

Following the Howto, first of all get all the tools needed to build from source:
sudo apt-get install git-core automake build-essential intltool libtool python-pyrex python2.5-dev
sudo apt-get build-dep compiz

Git is interesting. It is a version control system similar in some respects to SVN (Subversion) and CVS (Concurrent Versioning System). It is used by some pretty big software projects including the Linux Kernel.

Make and then move into our directory:
mkdir ~/compiz
cd ~/compiz

Get the compiz core 0.5.2 tarball and extract it:
wget http://xorg.freedesktop.org/archive/individual/app/compiz-0.5.2.tar.gz
tar xf compiz-0.5.2.tar.gz

Now get all the packages (in source code form) from their git repository:
git clone git://anongit.compiz-fusion.org/fusion/libraries/bcop
git clone git://anongit.compiz-fusion.org/fusion/compizconfig/ccsm
git clone git://anongit.compiz-fusion.org/fusion/compizconfig/libcompizconfig
git clone git://anongit.compiz-fusion.org/fusion/compizconfig/compizconfig-python
git clone git://anongit.compiz-fusion.org/fusion/plugins-main
git clone git://anongit.compiz-fusion.org/fusion/decorators/emerald
git clone git://anongit.compiz-fusion.org/fusion/decorators/emerald-themes
git clone git://anongit.compiz-fusion.org/users/crdlb/fusion-icon

Also retrieve two optional packages that are well worth having:
git clone git://anongit.opencompositing.org/fusion/plugins-extra
git clone git://anongit.opencompositing.org/fusion/plugins-unsupported

We are now ready to build. Move into the directory we made when we extracted the compiz tarball earlier and run the standard CMMI command (C=Configure, M=Make, MI=Make Install):
cd ~/compiz/compiz-0.5.2
./configure --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

The double ampersands are a useful thing – they check for successful completion of the previous command before proceeding to the next. You will be prompted for your password before the make install command is run as you require root privileges to write to the /usr hierarchy. The cd - command takes you back to your previous directory.

Let the system know where to find the configuration information.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Now we build the packages we downloaded earlier by moving into the relevant directories and running the commands as shown and in this order:
cd ~/compiz/bcop
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

cd ~/compiz/libcompizconfig
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

cd ~/compiz/compizconfig-python
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

cd ~/compiz/plugins-main
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

This is the configuration manager which is a Python application and so has a different build and install command sequence:
cd ~/compiz/ccsm
sudo python setup.py install &&
cd -

cd ~/compiz/emerald
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

cd ~/compiz/emerald-themes
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

cd ~/compiz/plugins-extra
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

I had a problem with building this package. It failed to compile looking for a header called text.h. A bit of googling showed me this is installed by the plugins-main package so I went back and rebuilt the plugins-main package, made sure it installed properly then came back to here. Second time around it built fine.

cd ~/compiz/plugins-unsupported
./autogen.sh --prefix=/usr/local --disable-kde && make && sudo make install &&
cd -

This makes sure that your Xorg configuration is correctly setup to work with the Nvidia binary driver. If you are using ATI or Intel graphics chipsets, please see the HowTo for what to do with them.
sudo nvidia-xconfig --add-argb-glx-visuals -d 24

This is the new startup package that starts CF itself and provides a small icon on your toolbar (top right by default) that gives you access to the various configuration applications and options:
cd ~/compiz/fusion-icon
make &&
sudo make install &&
cd -

That’s it. Compiz Fusion is now built and installed. To run it from your terminal type fusion-icon &. To have it start automatically, add the command fusion-icon to your System>Preferences>Sessions utility and give it a meaningful name.

If you find a package fails to compile, as I had above, try getting the very latest code by pulling the source back from the git repository. Enter the relevant directory for each package and simply type git-pull. This will check for any file changes and upload only those that have changed. Then use the CMMI command above to rebuild and install as before.

I hope this is useful and have a lot of fun…

Update 01/09/07. Diego asked me to post my xorg.conf. Here it is:

=======Begin xorg.conf=======

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 1.0 (buildmeister@builder3) Thu Nov 9 17:55:20 PST 2006

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf(5) manual page.
# (Type “man xorg.conf” at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section “ServerLayout”
Identifier “Default Layout”
Screen “Default Screen” 0 0
InputDevice “Generic Keyboard”
InputDevice “Logitech MX1000” “CorePointer”
EndSection

Section “Files”

# path to defoma fonts
FontPath “/usr/share/fonts/X11/misc”
FontPath “/usr/share/fonts/X11/cyrillic”
FontPath “/usr/share/fonts/X11/100dpi/:unscaled”
FontPath “/usr/share/fonts/X11/75dpi/:unscaled”
FontPath “/usr/share/fonts/X11/Type1”
FontPath “/usr/share/fonts/X11/100dpi”
FontPath “/usr/share/fonts/X11/75dpi”
FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”
EndSection

Section “Module”
Load “i2c”
Load “bitmap”
Load “ddc”
Load “extmod”
Load “freetype”
Load “glx”
Load “int10”
Load “vbe”
EndSection

Section “InputDevice”
Identifier “Generic Keyboard”
Driver “kbd”
Option “CoreKeyboard”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105”
Option “XkbLayout” “gb”
Option “XkbOptions” “lv3:ralt_switch”
EndSection

Section “InputDevice”
Identifier “Logitech MX1000”
Driver “evdev”
Option “Name” “PS2++ Logitech MX Mouse”
Option “HWHEELRelativeAxisButtons” “7 6”
EndSection

Section “Monitor”
Identifier “Generic Monitor”
HorizSync 28.0 – 64.0
VertRefresh 43.0 – 60.0
Option “DPMS”
EndSection

Section “Device”
Identifier “nVidia Corporation NV37GL [Quadro FX 330/GeForce PCX 5300]”
Driver “nvidia”
EndSection

Section “Screen”

#Option “AllowGLXWithComposite” “True”
#Option “RenderAccel” “True”
Identifier “Default Screen”
Device “nVidia Corporation NV37GL [Quadro FX 330/GeForce PCX 5300]”
Monitor “Generic Monitor”
DefaultDepth 24
Option “NvAGP” “0”
Option “DamageEvents” “True”
Option “UseEvents” “True”
Option “TripleBuffer” “True”
Option “NoLogo” “True”
Option “AddARGBGLXVisuals” “True”
SubSection “Display”
Depth 1
Modes “1280×1024” “1152×864” “1152×768” “1024×768” “800×600” “640×480”
EndSubSection
SubSection “Display”
Depth 4
Modes “1280×1024” “1152×864” “1152×768” “1024×768” “800×600” “640×480”
EndSubSection
SubSection “Display”
Depth 8
Modes “1280×1024” “1152×864” “1152×768” “1024×768” “800×600” “640×480”
EndSubSection
SubSection “Display”
Depth 15
Modes “1280×1024” “1152×864” “1152×768” “1024×768” “800×600” “640×480”
EndSubSection
SubSection “Display”
Depth 16
Modes “1280×1024” “1152×864” “1152×768” “1024×768” “800×600” “640×480”
EndSubSection
SubSection “Display”
Depth 24
Modes “1280×1024” “1152×864” “1152×768” “1024×768” “800×600” “640×480”
EndSubSection
EndSection

Section “Extensions”
Option “Composite” “Enable”
Option “DAMAGE” “Enable”
Option “RENDER” “Enable”
EndSection

======= End xorg.conf =======

Tags: ,

8 Comments

  • nekostar says:

    cannot seem to compile git on feisty.

  • Alan Lord says:

    Hi nekostar, you don’t really say what the problem is. git itself does not need to be compiled – use synaptic to get git. The instructions to get git are in the first line of my post: sudo apt-get install git-core automake build-essential intltool libtool python-pyrex python2.5-dev.

    If you are having trouble compiling specific compiz packages then you need to explain the issue and your best bet for help is probably to start a thread on their forum explaining your problem.

  • Hyperair says:

    So… I compiled it, and next thing I know, I lost my window borders and I can’t move my window!

  • Alan Lord says:

    @Hyperair,

    So, if you have the blue compiz fusion icon on your panel (by default it should be top-right of your screen), right click and select “Select Window Manager” or “Reload Window Manager”. If you don’t have the icon, open a terminal and type metacity –replace. This will restart the standard wm.

    Compiz-Fusion is still pre-release code is isn’t perfect but it works for me most of the time. Occasionally I have to reload the window manager or switch back to metacity – usually when I have a lot of apps running and memory is getting scarce…

    Cheers

    Alan

  • […] The Open Sourcerer » Compiz Fusion 0.5.2 from source on Ubuntu Feisty (tags: compiz fusion scratch compile git howto ubuntu) […]

  • Inxsible says:

    When I do a [code]sudo apt-get build-dep compiz[/code] why is it trying to download a bunch of kde crap.

    [code]sudo apt-get build-dep compiz
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting libcairo2-dev instead of libcairo-dev
    The following NEW packages will be installed:
    comerr-dev diffstat enscript gettext-kde hspell kate kdebase-dev
    kdelibs4-dev kdeprint kdesdk-scripts kfind khelpcenter klipper kmenuedit
    konqueror konqueror-nsplugins konsole ksmserver ksplash ksysguard ksysguardd
    kwin libacl1-dev libart-2.0-dev libarts1-dev libartsc0-dev libasound2-dev
    libaspell-dev libatk1.0-dev libattr1-dev libaudio-dev libaudiofile-dev
    libavahi-client-dev libavahi-common-dev libavahi-compat-libdnssd1
    libavahi-glib-dev libavahi-qt3-dev libbonobo2-dev libbonoboui2-dev
    libbz2-dev libcairo2-dev libcroco3-dev libcupsys2-dev libdbus-1-dev
    libdbus-glib-1-dev libdbus-qt-1-dev libesd0-dev libexpat1-dev
    libfontconfig1-dev libfreetype6-dev libgconf2-dev libgcrypt11-dev
    libgl1-mesa-dev libglade2-dev libglib2.0-dev libglu1-mesa-dev
    libgnome-desktop-dev libgnome-keyring-dev libgnome-window-settings-dev
    libgnome2-dev libgnomecanvas2-dev libgnomeui-dev libgnomevfs2-dev
    libgnutls-dev libgpg-error-dev libgsf-1-dev libgtk2.0-dev libice-dev
    libidl-dev libidn11-dev libjasper-1.701-dev libjpeg62-dev libkadm55
    libkrb5-dev liblcms1-dev liblua50-dev liblualib50-dev liblzo-dev
    libmetacity-dev libmng-dev libogg-dev libopencdk8-dev libopenexr-dev
    liborbit2-dev libpango1.0-dev libpcre3-dev libpcrecpp0 libpng12-dev
    libpopt-dev libqt3-headers libqt3-mt-dev librsvg2-dev libsasl2-dev
    libselinux1-dev libsepol1-dev libsm-dev libssl-dev
    libstartup-notification0-dev libtasn1-3-dev libtiff4-dev libtiffxx0c2
    libvorbis-dev libwnck-dev libx11-dev libxau-dev libxcomposite-dev
    libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev
    libxft-dev libxi-dev libxinerama-dev libxml2-dev libxmu-dev libxmu-headers
    libxrandr-dev libxrender-dev libxres-dev libxslt1-dev libxt-dev lua50
    mesa-common-dev poster psutils qt3-dev-tools quilt x11proto-composite-dev
    x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-gl-dev
    x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev
    x11proto-resource-dev x11proto-xext-dev x11proto-xinerama-dev xtrans-dev
    zlib1g-dev
    0 upgraded, 142 newly installed, 0 to remove and 0 not upgraded.
    Need to get 49.5MB of archives.
    After unpacking 159MB of additional disk space will be used.
    Do you want to continue [Y/n]? n
    Abort.
    [/code]

  • Alan Bell says:

    interesting question. It certainly isn’t all KDE crap, mostly it is lib*-dev packages. There is a bunch of gnome/GTK packages in your list along with core dev packages and the Mesa OpenGL dev packages. I can’t quite see why a text editor like kate would be listed as a build dependency!

  • Diego Rivera says:

    Hey,

    Can you post your resulting xorg.conf? I have compiz+emerald working fine, but performance is dismal on a similar-hardware system:

    AMD Athlon64 3400+
    nVidia GeForce 6200 (my old GF 6800GT burned out on me)

    Cheers

Leave a Reply to Alan Bell

XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>