How to compile Mixxx for Mac OS X

Compiling Mixxx for Mac OS X is a simple process once you have all dependancies and Qt set up properly. This guide assumes you have basic knowledge about using and compiling with the command line (eg: ./configure, make). If you don’t, there is a basic guide available at http://www.ee.surrey.ac.uk/Teaching/Unix/unix7.html.

This guide is written for Snow Leopard (10.6.x) and Leopard (10.5.x) but should work on Lion (10.7.x).

1. Install Xcode development tools

You will need the Xcode development tools installed.

Xcode 3.2.6 is the last version that can be downloaded for free for users of Snow Leopard (10.6.x) . Downloading it requires a free registration at Apple's developer site (but a paid developer program membership is not required). Download

Xcode 4.2 for Snow Leopard (10.6.x) requires that you have a PAID (99$/year) developer account, it can NOT be downloaded or updated from the Mac App Store (MAS). Download

Xcode 4.2 for Lion (10.7.x) can be downloaded for free from the Mac App Store (MAS), it will not install on Snow Leopard 10.6.x). Download

Older versions of Xcode can be be installed from your original Mac OS X Install Disc 2, look at this page for a guide.

If you need a specific older version, check the Apple download archive. Downloading it requires a free registration at Apple's developer site.

2. Install build dependencies (Method 1 - MacPorts)

Mixxx relies on several external libraries for various features. Fortunately, you can automatically download and install most of these dependencies through MacPorts. MacPorts is a package management system that simplifies the installation of software on Mac OS X.

  • Start by downloading and installing one of the .dmg disk images for MacPorts: http://www.macports.org/install.php
  • Next, open the Terminal application and use the following command to install the necessary libraries:
    sudo port install scons libid3tag libmad portaudio libsndfile libogg libvorbis mp4v2 portmidi faad2 bzr taglib libshout2
  • Finally, after that has completed, download and install the Qt SDK package for your platform.

If This is Your First Time Using MacPorts

After installing MacPorts, using MacPorts to install the required libraries is a simple process. Using the command sudo port install X, where X is the name of each library you’ll need, MacPorts will automatically download and install the required dependencies. This can be done one at time by entering single entries like sudo port install scons for each library listed above or all at once by entering the entire command given above.

Note that if you attempt to install everything at once and an error occurs in installation of a library, MacPorts will not continue past the library that caused the error. For example, if after entering the full command you receive an error with bzr, you’ll need to sort out the error and then finish the installation by entering sudo port install bzr taglib libshout2 to properly install bzr and then continue with installing taglib and libshout2.

If a library already happens to be installed on your computer, that's a time-saver, and you'll see something similar to this:

 ~/Music/mixxx>sudo port install libmad
 Skipping org.macports.activate (libmad ) since this port is already active
 --->  Cleaning libmad

Otherwise, MacPorts will automatically install the library and you'll see something similar to this:

 ~/Music/mixxx>sudo port install libid3tag
 Password:
 --->  Fetching libid3tag
 --->  Attempting to fetch libid3tag-0.15.1b.tar.gz from ftp://ftp.mars.org/pub/mpeg/
 --->  Verifying checksum(s) for libid3tag
 --->  Extracting libid3tag
 --->  Configuring libid3tag
 --->  Building libid3tag with target all
 --->  Staging libid3tag into destroot
 --->  Installing libid3tag 0.15.1b_0
 --->  Activating libid3tag 0.15.1b_0
 --->  Cleaning libid3tag

Note that the password asked for is an admin password for your local machine. This is because you are going into super-user mode in order to write the libraries to your hard drive. It's basically a safe operation, but they put it behind a password so the area where the libraries are stored doesn't get touched very often.

If you get a message like this:

 Error: Target org.macports.fetch returned: fetch failed

It probably means that the config file for port hasn't been updated. Perhaps there has been a newer version of the library released. You may be hosed at this point, but if you have an older version of the library already installed on your system, it may still compile and run properly.

2. Install build dependencies (Method 2 - Compile by hand)

