Building Linux Audio Applications 101: A User's Guide, Part 2
In this article I finish the process we started in the last episode. Read on for the thrilling denouement.
The Build
After all the preparation described in the first part of this article the build process itself is rather anticlimactic. Building from sources with the GNU autotools is this easy :
./configure --help
./configure --with-optionYY=yes --with-optionZZ=no
make
sudo make install
The make command starts the build process. Its actions depend upon the directives found in a very important component called a makefile that typically includes a variety of commands to summon the required dependencies, compiles the individual object files (more about those files in a moment), links the objects into a single executable (a.k.a. the binary), and installs the completed program.
However, the source code must be configured before running the make utility. The following commands will display the configuration options for some of the more popular build managers :
./configure --help (with the autotools system)
./waf configure --help
scons -h (local options)
scons -H (global options)
Check for the available configuration options before proceeding to the make stage. The configuration stage will determine whether your environment includes the correct tools for constructing the software. It will also let you know about missing dependencies, version mismatches, special enhancements, and any other features or problems that will affect the build process.
A few words more regarding configuration options. Some may be enabled by default, while others must be manually added to the configuration stage. For example the following options declare the installation's target directory tree and adds support for the LAME MP3 encoder :
./configure --prefix=/usr/local --with-lame
When the build process has reached the linking stage the LAME library will be added to the library dependencies. When you run the installation procedure the program and its needed parts will be installed to the /usr/local directory hierarchy. Thus, the executable binary will be found at /usr/local/bin/progname, its headers will be in /usr/local/include/progname (or possibly just /usr/local/include), its examples and templates will be in /usr/local/share/progname, and so forth.
With Scons, once you've determined which options you want you simply add them to the scons build command in this manner :
scons OptionA=1 OptionB=0
where 1 indicates that the option is to be used, 0 leaves it unused.
The waf system incorporates aspects of the autotools process :
./waf configure --help
./waf configure --prefix=/usr
./waf build
Typically you can run waf with no options and it will return a list of available options and targets.
Assuming a best case, once the build process begins it will automatically run until it either completes the build or hits an unrecoverable error. Fortunately all build systems report critical errors in such a way that should assist in resolving the problems. The configuration stage can miss dependency details that won't appear until the compiler reaches the linking stage, the final step in the build process. You may find that a component is still missing or that a different version is needed, in which case you'll need to retrieve the required part or build it yourself. When you return to your original process it should restart the build from the point where the error occurred.
Installation And Uninstalling
Installing your newly built software is easy, but it does require root (superuser) privileges. It also requires a specified installation directory. Typically you'll install a new program or utility in either the /usr or /usr/local hierarchy. The target directory can be indicated with the --prefix option for an autotools-based build or added to the build utility's configuration file (e.g. the Sconstruct file for scons). Such an option allows installation in any indicated directory, such as /opt or the user's $HOME directory. However, if you intend to run the program from anywhere within the system you must ensure that it is visible to the system by adding its path to the PATH statement, e.g. :
export PATH=$PATH:/opt/mysoftware:/home/dave/bin
That command adds two new paths to the existing system path ($PATH). Now you can invoke programs in those paths from anywhere else in your system.
On some systems it is relatively safe to install new versions of software over the distribution's installed versions. However, care must be taken to indicate the correct installation path, else a double installation may occur. This situation is not going to blow up your system, but it will surely confuse it until you either remove the original files or re-install the new ones (after uninstalling them from their incorrect targets). It is also imperative that you know exactly what you're doing before upgrading or downgrading system components, especially components of the audio infrastructure. Applications may be version-dependent, so move rather than destroy the original components. You may yet need them to restore a borked system.
Look out for stale configuration files for applications, especially in your $HOME directory. It's best to remove them or copy them to a temporary directory, the application should replace them after a first run.
A final consideration for system software. Most installers will update the system library cache by invoking ldconfig at the end of the installation, though you may want to run it manually if you're unsure about the update. Also, make sure your installation target hierarchy (set with the --prefix configuration option) is included in /etc/ld.so.conf. It won't do much good to install something in /usr/local/bin if the /usr/local hierarchy is not in the system's library search path.
Okay, you built the program without troubles, you installed it successfully, you've run it, and it just isn't what you were looking for. You want the disk space back, so it's time to uninstall, an action that might be a simple one-line command or a nightmare of hunting for the installed parts and removing them by hand, one by one. Most build systems include mechanisms for uninstalling a program, such as the following commands for three popular systems :
sudo make uninstall sudo scons -c install sudo ./waf uninstall
Your package manager can be used to remove components previously installed by your distribution. However, it is important to note whether the removal is normal or complete. A complete removal will uninstall all files associated with the package, including configuration and preference files. Complete removal is advised when you intend to replace system components such as ALSA or JACK, but the normal removal procedure should suffice for user-level applications.
Outro, Part 2
I hope you've enjoyed this little technical tour, even if you're an old hand at rolling your own apps. As I said in the beginning of the tour, it's not rocket science, anyone can learn how to do it. Consider the instructions, proceed with deliberation, and trust your intelligence. I'm not a trained computer engineer, I have no background in computer science (or any other science), I don't even have a college degree, but I routinely compile, install, and configure the audio software I use here every day at Studio Dave. I get the best fit for my hardware, along with the satisfaction of knowing exactly what support has been built into my system. Truly, if a self-taught 59-year old musician can do it, you can too.
Similis sum folio de quo ludunt venti.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Reply to comment | Linux Journal
7 hours 12 min ago - Dynamic DNS
7 hours 46 min ago - Reply to comment | Linux Journal
8 hours 45 min ago - Reply to comment | Linux Journal
9 hours 35 min ago - Not free anymore
13 hours 37 min ago - Great
17 hours 24 min ago - Reply to comment | Linux Journal
17 hours 32 min ago - Understanding the Linux Kernel
19 hours 47 min ago - General
22 hours 17 min ago - Kernel Problem
1 day 8 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
I suggest,the target
I suggest,the target directory can be indicated with the --prefix option for an autotools-based build or added to the build utility's configuration file.