Installing from Source on a Mac

This page covers installing the latest development version of libavg under Mac OS X using a standard Unix ./configure && make && make install routine. Alternatively, you can install libavg using MacPorts or Homebrew.

You will need the XCode command line tools, git and cmake installed. Current libavg should work on all OS X versions from 10.7 to 10.11. At the moment, libavg works with Python 2.x and is not compatible with Python 3.x.

(!) Note: (!)
Fink, Homebrew and MacPorts can interfere with this setup. Unless you know exactly what you're doing, make sure no components installed by package managers are found when you're compiling libavg or the dependencies. If you want to install libavg using MacPorts or Homebrew, have a look at the instructions mentioned above.

Directory Tree Setup

This is the libavg directory tree before the build:


libavg/libavg contains the libavg source tree checked out from git:

1$ export AVG_PATH=/Users/$USER/libavg
2$ cd $AVG_PATH
3$ git clone

libavg/deps needs to contain the libavg dependencies in macdependencies. (For older libavg versions, older dependencies versions are at the bottom of this page). Download them. Then, to compile the libavg dependencies, execute the following:

1$ mkdir deps
2$ mv [macdependencies] deps
3$ source ${AVG_PATH}/libavg/mac/
4$ cd ${AVG_PATH}/libavg
5$ ./

Set $AVG_PATH to the actual location of your libavg tree and replace [macdependencies] with the location of the .tar.bz2 file you just downloaded. I export $AVG_PATH in my ~/.bash_profile and source whenever I need the libavg build environment. That way, the binaries in the libavg tree don't interfere with normal system operation. should be a more-or-less automatic process that just takes a while (13 mins on a 2013 MBP). It does ask for a root password, however, and under some circumstances, an inconsequential error pop-up ('depcomp'...) will appear.

When the build is finished, the directory tree should look like this:


This tree contains all files created by the build.

libavg Itself

To build libavg itself, do the following:

1$ cd libavg/libavg
2$ mkdir build
3$ cd build
4$ cmake ..
5$ make -j3
6$ sudo make install

-j3 is the number of parallel compile processes you'd like to run. A good heuristic is to set this to the number of cores you have + 1.

To install libavg into a virtualenv, make sure it is active during the cmake step.

See if everything works:

1$ make check

The first time libavg starts (in other words, when you run make check), it builds a cache of fonts. Depending on the machine and the number of fonts, that can take up to 30 seconds.

Running libavg Programs

You need to have /usr/local/lib/python2.x/site-packages in your PYTHONPATH:

1$ export PYTHONPATH=/usr/local/lib/python2.7/site-packages

Edit ~/.profile so it's always there.

Possible Issues

Python 64 Bit Issue

Python needs to be running in 64 bit mode. This is the default. If you've changed it for some reason ( will issue an appropriate error message), the Python man page provides instructions on how to switch the preinstalled python:

Older Macdependencies

svn revision Archive
< 9377 macdependencies.
< 9346 macdependencies.1.8.0.tar.bz2
< 6991 macdependencies.1.7.0.tar.bz2
< 6478 macdependencies.1.6.0.tar.bz2

macdependencies. (109.2 MB) coder, 14/10/2013 23:47

macdependencies. (132.6 MB) coder, 31/10/2013 17:58

macdependencies. (133.8 MB) coder, 15/06/2015 19:52

macdependencies. (134 MB) coder, 23/03/2016 13:31