Difference between revisions of "Developing On Linux"
(Added note about ALSA development library)
Revision as of 10:59, 30 August 2007
Note: if you use Linux and need to compile Audacity from source (say, if you use Linux but we don't have a binary package like an RPM available for your distribution) but you don't know how, see CompilingAudacityForBeginners
For building with Windows, see [install-directory]\win\compile.txt
- Stable tarball: The easiest way to get Audacity is to download a release from the Audacity website. All past releases of Audacity are archived on our Sourceforge file release page.
- CVS: The other main way to get Audacity is to use CVS - this is the best way if you want to actively develop Audacity, or keep up with the latest and greatest features. For more information, see our CVS page.
Audacity 1.2.x (stable)
At a minimum, Audacity 1.2.x requires wxWidgets. Currently we recommend using version 2.4.2. You're welcome to use any 2.4.x release, but there were some new bugs in 2.4.1 that cause problems, so the current version is recommended. Audacity will not work with wxX11 (as it's incomplete, and things like dialogues are missing that we need), or with unicode builds of wxWidgets (so configure with --disable-unicode)
Older versions are completely unsupported. It may be possible to compile Audacity 1.2.x with wxWidgets 2.5.x, but please don't expect it to compile out-of-the-box. Unfortunately this hasn't stopped some distros trying, and so annoying a lot of users. Note that wxWidgets 2.4.2 for Mac OSX does not compile correctly; getting it from CVS resolves the issue.
Audacity supports wxGTK for Linux (and other Unix), wxMac for Mac OS X, and wxMSW for Windows using either MSVC++ or Cygwin. There is no support for wxMotif, wxX11, or other wx variants yet.
Audacity does not currently support the Unicode builds of wxWidgets. When configuring wxWidgets on Unix, make sure you don't enable these features. To be safe:
Having GTK2 enabled does not usually cause any problems, however, providing the build and runtime versions match exactly (not always the case with binary distributions).
If you have Mac OS X, you may want to patch wxMac before building it - see below.
Audacity 1.3 (unstable)
The development branch of audacity (version 1.3.x or the CVS hEAD) requires wxWidgets 2.6.3 or higher. Unicode and GTK2 builds are supported by default. Older development versions (2.5.x) may not work, so get the current wxWidgets 2.6.x release.
The configure script of Audacity gives the option to link in or not to link in a number of 'optional' packages. 'Optional' as some are more optional than others.
There are possibilities surrounding the following packages:
libmad use libmad for mp3 decoding support vorbis enable ogg vorbis support id3tag use libid3tag for MP3 ID3 tag support libsndfile which libsndfile to use: [local], [system] libresample use libresample: [yes], [no] libsamplerate use libsamplerate (instead of libresample): [local], [system], [none] libflac local system none - enable FLAC support [default=none] ladspa compile with ladspa plug-in support [default=yes] nyquist compile with Nyquist support [default=yes] PortMixer compile with PortMixer [default=yes] PortAudio which version of PortAudio to use (=[v18,v19])[default=v18] soundtouch compile with SoundTouch [default=yes] help Make the help file "audacity-1.2-help.htb"[default=yes]
The following syntax is used as a parameter to the configure script to enable or disable a package or to pass further information about the package.
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
The possibilities range from whether to include them or not to whether to use local or system versions. In almost all cases these are standard libraries, and only provided in CVS for convenience, so if you have up to date versions installed as shared libraries you should select the external copies. The exceptions are libresample (which is developed as part of audacity), nyquist (which we have modified to integrate it with audacity), and portaudio (which has had to be patched to make it work).
To enable support for ogg files:
To use an external sndfile library (which you have previously built and installed):
To disable nyquist:
Compiling on Unix
To compile Audacity on Linux, Mac OS X, and most other Unix systems, use the standard "configure; make" sequence:
However, you may want to start by running ./configure --help first to see the options, and possibly add special options.
If you are compliling from a CVS checkout, then you can re-generate the configure script by running
in the top level directory first.
Note: see the page CompilingAudacityForBeginners if you are confused by anything above. We walk you through the process step-by-step.
If this causes trouble, with errors like
configure: warning: CC=gcc: invalid host type configure: warning: CXX=g++: invalid host type configure: error: can only configure for one host and one target at a time configure: error: /bin/sh './configure' failed for lib-src/portaudio-v19
Then try prefixing the configure command with "env -i"
env -i ./configure --without-portmixer --with-portaudio=v19
This appears to be fixed for Audacity 1.2.4 and onwards.
In order to use ALSA devices with PortAudio v19 (the default for audacity 1.3.2 beta) it is necessary to have the ALSA development library installed before compiling Audacity. In Ubuntu Studio, for example, this can be installed by running
sudo apt-get install libasound2-dev
Compiling on Windows
See the file win/compile.txt in the Audacity source code. Feel free to add any tips or tricks here. As of December 2004, now in CVS are *.vcproj files which will build in the newer versions of MS VC++ (.NET). 7-zip is a good free decompressor for extracting the source code archives.
Compiling on Mac OS X
Currently only command-line building is supported; there is no up-to-date Project Builder or Xcode project file. Compile just as you would a Unix program (see above). After building "audacity", an additional step is performed, that creates "Audacity.app". Make sure that you run "Audacity.app" and not "audacity", otherwise it won't work. Note that in the "mac" directory there is a patch file for wxMac-2.4.0 - it's recommended that you apply this patch first. This enables support for custom cursors, allows disabling anti-aliased text (for speed), and fixes a couple of bugs.