Overview
Csound uses CMake as its build system, supporting multiple platforms and configurations. The build system handles dependencies, platform-specific settings, and various build options.CMake versions
- Minimum version: 3.13.4
- macOS/Apple: 3.28 or higher required
- Recommended: Latest stable CMake version
Quick start
Basic build (Unix-like systems)
Basic build (Windows PowerShell)
CMake options
Core options
CMAKE_INSTALL_PREFIX
Sets the installation directory (default:/usr/local):
CMAKE_BUILD_TYPE
Sets build configuration:Release- Optimized build (default for release)Debug- Debug symbols, no optimizationRelWithDebInfo- Optimized with debug infoMinSizeRel- Size-optimized build
Csound-specific options
USE_DOUBLE
Build with double-precision floating point (default:ON):
ON: 64-bit audio samples (library namedcsound64orCsoundLib64)OFF: 32-bit audio samples (library namedcsoundorCsoundLib)
USE_LIBSNDFILE
Enable libsndfile for audio file I/O (default:ON):
USE_LIBSAMPLERATE
Enable libsamplerate for high-quality sample rate conversion (default:ON):
BUILD_PLUGINS
Build external opcodes as plugin libraries (default:OFF):
BUILD_STATIC_LIBRARY
Build a static version of the Csound library (default:OFF):
BUILD_TESTS
Enable building of test suites (default:OFF):
BUILD_MULTI_CORE
Enable multicore parallel processing support (default:ON):
USE_COMPILER_OPTIMIZATIONS
Use Csound’s default compiler optimization flags (default:ON):
USE_VCPKG
Use vcpkg for dependency management (default:OFF):
Custom configuration
CUSTOM_CMAKE
Specify a custom CMake configuration file:Advanced options
USE_GIT_COMMIT
Show git commit hash in version information (default:ON):
CSOUND_GIT_HASH
Override git hash for reproducible builds:CSOUND_BUILD_DATE
Override build date for reproducible builds:BUILD_WITH_LTO
Enable link-time optimizations (default:OFF):
USE_ASA
Use address sanitizer in Debug builds on macOS (default:ON):
Platform-specific builds
macOS
With dependencies installed
$HOME/Library/Frameworks.
Vanilla (no dependencies)
Using Homebrew
Linux (Ubuntu)
Windows (Visual Studio / vcpkg)
Prerequisites
Install Chocolatey packages:Clone and build
Build installer
iOS
Listing all options
To see all available CMake options:Build targets
Default target
Builds Csound library and executables:Install target
Installs Csound to the configured prefix:Test targets
Run unit tests:Clean target
Remove build artifacts:Troubleshooting
Bison/Flex not found
On macOS, ensure Homebrew versions are used:Dependency not found
Enable vcpkg for automatic dependency management:CMake cache issues
Delete the build directory and reconfigure:Parallel build failures
Reduce parallel jobs:Dependencies
Required
- C compiler: GCC, Clang, or MSVC
- Bison (3.8+): Parser generator
- Flex (2.6+): Lexical analyzer generator
Optional
- libsndfile: Audio file I/O (highly recommended)
- libsamplerate: High-quality sample rate conversion
- PortAudio: Cross-platform audio I/O
- PortMIDI: MIDI I/O
- JACK: Professional audio server
- PulseAudio: Linux audio server
- liblo: OSC (Open Sound Control) support
- FLTK: GUI widgets
- Lua: Lua opcodes
- Python: Python interface
- Java: Java interface
- GoogleTest: Unit testing framework
vcpkg integration
vcpkg provides automatic dependency management. WhenUSE_VCPKG=1 is set, CMake configures vcpkg triplets based on the target platform:
- Linux:
x64-linux - macOS:
x64-osxorarm64-osx(auto-detected) - Windows:
x64-windows-staticorx86-windows-static - Android:
arm-android,arm64-android,x86-android,x64-android - iOS:
arm64-ios,x64-ios - WebAssembly:
wasm32-emscripten - MinGW:
x64-mingw-staticorx86-mingw-static