Difference between revisions of "Developing On Linux"

From Audacity Wiki
Jump to: navigation, search
(pasted artinvent's contribution for now)
(integrated ArtInvent's contribution)
Line 2: Line 2:
 
   
 
   
 
* Also for building with Windows, see {{path|1=[install-directory]\win\compile.txt}}
 
* Also for building with Windows, see {{path|1=[install-directory]\win\compile.txt}}
 +
* [[Developing On Mac]]
  
* [[Developing On Mac]]}}
+
* '''Also see:''' {{external|1=[http://www.crotchett.com/kdevelop/index.html Tutorial: building Audacity on the Kdevelop IDE for KDE]}}}}
  
'''Also see:''' {{external|1=[http://www.crotchett.com/kdevelop/index.html Tutorial: building Audacity on the Kdevelop IDE for KDE]}}.
+
==Overview==
  
= Getting Audacity =
+
Compiling Audacity, or any GNU/Linux program for that matter, is basically a five stage process.
 +
#Install dependencies: other software necessary to run or compile.
 +
#Download the source code into a local directory.
 +
#Configure the compile with options, if any.
 +
#Compile
 +
#Install
 +
 
 +
The first stage is crucial: it is a lack of necessary dependencies that ruins 99% of failed compiles. This page should help with that.
 +
 
 +
The standard commands to compile a piece of software for stages 3, 4 and 5 are as follows, issued from within the local directory containing the source code.
 +
#CONFIGURE:  $ ./configure --[options-list]
 +
#COMPILE:  $ make
 +
#INSTALL:  $ sudo make install
 +
 
 +
 
 +
== Obtaining Audacity ==
  
 
* Stable tarball: The easiest way to get Audacity is to download a release from the {{external|[http://audacity.sourceforge.net Audacity website]}}.  All past releases of Audacity are archived on our {{external|1=[http://sourceforge.net/project/showfiles.php?group_id=6235 Sourceforge file release page]}}.
 
* Stable tarball: The easiest way to get Audacity is to download a release from the {{external|[http://audacity.sourceforge.net Audacity website]}}.  All past releases of Audacity are archived on our {{external|1=[http://sourceforge.net/project/showfiles.php?group_id=6235 Sourceforge file release page]}}.
Line 13: Line 29:
 
* 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 {{external|[http://audacity.sourceforge.net/community/developers#cvs CVS page]}}. For a CVS interface on Mac to access our CVS repository, try {{external|1=[http://sourceforge.net/project/showfiles.php?group_id=10072&package_id=13913&release_id=534524 MacCVS]}} (this needs an external SSH client if you want to commit code to our repository) or {{external|1=[http://www.heilancoo.net/MacCVSClient/ MacCVSClient]}}. On Linux, BSD and other open source operating systems, command-line CVS clients are typically included in the default installation, or are available directly from the operating system repository.
 
* 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 {{external|[http://audacity.sourceforge.net/community/developers#cvs CVS page]}}. For a CVS interface on Mac to access our CVS repository, try {{external|1=[http://sourceforge.net/project/showfiles.php?group_id=10072&package_id=13913&release_id=534524 MacCVS]}} (this needs an external SSH client if you want to commit code to our repository) or {{external|1=[http://www.heilancoo.net/MacCVSClient/ MacCVSClient]}}. On Linux, BSD and other open source operating systems, command-line CVS clients are typically included in the default installation, or are available directly from the operating system repository.
  
= Prerequisites =
 
  
== Audacity 1.2.x (stable) ==
+
== Prerequisites ==
 +
 
 +
=== Audacity 1.2.x (stable) ===
  
 
At a minimum, Audacity 1.2.x requires {{external|[http://wxwidgets.org/ 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)
 
At a minimum, Audacity 1.2.x requires {{external|[http://wxwidgets.org/ 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)
Line 25: Line 42:
 
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:
 
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:
  
  ./configure --disable-unicode
+
{{code|./configure --disable-unicode}}
  
 
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).
 
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).
Line 31: Line 48:
 
If you have Mac OS X, you may want to patch wxMac before building it - see below.
 
If you have Mac OS X, you may want to patch wxMac before building it - see below.
  
== Audacity 1.3 (unstable) ==
+
 
 +
=== 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 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.
  
= Optional Packages =
+
== Optional Packages ==
  
 
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.
 
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.
Line 48: Line 66:
 
|valign="top"|{{external|[http://www.ladspa.org/ LADSPA]}}           
 
|valign="top"|{{external|[http://www.ladspa.org/ LADSPA]}}           
 
|compile with LADSPA plug-in support [default=yes]
 
|compile with LADSPA plug-in support [default=yes]
 +
|-
 +
|width="20%" valign="top"|{{external|[http://flac.sourceforge.net/ libflac]}}
 +
|[local], [system], [none] - enable FLAC support [default=none]
 
|-
 
|-
 
|valign="top"|{{external|[http://www.mars.org/home/rob/proj/mpeg/ libmad]}}   
 
|valign="top"|{{external|[http://www.mars.org/home/rob/proj/mpeg/ libmad]}}   
 
|use libmad for mp3 decoding support
 
|use libmad for mp3 decoding support
|-
 
|width="20%" valign="top"|{{external|[http://flac.sourceforge.net/ libflac]}}
 
|[local], [system], [none] - enable FLAC support [default=none]
 
 
|-
 
|-
 
|valign="top"|[[libresample]]
 
|valign="top"|[[libresample]]
Line 89: Line 107:
 
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.
 
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]
+
{{code|<nowiki>--with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]</nowiki><br><nowiki>
  --without-PACKAGE      do not use PACKAGE (same as --with-PACKAGE=no)
+
--without-PACKAGE      do not use PACKAGE (same as --with-PACKAGE=no)</nowiki>}}
 +
 
  
 
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).
 
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).
  
Examples:
+
'''Examples:'''
  
 
To enable support for ogg files:
 
To enable support for ogg files:
  --with-vorbis=[local|system]
+
{{code|<nowiki>--with-vorbis=[local|system]</nowiki>}}
 +
 
  
 
To use an external sndfile library (which you have previously built and installed):
 
To use an external sndfile library (which you have previously built and installed):
  --with-libsndfile=system
+
{{code|<nowiki>--with-libsndfile=system</nowiki>}}
 +
 
  
To disable nyquist:
+
To disable Nyquist:
  --without-nyquist
+
{{code|<nowiki>--without-nyquist</nowiki>}}
  
= Compiling on Unix =
 
  
To compile Audacity on Linux, Mac OS X, and most other Unix systems, use the standard "configure; make" sequence:
+
== Compiling on Unix ==
 +
 
 +
To compile Audacity on Linux (or for that matter, Mac OS X and most other Unix systems), use the standard "configure; make" sequence:
 +
{{code|./configure<br>make}}
  
  ./configure
 
  make
 
  
 
However, you may want to start by running ./configure --help first to see the options, and possibly add special options.
 
However, you may want to start by running ./configure --help first to see the options, and possibly add special options.
  
 
If you are compiling from a CVS checkout, then you can re-generate the configure script by running
 
If you are compiling from a CVS checkout, then you can re-generate the configure script by running
  autoreconf
+
{{code|autoreconf}}
in the top level directory first.
 
  
If this causes trouble, with errors like
 
  
  configure: warning: CC=gcc: invalid host type
+
in the top level directory first. If this causes trouble, with errors like:
  configure: warning: CXX=g++: invalid host type
+
{{code|<nowiki>configure: warning: CC=gcc: invalid host type</nowiki><br><nowiki>configure: warning: CXX=g++: invalid host type</nowiki><br>configure: error: can only configure for one host and one target at a time<br>configure: error: /bin/sh './configure' failed for lib-src/portaudio-v19}}
  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
+
then try prefixing the configure command with "env -i":
 +
{{code|<nowiki>env -i ./configure --without-portmixer --with-portaudio=v19</nowiki>}}
 +
 
  
 
This appears to be fixed for Audacity 1.2.4 and onwards.
 
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
+
In order to use ALSA devices with PortAudio v19 (the default for Audacity 1.3.x 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
+
{{code|sudo apt-get install libasound2-dev}}
  
Compiling Audacity, or any Gnu/Linux program for that matter, is basically a five stage process.
 
  
1. Install dependencies: other software necessary to run or compile.
+
== Example dependencies: Audacity 1.3.4/Ubuntu 7.10 ==
 
 
2. Download the source code into a local directory.
 
 
 
3. Configure the compile with options, if any.
 
 
 
4. Compile
 
 
 
5. Install
 
 
 
The first stage is crucial: it is a lack of necessary dependencies that ruins 99% of failed compiles. This page should help with that.
 
 
 
The second stage is fairly simple and self-discoverable. Download the code from the project website and uncompress the tarball if necessary into a local folder.
 
 
 
The third stage is where some hesitation and confusion results. This page should also help with that.
 
 
 
The standard commands to compile a piece of software for stages 3, 4, and 5 are as follows, issued from within the local directory containing the source code.
 
 
 
CONFIGURE:  $ ./configure --[options-list]
 
 
 
COMPILE:  $ make
 
 
 
INSTALL:  $ sudo make install
 
 
 
 
 
== DEPENDENCIES ==
 
 
 
This page is intended to serve as a reference list of all dependencies required to compile a given version of Audacity on Linux. This is probably of more help with the 1.3 Beta series as the 1.2 series is widely available in repos. The short page on compiling at audacity.sourceforge.net lists only three dependencies, which is not even really the bare minimum; I've found that there are at least 10 packages needed, and over 20 if all the configure options are desired. This wiki would be best served if others would update this list and start a new lists for any other distributions with different requirements. It would also be nice, as an aid to tracking down dependencies, to list which repository each program can be found in, if available.
 
 
 
== CONFIGURATION ==
 
 
 
Next would be some suggestions for a configure command. It is tiresome to go through the '''./configure --help''' listing as most of it is unintelligible to the average user and TMI. A nicer way to help people would be to give a sample configure command with some of the more essential options to get a maximally functional Audacity.
 
 
 
 
 
== ''Audacity 1.3.4 - Ubuntu 7.10 Gutsy Gibbon'' ==
 
 
   
 
   
 
Dependencies:
 
Dependencies:
 
+
<pre>
 
gettext  
 
gettext  
 
libasound2-dev  
 
libasound2-dev  
Line 194: Line 177:
 
wx2.6-headers  
 
wx2.6-headers  
 
zlib1g-dev  
 
zlib1g-dev  
 +
</pre>
 +
  
 
A suggested apt-get command to install the above dependencies:
 
A suggested apt-get command to install the above dependencies:
  
$ sudo apt-get install gettext libasound2-dev libflac-dev libflac++-dev libgtk2.0-dev libgtk-dev libid3tag0-dev libjack0.100.0-dev libmad0-dev libogg-dev libtwolame0 libtwolame-dev libvorbis-dev libwxbase2.6-dev libwxgtk-dev libwxgtk2.6-dev twolame portaudio19-dev wx2.6-headers zlib1g-dev  
+
{{code|$ sudo apt-get install gettext libasound2-dev libflac-dev libflac++-dev libgtk2.0-dev libgtk-dev libid3tag0-dev libjack0.100.0-dev libmad0-dev libogg-dev libtwolame0 libtwolame-dev libvorbis-dev libwxbase2.6-dev libwxgtk-dev libwxgtk2.6-dev twolame portaudio19-dev wx2.6-headers zlib1g-dev}}
  
  
 
A suggested ./configure command for full functionality:
 
A suggested ./configure command for full functionality:
  
$  ./configure --with-libvorbis --with-libflac --with-libid3tag --with-soundtouch
+
{{code|$  ./configure --with-libvorbis --with-libflac --with-libid3tag --with-soundtouch}}
  
 
[[Category:Linux and Unix Platform]] [[Category:For Developers]]
 
[[Category:Linux and Unix Platform]] [[Category:For Developers]]

Revision as of 21:03, 2 February 2008

Users on Linux and Unix systems often compile Audacity from source code to experiment with the latest Beta version, or even the latest code in CVS . Linux users may also need to compile either Audacity stable or Beta if there is no suitable Audacity package for their distribution. This page is a checklist of what you need to compile Audacity on Linux/Unix and the configure commands required.
If you need help with the basic steps in compiling Audacity, please see Compiling Audacity Step by Step Guide.
 
Related article(s):
  • Also for building with Windows, see [install-directory]\win\compile.txt
  • Developing On Mac

Overview

Compiling Audacity, or any GNU/Linux program for that matter, is basically a five stage process.

  1. Install dependencies: other software necessary to run or compile.
  2. Download the source code into a local directory.
  3. Configure the compile with options, if any.
  4. Compile
  5. Install

The first stage is crucial: it is a lack of necessary dependencies that ruins 99% of failed compiles. This page should help with that.

The standard commands to compile a piece of software for stages 3, 4 and 5 are as follows, issued from within the local directory containing the source code.

  1. CONFIGURE: $ ./configure --[options-list]
  2. COMPILE: $ make
  3. INSTALL: $ sudo make install


Obtaining Audacity

  • 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 . For a CVS interface on Mac to access our CVS repository, try MacCVS  (this needs an external SSH client if you want to commit code to our repository) or MacCVSClient . On Linux, BSD and other open source operating systems, command-line CVS clients are typically included in the default installation, or are available directly from the operating system repository.


Prerequisites

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 distributions 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:

./configure --disable-unicode

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.

Optional Packages

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:


id3tag use libid3tag  for MP3 ID3 tag support
LADSPA  compile with LADSPA plug-in support [default=yes]
libflac  [local], [system], [none] - enable FLAC support [default=none]
libmad  use libmad for mp3 decoding support
libresample use libresample: [yes], [no]
libsamplerate  alternatively, use libsamplerate (instead of libresample): [local], [system], [none]
libsndfile  choose which libsndfile to use: [local], [system]
PortAudio  which version of PortAudio to use (=[v18,v19]) [stable default=v18], [Beta default=v19]    
PortMixer compile with PortMixer [default=yes]
Nyquist  compile with Nyquist support [default=yes]
SoundTouch  compile with SoundTouch [default=yes]
vorbis  enable ogg vorbis support
 
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).

Examples:

To enable support for ogg files:

--with-vorbis=[local|system]


To use an external sndfile library (which you have previously built and installed):

--with-libsndfile=system


To disable Nyquist:

--without-nyquist


Compiling on Unix

To compile Audacity on Linux (or for that matter, Mac OS X and most other Unix systems), use the standard "configure; make" sequence:

./configure
make


However, you may want to start by running ./configure --help first to see the options, and possibly add special options.

If you are compiling from a CVS checkout, then you can re-generate the configure script by running

autoreconf


in the top level directory first. 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.x 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


Example dependencies: Audacity 1.3.4/Ubuntu 7.10

Dependencies:

gettext 
libasound2-dev 
libflac-dev 
libflac++-dev 
libgtk2.0-dev
libgtk-dev 
libid3tag0-dev 
libjack0.100.0-dev 
libmad0-dev 
libogg-dev 
libtwolame0 
libtwolame-dev 
libvorbis-dev 
libwxbase2.6-dev 
libwxgtk-dev 
libwxgtk2.6-dev 
twolame 
portaudio19-dev 
wx2.6-headers 
zlib1g-dev 


A suggested apt-get command to install the above dependencies:

$ sudo apt-get install gettext libasound2-dev libflac-dev libflac++-dev libgtk2.0-dev libgtk-dev libid3tag0-dev libjack0.100.0-dev libmad0-dev libogg-dev libtwolame0 libtwolame-dev libvorbis-dev libwxbase2.6-dev libwxgtk-dev libwxgtk2.6-dev twolame portaudio19-dev wx2.6-headers zlib1g-dev


A suggested ./configure command for full functionality:

$ ./configure --with-libvorbis --with-libflac --with-libid3tag --with-soundtouch