You will need to install the following by hand for the compile process:

  • scons (Download, Install guide) – if you have Macports and have already installed its version of python then “sudo port install scons” is also a reasonable way to get this installed.
  • libid3tag (Download) – `./configure && sudo make install` or “sudo port install libid3tag”
  • libmad (Download) – `./configure && sudo make install` or “sudo port install libmad” . If you run into the following error with libmad in 10.6: version.c:1: error: CPU you selected does not support x86-64 instructions run the following export CFLAGS=”-arch i686” then, configure, make, sudo make install as normal.
  • Portaudio Download – Use the latest “v19” trunk snapshot – `./configure && sudo make install` or “sudo port install portaudio”
  • libsndfile (Download) – `./configure && sudo make install` or “sudo port install libsndfile”
  • libogg, libvorbis (Download) – `./configure && sudo make install` or if you have been using port, :?: this will have already been covered by previous ports.:?:
  • mp4v2 (Download) or “sudo port install mp4v2”
  • portmidi (Download, or “sudo port install portmidi”
  • faad2 (Download) or “sudo port install faad2”
  • QT 4.6.0+ (Download) – get the Cocoa Mac binary package for Mac OS X 10.5 - 10.6 (32-bit and 64-bit) and install to the default location. – DO NOT use qt4-mac delivered through macports. It will give you an error messages that some header files are missing e.g. libmad and others. This is due to a missing QTCore framework.
  • Bazaar (Download) – Get the installer for your version of OS X. The installer contains the Bazaar Explorer GUI. – or “sudo port install bzr” and “sudo port install bzr-explorer” for the GUI
  • HSS1394 – only applicable to 1.9+ – “bzr checkout lp:hss1394” then “scons” then “sudo scons install” but you probably don't need it unless you got a HSS1394 MIDI device like the Stanton SCS 1 series. Get around this by including “hss1394=0” when running scons on mixxx (see below).
  • taglib – (Download) – or “sudo port install taglib”
  • libshout – (Download) – or “sudo port install libshout2”

3. Get Mixxx

If you want to compile Mixxx, you'll need to download the source code. Either grab the source for the latest release off our downloads page, or checkout the latest Mixxx code:

bzr checkout lp:mixxx/1.9 (for old stable v1.9)
bzr checkout lp:mixxx/1.10 (for current stable v1.10)
bzr checkout lp:mixxx (for latest trunk)

4. Compile and install

If you got the source code from BZR, change to the newly created “mixxx” directory, and use scons to compile and install:

cd mixxx
scons
scons bundle

If it you get a message like:

Error: QT path does not exist or QT4 is not installed.

Then try the “scons” command above like this:

scons qtdir=/Developer

If it you get a message like:

d: warning: in /opt/local/lib/libGLU.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

Then try the “scons” command above like this:

scons machine=x86_64

This should generate Mixxx.app. Generating the .app has some expensive scanning and relinking steps so if you want to avoid this you can skip 'scons bundle' and instead on the first run of mixxx run it as:

./mixxx --resourcePath res/

So that it records res/ in mixxx.cfg as where to find skins etc instead of dying at startup.

If you wanted to update later to a newer BZR snapshot, you would go back to the mixxx directory and run:

bzr update

5. Create an XCode project (optional)

If you want to work on Mixxx with XCode for an IDE:

This is taken from the Scons site, who have a pretty good description of how to get a scons project up and running in XCode:

  1. File→New Project→Mac OSX →Others, choose “External Build System”
  2. Save the project into the same directory as your SConstruct file.
  3. In Groups and Files → Targets, double click the target that was automatically created.
  4. Fill in the blanks, i.e. the full path to scons - like ”/System/Library/Frameworks/Python.framework/Versions/2.3/bin/scons” or ”/usr/local/bin/scons”
  5. You should now be able to build using the Build command from Xcode
  6. Right click “Executables” and choose “Add new custom executable” and point it to the executable you are building and then you can debug using Xcode.
  7. Use Debug → Breakpoints menu to add a symbolic breakpoint at main() - just type main where it says 'Double click for Symbol' - if you don't add this break point none of the breakpoints set in the editors will work, because gdb doesn't have the symbol information until you start debugging (Jim Ingham suggests turning off “Lazy Symbol Loading” in Debug Preferences.)
compiling_on_os_x.txt · Last modified: 2012/01/10 03:01 by hile
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki