Skip to main content

Core requirements

The following requirements apply to all platforms:

CMake

Csound uses the CMake build system. Download and install from cmake.org.

C compiler toolchain

Csound is mostly written in the C language and requires a complete installation of C development tools:
  • macOS: Xcode Command Line Tools or full Xcode
  • Linux: GCC or Clang (typically via build-essential package)
  • Windows: Visual Studio 2022 or MinGW-w64

Flex and Bison

The Csound parser requires Bison and Flex to be installed. Recent versions are recommended:
  • Bison 3.8 or later
  • Flex 2.6 or later
macOS includes older versions of Bison and Flex. You’ll need to install newer versions via Homebrew or build from source.

Optional components

Git

A distributed version control system to clone and acquire the Csound sources. While you can download the source as a zip from GitHub, having Git installed makes it easier to interact with the Csound source and sync with the latest changes.

C++ compiler toolchain

A few components are written in C++. For these to be built, a complete installation of C++ development tools is necessary. Most modern systems include C++ compilers alongside C compilers.

Libsndfile

For soundfile I/O, Csound uses libsndfile. For this functionality to be present, this library needs to be installed in the system.
This requirement can be disabled in the CMake build with the USE_LIBSNDFILE=0 option.

Libsamplerate

Libsamplerate (Secret Rabbit Code) is used for high-quality sample rate conversion. When disabled, Csound will use linear interpolation for sample rate conversion.

Platform-specific dependencies

macOS

brew install bison flex
brew install libsndfile portaudio libsamplerate liblo portmidi
brew install jack googletest  # Optional

Linux (Ubuntu/Debian)

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 liblo-dev ladspa-sdk libpng-dev dssi-dev bison flex \
  libportsmf-dev libeigen3-dev libcunit1-dev gettext libsamplerate0-dev \
  libpipewire-0.3-dev

Windows

choco install -y cmake winflexbison3 innosetup git

Useful CMake options

The following options may be useful to configure the build according to the local platform conditions.

CMAKE_INSTALL_PREFIX

This allows the installation to be placed in a custom location (defaults to /usr/local). The option takes the top-level installation directory.
cmake -B build -DCMAKE_INSTALL_PREFIX=/custom/path

USE_LIBSNDFILE

In systems where libsndfile is not present, this option can disable this requirement for the build.
cmake -B build -DUSE_LIBSNDFILE=0

USE_LIBSAMPLERATE

Controls whether libsamplerate (Secret Rabbit Code) is used for high-quality sample rate conversion. When disabled, Csound will use linear interpolation for sample rate conversion. Default is ON.
cmake -B build -DUSE_LIBSAMPLERATE=0

BUILD_PLUGINS

Build all external opcodes as plugin libraries. This option is disabled by default.
cmake -B build -DBUILD_PLUGINS=1

DCUSTOM_CMAKE

With this option you can specify a custom.cmake file containing build options and CMake variables to control the build.
cmake -B build -DCUSTOM_CMAKE=./platform/osx/custom-osx.cmake

Listing all CMake options

A full list of CMake build options can be found by running the following command from the CMake build directory:
cmake -LAH

CI build reference

Steps for building Csound across a large range of target platforms can be found in the csound_builds.yml script, which is part of Csound’s CI build system.