Building Audacity 2.3.0 on Ubuntu 16.0.4

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Locked
steve
Site Admin
Posts: 49053
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Building Audacity 2.3.0 on Ubuntu 16.0.4

Post by steve » Tue Sep 25, 2018 11:33 pm

IMPORTANT:
THERE IS A BUG IN AUDACITY 2.3.0 THAT CAUSES AUDACITY TO CRASH WHEN EFFECTS WITH REAL-TIME PREVIEW ARE APPLIED. AUDACITY 2.3.0 IS THEREFORE NOT RECOMMENDED FOR LINUX.


The official build instructions for Linux may be found here: https://github.com/audacity/audacity/bl ... /build.txt
Note: At time of writing there is at least one error in the official instructions, which is the omission of 'libasound2-dev'.

This walkthrough is a minimal step-by-step guide to building Audacity 2.3.0 on Ubuntu 16.04 LTS (Xenial Xerus).
Building on related distributions such as Mint 18.3 should be very similar.

The exact version of Ubuntu used here is:
Ubuntu 16.04-5 64-bit (including 3rd-party drivers, Flash, MP3 and other media)

Items written as code

Code: Select all

  $ like this
are commands to be typed into a terminal window. Comments in brackets should NOT be typed into the terminal window (don't blindly copy and paste).


Prerequisites:
  • User must be a member of 'sudo' group (default on Ubuntu)
  • 'Source code' section of Ubuntu repositories must be enabled in sources list.
Required:

Code: Select all

  $ sudo apt-get install build-essential cmake gcc-5 autoconf
  $ sudo apt-get install libasound2-dev libgtk2.0-dev
  $ sudo apt-get install git
Recommended:
If not already installed:

For MP3 export:
libmp3lame0

For FFmpeg supported file types:
libavformat-ffmpeg56
libavformat-dev


Optional:

For Jack Audio System:
jackd2 (on a single user system, you will probably want to enable real-time priority)
libjack-jackd2-0
libjack-jackd2-dev



Building WxWidgets:

Code: Select all

  $ cd ~/
  $ git clone --recurse-submodules https://github.com/audacity/wxWidgets/ wx311
  $ cd wx311
  $ mkdir buildgtk
  $ cd buildgtk
IMPORTANT - Ensure that the 'configure' and 'make' complete without errors (don't worry about warnings). Note that the build will take several minutes to complete.

Code: Select all

  $ ../configure --with-gtk
  $ make j4  (the 'j' number = to number of processor cores)
  
IMPORTANT - Do not install WxWidgets. This is not the correct version for Ubuntu 16.0.4.


TEST:

Code: Select all

  $ cd samples/calendar
  $ make
  $ ./calendar
If successful, a calendar window should appear.
In the event of problems, refer to:
https://github.com/audacity/wxWidgets/b ... nstall.txt



Building Audacity 2.3.0

Download the Audacity source code.
At time of writing, 2.3.0 rc2 is available from:
https://www.fosshub.com/Audacity-devel. ... rc2.tar.xz
When officially released it will be available via the main Audacity website:
https://www.audacityteam.org/download/source/

Extract the contents of the ZIP file. In this example we will extract to the home directory. In a terminal window, navigate into the extracted audacity directory.

Code: Select all

  $ cd ~/audacity-minsrc-2.3.0
  $ mkdir build
  $ cd build
Note-1: <username> is your user name.
Note-2: If you did not install 'libavformat-dev', omit --with-ffmpeg="system".

Code: Select all

  $ ../configure  WX_CONFIG=/home/<username>/wx311/buildgtk/wx-config --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading
  $ make -j4 (the 'j' number = to number of processor cores)
TEST:

Code: Select all

  $ ./audacity
INSTALL:

Code: Select all

  $ sudo make install
Note: Log out and back in again is usually required for Audacity to appear in the applications menu.

--- End ---

For queries about building Audacity 2.3.0, please start a new thread.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Locked