Building Csound

Csound has become a complex project and can involve many dependencies. Unless you are a Csound developer or need to develop Csound plugins, you should try to use one of the precompiled distributions from http://www.sourceforge.net/projects/csound. However, building from source is probably the best option on GNU/Linux.

This section focuses on the main Csound 5 build system, which uses SCons, a Python program that replaces make for cross-platform configuration and building.

When building Csound from source instead of using a precompiled package, you first need to obtain the sources for a release of Csound at http://www.sourceforge.net/projects/csound. The source packages have either a zip or tar.gz extension.

The latest (possibly unstable) Csound source code is also available through GIT. The Csound GIT front page is located at: http://csound.git.sourceforge.net/git/gitweb-index.cgi. Using git for just checking out and compiling is pretty easy. Install GIT for your platform and use this command to clone the Csound5 git repository:

git clone git://git.code.sf.net/p/csound/csound5-git 

This will checkout a read-only (meaning, you can not commit back to the central git repository) version of the Csound5 repo. To update with the latest from the master repo, use:

git pull

The same process is used for the Csound manual. Use this command to clone:

git clone git://git.code.sf.net/p/csound/manual-git 

Basic requirements to build Csound 5 on any platform

These are the minimum requirements for a build, but csound has many optional components which enhance functionality and add opcodes which may require additional libraries.

Optional configurations (ALL platforms)

In most cases it is best to install the most recent stable versions of the optional libraries.

Windows

The following is needed to build on Windows (more complete build instructions for Windows may be found in the csound-build.tex document (csound-build.pdf)):

Optional configurations for Windows include the following:

Linux

Optional configurations for Linux include the following:

Mac OS X

Optional configurations for Mac OS X include the following:

Building Csound 5 with SCons

When you have all the necessary packages and their sources (or -dev packages) to support your particular requirements on your hardware platform, execute "scons -h" to discover the current configuration options.

Building is made considerably easier if, when installing, the downloaded headers and libraries are installed in their default locations. To modify the default build, in particular to handle non-standard options for third-party dependencies, such as where headers and libraries are to be found:

Avoid modifying the SConstruct file.

Execute scons with the optional custom variables you desire. For example:

scons buildOSC=1 buildCsound5GUI=1 buildPythonOpcodes=1 useOSC=1 builBeats=1
[Note] Note

It is important that you set the environment variable OPCODEDIR to the directory where plugin libraries are installed; in the case of a double precision build, OPCODEDIR64 should be set instead. Installers usually take care of this, but it is necessary when building from source so Csound can find its plugin libraries.

Current build options

Table 4. Current SCons Build Options

Custom Variable Effect if set to 1
includeP5Glove Build for use with P5 Glove.
buildCsoundVST Build CsoundVST. Needs CsoundAC, FLTK, boost, Python, SWIG.
buildCsoundAC Build CsoundAC. Needs FLTK, boost, Python, SWIG.
buildCsound5GUI Build FLTK GUI frontend. Requires FLTK 1.1.7 or later.
buildCSEditor Build the Csound syntax highlighting text editor. Requires FLTK headers and libs.
buildDSSI Build DSSI/LADSPA host opcodes.
buildImageOpcodes Build image opcodes. 1 by default. Set to 0 to avoid.
buildInterfaces Build interface library for Python, JAVA, Lua, C++, and other languages.
buildJavaWrapper Build Java wrapper for the interface library.
buildLuaOpcodes Build Lua opcodes. Set to 1 to build.
buildLuaWrapper Build Lua wrapper for the C++ interface library (needs buildInterfaces).
buildNewParser Enable building new parser. Requires Flex/Bison.
buildOSXGUI Build the basic GUI frontend. OSX only.
buildPDClass Build csoundapi~ PD class. Needs m_pd.h in the standard places.
buildPythonOpcodes Build Python opcodes
buildPythonWrapper Build Python wrapper for the C++ interface library (needs buildInterfaces).
buildRelease Build for release. Implies noDebug.
buildSDFT Build SDFT code. 1 by default. Set to 0 to avoid.
buildStkOpcodes build Stk Opcodes. Requires STK source code.
buildTclcsound Build Tclcsound frontend (cstclsh, cswish and tclcsound dynamic module). Requires Tcl/Tk headers and libs.
buildUtilities Build stand-alone executables for utilities that can also be used with -U.
buildVirtual Build Virtual MIDI keyboard. Requires FLTK 1.1.7 or later headers and libs.
buildvst4cs Build vst4cs plugins. Requires Steinberg VST headers.
buildWinsound Build Winsound frontend. Requires FLTK headers and libs.
buildBeats Build csbeats score processor.
bufferoverflowu Set to 1 to use the Windows buffer overflow library, required if you use MinGW to link with MSVC-built libraries.
dynamicCsoundLibrary Build dynamic Csound library instead of libcsound.a.
gcc3opt Enable gcc 3.3.x or later optimizations for the specified CPU architecture (e.g. pentium3); implies noDebug.
gcc4opt Enable gcc 4.0 or later optimizations for the specified CPU architecture (e.g. pentium3); implies noDebug.
generateTags Generate TAGS.
generatePdf Generate PDF documentation.
install Enables the Install targets.
Lib64 Build for lib64 rather than lib.
noDebug Build without debugging information.
noFLTKThreads Disable use of a separate thread for FLTK widgets.
useAltivec On OSX use the gcc AltiVec optmisation flags.
useALSA ALSA for real-time audio and MIDI input and output.
useCoreAudio use CoreAudio for real-time audio input and output.
useDouble Use double-precision floating point for audio samples.
useFLTK Use FLTK for graphs and widget opcodes.
useGettext Use the GNU internationalisation/localisation scheme
useIpMIDI Build for use as a network synth.
useGprof Build with profiling information (-pg).
usePortAudio Use PortAudio for real-time audio input and output.
usePortMIDI Build PortMidi plugin for real time MIDI input and output.
useJack Used if you compiled PortAudio to use Jack; also builds Jack plugin.
useLrint Use lrint() and lrintf() for converting floating point values to integers.
useOSC For OSC support.
useUDP For UDP support. 1 by default. Set to 0 to avoid.
withICL Build with the Intel C++ Compiler (also requires Microsoft Visual C++), Set to 0 to build with MinGW. Windows only.
withMSVC Build with Microsoft Visual C++, or set to 0 to build with MinGW. Windows only.
withSunStudio On Solaris, set to 1 to build with Sun Studio, or set to 0 to build with gcc.
NewParserDebug Enable tracing of new parser
Word64 Build for 64bit computer.
pythonVersion Set to the Python version to be used.
includeSerial Set to 1 if compiling serial code.
buildcatalog Set to 1 if building opcode/library catalogue.
includeWii Set to 12 or 13 if using libwiiuse v0.12 or v0.13.
useOpenMP Set to 1 to use OpenMP for parallel performance.
buildMultiCore building for multicore sytem (requires new parser).