Skip to main content

Prerequisites

Before building Csound on Linux, ensure you have:
  • CMake
  • GCC or Clang compiler toolchain
  • Bison and Flex
See Build requirements for complete details.

Method 1: Ubuntu/Debian with apt-get

This is the recommended approach for Ubuntu and Debian-based distributions.
1

Install dependencies

sudo apt-get update
sudo apt-get install cmake libsndfile1-dev libasound2-dev libjack-dev \
  portaudio19-dev libportmidi-dev libpulse-dev swig liblua5.1-0-dev \
  default-jdk libfltk1.1-dev libfluidsynth-dev liblo-dev fluid \
  ladspa-sdk libpng-dev dssi-dev libstk0-dev libgmm++-dev bison flex \
  libportsmf-dev libeigen3-dev libcunit1-dev gettext libsamplerate0-dev \
  libpipewire-0.3-dev
2

Clone the repository

git clone https://github.com/csound/csound.git
cd csound
3

Create build directory

mkdir build
cd build
4

Configure the build

cmake ..
Or with custom options:
cmake .. -DUSE_MP3=0 -DUSE_DOUBLE=0 -DBUILD_TESTS=1 -DBUILD_STATIC_LIBRARY=1
5

Build Csound

make
For faster builds using multiple cores:
make -j$(nproc)
6

Run tests (optional)

make test
make csdtests
7

Install

Install the software (requires super-user access):
sudo make install
The default installation location is /usr/local.

Method 2: Using vcpkg for dependencies

Use vcpkg to manage dependencies automatically:
1

Clone repository with submodules

git clone --recurse-submodules https://github.com/csound/csound.git
cd csound
2

Bootstrap vcpkg

./vcpkg/bootstrap-vcpkg.sh
3

Install system dependencies

Some dependencies still need to be installed from the system:
sudo apt-get update
sudo apt-get install cmake libjack-dev libpulse-dev ladspa-sdk \
  dssi-dev autoconf libtool
4

Configure build

cmake -B build -S . -DBUILD_TESTS=1 -DUSE_VCPKG=1 \
  -DCUSTOM_CMAKE="./platform/linux/custom.cmake" -DBUILD_PLUGINS=1
5

Build Csound

cmake --build build --config Release
6

Run tests (optional)

cmake --build build --target test csdtests
7

Install

sudo cmake --build build --target install

Other distributions

For other Linux distributions, adapt the package installation commands to your package manager:
sudo dnf install cmake libsndfile-devel alsa-lib-devel jack-audio-connection-kit-devel \
  portaudio-devel portmidi-devel pulseaudio-libs-devel swig lua-devel \
  java-devel fltk-devel fluidsynth-devel liblo-devel ladspa-devel \
  libpng-devel dssi-devel bison flex libsamplerate-devel gettext-devel
Then follow the same build steps as for Ubuntu.

Customizing the build

You can customize the build by:
  • Using CMake options (see Build requirements)
  • Creating a custom CMake file: cmake -DCUSTOM_CMAKE=./platform/linux/custom.cmake
  • Setting CMAKE_INSTALL_PREFIX to install in a custom location

Common build configurations

Minimal build

Build with minimal dependencies:
cmake -B build -DUSE_LIBSNDFILE=0 -DBUILD_PLUGINS=0
cmake --build build

Build with all plugins

Build all external opcodes as plugin libraries:
cmake -B build -DBUILD_PLUGINS=1
cmake --build build

Debug build

Build with debug symbols:
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build

Static library build

Build Csound as a static library:
cmake -B build -DBUILD_STATIC_LIBRARY=1
cmake --build build

Troubleshooting

Missing dependencies

If you get errors about missing headers or libraries, ensure all development packages are installed. Look for packages ending in -dev (Debian/Ubuntu) or -devel (Fedora/RHEL).

JACK not found

If JACK support is not detected:
# Ubuntu/Debian
sudo apt-get install libjack-dev

# Fedora/RHEL
sudo dnf install jack-audio-connection-kit-devel

PipeWire support

For PipeWire support (on newer systems):
sudo apt-get install libpipewire-0.3-dev

Bison or Flex version too old

Csound requires recent versions of Bison (3.8+) and Flex (2.6+). If your distribution provides older versions, you may need to build them from source:
# Build Bison from source
wget https://ftp.gnu.org/gnu/bison/bison-3.8.tar.gz
tar xzf bison-3.8.tar.gz
cd bison-3.8
./configure --prefix=$HOME/.local
make && make install
export PATH="$HOME/.local/bin:$PATH"

Permission denied during install

If you don’t have sudo access, install to a custom location:
cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/.local
cmake --build build
cmake --build build --target install
Then add to your shell profile:
export PATH="$HOME/.local/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH"