Installing LAME

As of September 2005 the most recent LAME release is v3.96.1. This release was originally posted in July 2004 and has been the working version since. The LAME homepage has links to other sites hosting the latest code, which comes in a variety of packages; CVS, tar, and source RPMs as well as binary RPMs for the different Linux flavors. Check your distribution CDs to see if LAME is not already included as a package or RPM. Most distributions have stopped this practice due to licensing issues, but the latest RPMs can still be obtained for your Linux flavor of choice. And if not RPMs, then source is always readily available.

Here is a brief description of LAME and its functionality:

Red Hat users might consider using the LAME RPMs. The Freshrpms site, http://freshrpms.net/ along with FreshRPMs, http://freshrpms.net/ both have the latest RPM releases for current Red Hat releases. If you plan on using LAME heavily in conjunction with icecast streamers, install both the lame and the lame-devel RPM files. The easiest way to do this is to use the yum command:

# yum install lame lame-devel

Yum is a dynamic and robust updating tool. It is designed specifically with the Red Hat distribution in mind. The latest Fedora releases include yum as a standard package. You may have to download and install the latest yum from source for older Linux releases.

Debian users may also recognize the Apt tool, which works much like yum. Apt has been ported over to Red Hat as well and makes automatic updating and installing new packages also a simple chore. If Apt is installed on your machine, execute this command:

# apt-get install lame lame-devel

Otherwise, download the RPM files to disk and run the standard command:

# rpm -ivh lame-*

If you prefer examining the code prior to installing or if you favor source code compilation over binaries, install and compile the code. Advanced users may have their own techniques, but these steps guarantee a clean install. Execute the following commands to install LAME:

# cp lame-3.96.1.tar.gz /usr/local/src/
# gunzip -c lame-3.96.1.tar.gz | tar xvf -
# cd lame-3.96.1/
# ./configure && make && make install

Note

The steps outlined here may appear rather pedantic, but it is intended to assist the beginning user. As you progress through this book such basic steps will be mentioned less frequently.

If you make a mistake during the compilation or decide later you wish to add other variables into the mix, perform a make clean command. This returns the code to its pristine state. Or, if you later change your mind and decide to use the LAME RPMs exclusively, execute the make uninstall command. This removes the installed binary.

Ogg Vorbis Options

You may also define Ogg Vorbis encoding with the configuration, but the ogg library files or the libogg, libogg-devel, libvorbis and libvorbis-devel RPM packages must already be installed. They can just as easily be installed from source code as well.

Download the Ogg Vorbis source code files off the main Ogg Vorbis site, http://www.xiph.org/. Save and extract the source files in the same location and manner as you did the lame source code. Novice users may prefer using a different syntax when extract the files. Here is an alternative method:

# cp libogg-1.1.2.tar.gz /usr/local/src/
# tar -xzvf libogg-1.1.2.tar.gz
# cd libogg-1.1.2/
# ./configure
# make
# make install

The Ogg Vorbis libraries currently packaged with most Linux flavors by default act as a replacement for the MP3 codecs. Red Hat Linux supplies the latest Ogg binaries, which work well with icecast and related applications. When compiling LAME from source, however, consult the INSTALL file for additional configuration settings. LAME generally installs to /usr/local/bin by default.

Warning

Be aware that if compiling LAME from source you may be required to have the latest gtk+-devel RPM. You can confirm this if during the configuration the script does not detect the gtk-config. Again, the easiest and quickest method of installing this library is to use yum or apt-get and request the package.

One last note regarding the installation of LAME; the LAME libraries when installed from source are normally placed in /usr/local/lib. If you are not extremely security conscious or do not border on the paranoid, place a referring line in your /etc/ld.so.conf file and run the ldconfig command. This allows other programs to refer to the LAME libraries. Some distributions, such as SUSE, have already included this line.