Building Csound
Prev | Part I. Csound 5 User's Guide | Next

## 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://sourceforge.net/projects/csound`.

The latest Csound source code is available through the Concurrent Versions System (CVS)(http://www.cvshome.org). To download Csound sources using CVS, run the following commands:

          cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/csound login

          cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/csound co csound5

Information about accessing the CVS repository may be found in the SourceForge document Basic Introduction to CVS and SourceForge.net (SF.net) Project CVS Services.

If you wish to become a Csound developer, first obtain a SourceForge login, and then apply to John ffitch at the http://www.sourceforge.net/projects/csound site.

The procedure for building Csound 5 is briefly and incompletely outlined here.

The manual is built using make. Scripts are used for a few other tasks. However, this section focuses on the main Csound build system, which uses SCons, a Python program that replaces make for cross-platform configuration and building.

(Alternatively, for building a minimal version of Csound 5 (API library compiled as DLL, plugin libraries, and command line frontend) on Windows with MinGW/MSYS, you may alternatively edit and use `Makefile-win32`, eliminating the dependencies on Python and SCons.)

All Csound 5 SCons builds require the following:

- On Linux, install gcc; on Windows, install all of MinGW 3.4.2 (3.4.4 does not work) from `http://www.mingw.org` then MSYS then update it including the DTK toolkit, autoconf, automake, and libtool, in that order, or install MSVC; on OS X, install the latest XCode development system.
- Install Python from `http://www.python.org`. Note that on Windows, if you have installed both MinGW and MSVC, it is best to use batch files to set up a separate environment for each compiler that does not refer to any header, library, DLL, or executable of the other compiler. On Windows, with Python 2.4 and later, Csound will link directly with the Python DLL. Earlier versions of the Python DLL will require a MinGW import library that the Csound build system should create.
- Install the Software Interface and Wrapper Generator (SWIG) for generating Python and Java interfaces, from http://www.swig.org.
- Install SCons from `http://www.scons.org`. On Windows, the MSys shell does not allow the user to execute the scons script directly. Therefore, you need to make sure that Python is in your Windows executable path, and run the build like this: `$$ python c:/tools/python23/scripts/scons` .
- Install libdsndfile version 1.0.13 or later from `http://www.mega-nerd.com/libsndfile`.

Optional configurations can include the following. In most cases it is best to install the most recent stable versions.

- For GUI widgets, install FLTK 1.1 from `http://www.fltk.org`. You must configure and build FLTK with `--enable-shared --enable-threads`.
- Real-time audio can use ALSA, JACK, CoreAudio, the Windows multimedia library, or PortAudio (v19-devel branch) from `http://www.portaudio.com/usingcvs.html`.
- Real-time MIDI can use the ALSA raw MIDI interface, Windows multimedia library, or PortMidi from `http://www.cs.cmu.edu/~music/portmusic`.
- CsoundVST, which is both a standalone GUI, a Python extension module, and a VST plugin form of Csound with extensive facilities for algorithmic composition, requires FLTK and the boost C++ template libraries for random numbers and linear algebra, from http://www.boost.org. The CsoundVST `Random` class requires that boost must be later than version 1.32.1.
- The fluid opcodes require the Fluidsynth library from `http://savannah.nongnu.org/download/fluid`. For Windows, use the prebuilt binaries.
- The STK opcodes require STK source code from `http://ccrma.stanford.edu/software/stk`, copied into `csound5/Opcodes/stk`.
- The Loris opcodes require Loris source code from `http://sourceforge.net/projects/loris`, copied into `csound5/Opcodes/Loris`.
- The OSC opcodes require the latest version of the liblo library from `http://plugin.org.uk/liblo`. The library does not yet build properly on Windows.

Execute `scons -h` to discover the current configuration options.

Modify `custom.py` as required for your installation (usually required on Windows, may not be required on Linux).

Execute `scons` with the options you desire.

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. The NSIS installer performs this step.

To install on Linux, execute `./install.py` or `scons install`.

To create a Windows installer, build Csound for double precision samples and including the Loris, STK, py, vst4cs, and Fluidsynth opcodes, build the manual, install the NSIS installer from `http://nsis.sourceforge.net`, and run `csound5/installer/windows/csound.nsi`.

Prev | Up | Next
VST Plugin | Home | To Do