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 6 build system, which uses cmake, a cross-platform, open-source build system designed to build, test and package software.

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 Csound6 git repository:

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

This will checkout a read-only (meaning, you can not commit back to the central git repository) version of the Csound6 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/manual6-git csound-manual6-git

Basic requirements to build Csound 6 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 How_to_Build_Csound_on_Windows.doc):

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 6 with CMake

When you have all the necessary packages and their sources (or -dev packages) to support your particular requirements on your hardware platform it is best to review the file

Custom.cmake.ex

to discover the current configuration options. make any changes and place your customisations in

Custom.cmake

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 CMakeList.txt files.

With CMake it is usual to build in a difference directory to the sources. Create a directory for your build, change to that directory and run

cmake
    path-to-source-directory

. All being well this will create Makefiles as necessary. You can then run "make" and "make install". If things go wrong it is sometime necessary to delete the file

CMakeCache.txt

.

[Note] Note

It is important that you set the environment variable OPCODE6DIR to the directory where plugin libraries are installed; in the case of a double precision build, OPCODE6DIR64 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.