Quantcast
PCWorld.com is upgrading some back-end systems. Some site features, such as user registration, may be temporarily unavailable.

Blogs

    Free Agent

  • Matthew Newton keeps a watchful eye on Open Source and Free Software, and shows that you don't need commercial apps to get the job done.
  • Subscribe to this blog

Free Agent: How to Compile Free Software Apps

Matthew Newton, PC World

Fear Not the Compiler

First off, I downloaded the source code for Rhythmbox 0.9.6. Free Software source code is almost always distributed in .tar.gz or .tar.bz2 files (the Unix equivalents of .zip files). So I downloaded rhythmbox-0.9.6.tar.gz to my desktop.

Once it arrived, I right-clicked it and selected Extract Here. Then I opened a terminal window (Applications, Accessories, Terminal) and the advanced package management interface, Synaptic (System, Administration, Synaptic Package Manager). (On most non-Ubuntu systems, you'll have a different package manager, which may or may not have the spiffy search abilities I describe below. You may need to experiment a bit to determine how to apply these instructions to your situation.)

In Synaptic, I began by right-clicking the package named 'build-essential' and selecting Mark for Installation. Then I clicked Apply to download and install the package. (Build-essential provides the tools required to compile apps from source code; I kept it installed for convenience in the future.) I left Synaptic open, because I wasn't done with it yet.

In my terminal window, I entered cd Desktop/rhythmbox-0.9.6 to switch to the folder I had just created. And then I entered Magical Incantation 1 of 3:

./configure

This started the configure script in the current folder. The configure script is designed to check for all the system components that your app will need as it gets built by the compiler. If the script fails to find something it's looking for, it will quit and let you know. And that's what's happened here, as configure reported the following:

checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool

In plain English, this meant that I needed to install a Perl module named XML::Parser before I could compile Rhythmbox. So, I switched back to my Synaptic window, where I clicked the Search button, selected Description and Name under 'Look in', and entered "XML::Parser" as my search term.

The results included a package called libxmlparser-perl. Based on the package's description in Synaptic, this seemed to be what I was looking for, so I installed the package by right-clicking it, selecting Mark for Installation, and then clicking Apply.

I then returned to my terminal and issued Magical Incantation 1 again. (Tip: To repeat the last command in a terminal window, press the Up Arrow key and then Enter.) This time configure spit out:

No package 'gnome-vfs-2.0' found

A search for "vfs" in Synaptic turned up a package called libgnomevfs2-dev. This is what's known as a "development library." It is not uncommon for an application to be dependent on dozens of these at compile time. On most distributions, development library packages begin with "lib" and end with "-dev" or "-devel." I installed libgnomevfs2-dev and ran configure again. Now I saw:

No package 'gtk+-2.0' found
No package 'libgnomeui-2.0' found
No package 'libglade-2.0' found

Searching in Synaptic for "gtk", "gnomeui", and "glade" revealed the packages libgtk2.0-dev, libgnomeui-dev, and libglade2-dev. I installed them and ran configure again.

checking for TOTEM_PLPARSER... configure: error: totem playlist parsing library not found or too old

I searched Synaptic for "totem" and found the libtotem-plparser-dev development library package. I installed it and ran configure again. My readers are sharp, so no doubt you're catching the pattern by now: Configure tells you what's missing. You go fetch it via the package manager. Rinse and repeat.

Now configure said:

checking for GSTREAMER_0_8... checking for GSTREAMER_0_10... configure: error: GStreamer not found, or older than version 0.8.2/0.9.7

Searching Synaptic for "gstreamer", I saw that I had many gstreamer packages installed, but not the libgstreamer0.10-dev development library, so I installed that and ran configure again. It spit the exact same GSTREAMER message back at me again, so I returned to Synaptic and installed one more package, libgstreamer-plugins-base0.10-dev. Now configure reported something new:

checking for LIBNAUTILUS_BURN... configure: error: libnautilus-burn not found or too old

I located libnautilus-burn-dev in Synaptic and installed it, only to be confounded when configure returned the same error once more. This was a tad frustrating, as the message specifically complained about libnautilus-burn, which I had just installed. But peeking in Synaptic again, I noticed a related development library that wasn't installed: libnautilus-extension-dev. I installed that, and when I ran configure it moved on:

configure: Rhythmbox was configured with the following options:
configure: ** Tree database is enabled
configure: ** Tag writing is enabled
configure: ** Track transfer is enabled
configure: ** iPod write support is enabled
configure: ** Multimedia keys support is enabled
configure: MusicBrainz support is disabled
configure: ** GStreamer 0.10 player is enabled
configure: iPod integration disabled
configure: ** CD burning support enabled
configure: DAAP (music sharing) support is disabled
configure: libnotify support is disabled
configure: ** HAL support enabled
configure: Python support disabled
configure: ** gnome-keyring support enabled
configure: Audioscrobbler support disabled
configure: ** Separate metadata helper process enabled
configure: using internal libsexy
configure: End options

Configure had run its battery of tests and reported no errors. My terminal was awaiting a new command. I could have compiled Rhythmbox right then, as I'd met the minimum dependencies to do so.

Instead I looked at the features that would be disabled, due to more missing dependencies, if I were to compile then. I certainly wanted iPod support--ditto for DAAP music sharing, which would let me share music with iTunes users on my local network. In fact, I wanted all of the missing features compiled in, so it was time for one more hunting trip through Synaptic.

Searching for "ipod" turned up libgpod-dev; when I ran configure after installing that package, it reported that iPod integration was enabled. I attacked the other disabled features similarly.

The only one that really hung me up was DAAP sharing. Synaptic didn't return anything useful when I searched its site for "DAAP." I was at a loss, so I returned to Rhythmbox's site to see what it had to say about dependencies.

Lo and behold (and I should have noticed it earlier), the site specified that something called "libsoup 2.2" is required for DAAP support. A Synaptic search for "libsoup" revealed libsoup2.2-dev. After installing that, configure reported that I was ready to compile Rhythmbox with all the features I wanted enabled. So, breathing a happy sigh of relief, I typed Magical Incantation 2 of 3:

make

The compiler launched into action, scrolling a dizzying array of commands through the terminal. When you experience this, don't be intimidated just because it's all Greek to you! The compiler's simply doing its thing. Compiling an app from source code takes some time, so while the PC is working, grab yourself a beverage, mow the lawn, scrub the tub, or give Mom a call. After a while, the compiler will quit. If all has gone well, its last lines will be devoid of the word 'error' and will look something like this:

make[2]: Leaving directory '/home/mnewton/Desktop/rhythmbox-0.9.6/tests'
Making all in doc
make[2]: Entering directory '/home/mnewton/Desktop/rhythmbox-0.9.6/doc'
Making all in reference
make[3]: Entering directory '/home/mnewton/Desktop/rhythmbox-0.9.6/doc/reference'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/mnewton/Desktop/rhythmbox-0.9.6/doc/reference'
make[3]: Entering directory '/home/mnewton/Desktop/rhythmbox-0.9.6/doc'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/mnewton/Desktop/rhythmbox-0.9.6/doc'
make[2]: Leaving directory '/home/mnewton/Desktop/rhythmbox-0.9.6/doc'
make[2]: Entering directory '/home/mnewton/Desktop/rhythmbox-0.9.6'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/home/mnewton/Desktop/rhythmbox-0.9.6'
make[1]: Leaving directory '/home/mnewton/Desktop/rhythmbox-0.9.6'

This indicated a successful compilation.

Now it was time for Magical Incantation 3 of 3:

sudo make install

Since sudo told the machine I was doing an administrative task (in this case, installing software by hand), it prompted me for my password. (On non-Ubuntu Linuxes, you may need to become the root user temporarily by entering the su and providing the root user's password when prompted. Then enter make install and then exit.)

Well looky here, I had just compiled and installed Rhythmbox 0.9.6. I verified this by running Rhythmbox (Applications, Sound & Video, Rhythmbox Music Player), selecting Help, About, and checking the version number. Hooray!

A couple housekeeping items remained. First, the .tar.gz file I had downloaded to my desktop could be deleted at that time.

I also could have deleted the extracted folder on my desktop, but if I had, I would have lost any easy means to remove the application I had just installed. Here's why: When I ran sudo make install above, Rhythmbox's assorted components installed across various directories on my system (this is true of most flavors of Unix). Tracking all those parts down individually and deleting them at some later date would not be at all practical. However, if I held on to the extracted folder (perhaps storing it somewhere under my home directory for safekeeping) and returned to it later with a terminal window, I could issue sudo make uninstall--and all those various files would be deleted.

Next, I wanted to repeat the exercise by compiling and installing Gaim instant messaging software, as well as introducing an alternative to Magical Incantation 3 that would make for cleaner uninstallation of my custom-compiled app later on.

  • Recommend this story?
  • 0 Yes
    0 No

"Free Agent: How to Compile Free Software Apps" Comments

Learn more about the Windows Phone PCWorld Gift Guide

Focus on Personal Productivitysponsored by Microsoft

  • Personal Finance 2.0 These free and fee-based Web services not only aggregate data from your online bank accounts, they give you tools for managing your money.
  • High-Tech Travel Tips Plenty of stories provide advice for elite mobile professionals. But what about you, the unproductive traveler?

People who read this also read:

All PC World Blogs

Sponsored Links