Difference between revisions of "Building On Linux"
(close block properly.)
|Line 497:||Line 497:|
* [[Building Release Tarballs]]
* [[Building Release Tarballs]]
If using CMake build (you should)
If using CMake build (you should )
If using Autotools buildchain
If using Autotools buildchain
Revision as of 14:32, 25 April 2020
- Instructions for building modules
- Instructions for FFmpeg too:
This is the configure command Steve uses for testing/developing: ../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading --with-mod-script-pipe --with-mod-nyq-bench --enable-debug For a "release build": ../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading
|These are instructions for building on Linux
The build family of pages:
- 1 Instructions in linux/build.txt
- 2 Variations
- 3 Official Full Releases
Instructions in linux/build.txt
|We currently have two different sets of instructions for building on Linux. We plan to merge these instructions in time, and then have variations for where they diverge. 2.4.0 was tested with James' instructions with the CMake variation.
Simple step-by-step instructions for building on Ubuntu are periodically posted to the Audacity forum.
In addition to the listed dependencies and standard build environment, Audacity also requires Python 2 to be installed for building LV2 support.
On Debian / Ubuntu, systems, if Python 2 is not already installed, it may be installed with:
sudo apt-get install python-minimal
Instructions (Used by James on bionic)
Instructions for Building on Linux Fuller instructions that cover: * Upgrading to gcc 4.9 on older Ubuntus * Optional libraries can be found on our wiki at http://wiki.audacityteam.org/wiki/Building_On_Linux. Some prerequisites: - Audacity requires gcc 4.9 or later to build. - CMake ( http://www.cmake.org/ ) is required to build the local copy of the libsoxr resampling library used by Audacity. On a modern Debian distro, e.g. Ubuntu 16.04 (bionic), you would do: sudo apt-get install build-essential cmake - libasound and gtk are required. Having gtk2 and gtk3 too may not be required, but compilation works if both are. - Auto-tools are also needed. sudo apt-get install libasound libgtk2.0-dev libgtk-3-dev sudo apt-get install autoconf automake - Since you will be fetching code from git repositories you will need git. sudo apt-get install git git-gui gitk wxWidgets: 1) Clone wxWidgets and checkout 3.1.1 from the Audacity fork of the wxWidgets project: https://github.com/audacity/wxWidgets/.... for example mkdir ./wxWidgets cd ./wxWidgets git clone --recurse-submodules https://github.com/audacity/wxWidgets/ Don't be tempted to use Widgets already installed on Linux because this will typically be a different version and will cause problems. IF you forgot the --recurse-submodules, you can correct that later by: git submodule update --init 2) Follow instructions for building at https://github.com/audacity/wxWidgets/blob/v3.1.1/docs/gtk/install.txt So... mkdir buildgtk cd buildgtk ../configure --with-gtk make 3) Having got this far, it is well worth trying out building some wxWidgets examples to confirm that building has worked OK Audacity: These are old steps for using automake. For 2.4.0 onwards we are using CMake instead. See later instructions. 1) Create a 'build' subdirectory under Audacity and change to it. 2) Now to build Audacity itself. Using a build directory (and .. in the command) keeps source and object files in separate directories. ../configure --with-lib-preference="local system" make make install # as root
From Audacity 2.4.0 we started building Audacity itself using CMake
Instructions for Installing recent CMake on Ubuntu. You'll need CMake 3.15 or higher. These steps were tested with CMake 3.17.1. 1. Check whether you need to upgrade. cmake --version 2. Download the cmake install script from kitware https://cmake.org/download/ Get the binary version for linux, the bash script cmake-3.<something>.sh 3. Move it to the directory where you want to install CMake, possibly /usr/local/bin (you could install it anywhere and then symlink to it) I used /usr/local/bin so that I would not need to blow away the older copy in /usr/bin if it hadn't worked out. 4. Run the script sudo chmod +x cmake-3.<something>.sh sudo bash cmake-3.<something>.sh You will answer n (no for an extra subdirectory) and then y. 5. Check that worked cmake --version
Then build Audacity
Instructions for Building Audacity using CMake 1. Make a build directory under the audacity git directory. cd audacity mkdir build-cmake cd build-cmake 2. Generate the makefiles cmake -G "Unix Makefiles" .. 3. Build Audacity cmake --build . --config Release 4. Run cd /bin/Release ./audacity
About Box Details The about box should show a git build identifier, if the source was under git version control. There will be no such identifier if you built from the tarball. Distros which ship a modified Audacity are encouraged to use git and so to show their own git identifier. If the about box shows 'debug build' and you actually built a release build, this may be because you used wxWidgets with DEBUG_LEVEL of 1 or higher. With Audacity 2.4.0 there is an issue on Linux with the Release build reporting itself as Debug. We expect to fix this for the next release.
Steve Daulton. Updated 04Dec2019
Instructions for Building on Linux Note that for Audacity 2.3.3, "Mod Script Pipe" should be considered to be a standard part of an Audacity release, rather than as an optional extra. FFmpeg support should also be enabled if available in the distribution. Note that only the current release version of the manual is available on-line. It is therefore highly recommended to fetch the correct version of the manual and install it on the local machine to ensure that the correct version of the manual is available for the end user. See notes below for details. Prerequisites: 1) Repository sources (sources.list) must include source code sources. 2) For MP3 / FFmpeg support, "non-free" repositories may need to be enabled. 3) Root access is required for installation (usually via "sudo"). Required dependencies: (The package names below are those used by Debian based distributions.) For Debian / Ubuntu based distributions, these packages may be installed from the command line with: $ sudo apt install <package-name> build-essential (g++, gcc, libc6-dev, libc-dev, make) cmake gcc 4.9 or later (gcc-7 recommended for Debian / Ubuntu) libsndfile1 libasound2-dev libgtk2.0-dev gettext libid3tag0-dev libmad0-dev libsoundtouch-dev libogg-dev libvorbis-dev libflac-dev libmp3lame0 WxWidgets 3.0 or 3.1 (see note below) For FFmpeg support (see note below): libavformat-dev For Jack Audio System (see note below): jackd2 libjack-jackd2-dev Recommended for developers: git autoconf automake pkg-config patch diff-tools gdb WxWidgets: Audacity requires wxWidgets 3.0 or 3.1. Wxwidgets 3.1.1 source code is available from: https://github.com/audacity/wxWidgets For Debian / Ubuntu based distributions, the required wxWidgets packages may all be pulled in with apt at the command line: $ sudo apt install libwxgtk3.0 FFmpeg: The FFmpeg headers included in the Audacity source are rather old. Audacity may be built with a more recent version if libavformat-dev is installed on the system (recommended), but dynamic loading must be disabled (see configuration options below). Jack Audio System: Audacity can work with either jackd or jackd2. Unless your Linux distribution runs Jack as the default sound system, it is recommended to install QJackCtl to provide a convenient way to manage Jack. End users are advised to read up on Jack if they wish to install it. Getting the Audacity source code: The latest release version of Audacity is available from: https://www.fosshub.com/Audacity.html This is the recommended version for end users. For developers, the current development code is available from Github. Cloning the repository is recommended so that the source tree may easily be kept up to date. https://github.com/audacity/audacity Building Audacity: After cloning or extracting the downloaded source code, open a terminal window and navigate to the root of the source folder (the folder that contains the 'README.md' file). Create a build folder and navigate into it $ mkdir build $ cd build Configure the build: For a comprehensive list of configure options, run $ ../configure -h To configure with all standard release features enabled: $ ../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading --with-mod-script-pipe Note that additional steps are required for building and installing Mod Script Pipe (see below). Enabling FFmpeg (included in the "standard" options above): Most Linux distributions provide a newer version of FFmpeg than is supported by Audacity's dynamic loading. For FFmpeg support it is therefore necessary to disable dynamic loading: $ ../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading Assuming that configure completes without error, you can now build Audacity: $ make If your processor has multiple cores, you may use the -j switch, set to the number of available cores. This will considerably speed up the build time. For example, with an 8 core CPU: $ make -j8 Building Mod Script Pipe: Mod Script Pipe provides an API for external scripting languages such as Python, to communicate with Audacity. Mod Script Pipe may be used with any scripting language that supports named pipes. For more information, see: https://manual.audacityteam.org/man/scripting.html IMPORTANT: Modules for Audacity must be built on the same day as Audacity is built. Audacity must be built with the --with-mod-script-pipe option. After building Audacity, navigate to the build/lib-src/mod-script-pipe directory: $ cd lib-src/mod-script-pipe Then build Mod Script Pipe (the "-j" switch is available for multi-core CPUs): $ make Fetching the manual: The Audacity manual is html, and is identical for Windows, Mac and Linux. For release versions of Audacity, the manual may be downloaded as a ZIP archive from: Current version: https://www.fosshub.com/Audacity.html Old versions: https://www.fosshub.com/Audacity-old.html Pre-installation test: Create a local folder for Audacity's settings. This folder will be only used for testing and will not be installed. $ mkdir "Portable Settings" Then launch Audacity $ ./audacity Installing Audacity: To install the main application, from the build directory: $ sudo make install To install Mod Script Pipe: Assuming that Audacity has been installed to /usr/local/ (default) $ sudo mkdir /usr/local/share/audacity/modules $ sudo cp lib-src/mod-script-pipe/.libs/mod-script-pipe.so /usr/local/share/audacity/modules/mod-script-pipe.so $ sudo cp lib-src/mod-script-pipe/.libs/mod-script-pipe.so.0.0.0 /usr/local/share/audacity/modules/mod-script-pipe.so.0.0.0 The module will now be available for enabling in Preferences (https://manual.audacityteam.org/man/modules_preferences.html) Note that it is also possible to install Mod Script Pipe for a single user by copying these two files to: ~/.audacity-files/modules To install the manual: Assuming that Audacity has been installed to /usr/local/ (default). From the directory constaining the manual ZIP archive: $ sudo unzip audacity-manual-2.3.3.zip -d /usr/local/share/audacity/help
gcc 4.9 on Ubuntu 14.04
If you're on Ubuntu 14.04, you need to upgrade the gcc compiler to at least 4.9.
1) export CXX="g++-4.9" CC="gcc-4.9" 2) g++-4.9 --version
You also must tell gcc to use c++11, so adapt the earlier configure command as follows: ../configure --with-lib-preference="local system" CXXFLAGS="-std=c++11"
Changes to makefile.am
If you've added or removed source files, you will need to change makefile.am to reflect that.
autoreconf --no-recursive -i
To see compile-time options you can set, you can type ./configure --help For example you can enable and disable libraries. Audacity 2.3.0 is now built by default with local ffmpeg and local libFlac.
Cache for Configure
If you want to do any development, you might want to generate a configure cache and header dependencies: ./configure -C make dep
Audacity should be able to link dynamically to FFmpeg 1.2 to 2.3.x (libav 0.8 to 10), but many distributions have more recent versions that fail to link dynamically. To work around this issue, Audacity may be configured to use the system FFmpeg library and disable dynamic loading. $ ../configure --with-lib-preference="local system" --with-ffmpeg=system --disable-dynamic-loading If this is done for both FFmpeg and LAME, then the "Libraries" option in Audacity's Preferences is not required and is automatically removed. $ ../configure --with-lib-preference="local system" --with-ffmpeg=system --with-lame=system --disable-dynamic-loading
Other 'make' targets
These are some other make targets.
To uninstall: make uninstall #as root To clean the build after modifying code: make clean To clean and remove previous configure options: make distclean
Official Full Releases
Official full releases:
- Executables: Have a GitIdent, visible in the about box build information, that says what branch was used in building.
- Source-Code distros: Are minimal cut down versions from the release branch. We take out system libs that we expect to be provided by the distro, and that we haven't patched.
Updating .po files
With an official release, we ask translators to translate an updated .pot file. We create this with the following script:
cd locale bash update_po_files.sh
Note: The script has the Audacity version number in it in three places, and all three should be updated before running it.
- We recommend that maintainers of linux distros that ship pre built copies of Audacity build with a GitIdent that reflects the state of their version of the branch including their patches to it.
- We don't recommend having a Git ident when distributing in source code form, and we don't either in our
git show -s --format="#define REV_LONG \"%H\"%n#define REV_TIME \"%cd\"%n" | tee ../src/RevisionIdent.h or easier use ../mac/get_gitident.sh
The CMake build adds the gitident automatically and this step is only needed with the automake builds.
Making a Minimal Tarball
If using CMake build (you should use it!)
If using Autotools buildchain
Clean your copy. You check using -n and clean with -f. git clean -x -d -n git clean -x -d -f Now configure as if for building: ./configure --with-lib-preference="local system" Run the make tarball script: ./scripts/maketarball.sh verbose Check the tarball is good for building: cd ../audacity-minsrc-x.y.z ./configure --with-lib-preference="local system" make -j4