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
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.
In most cases it is best to install the most recent stable versions of the optional libraries.
--enable-shared --enable-threads
.
csound6/Opcodes/stk
.
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
):
Install a compiler like gcc or Microsoft Visual Studio. If using MinGW
(gcc), download the MinGW-build installer for 32-bit architecture, Posix threads, dwarf2 exception handling from http://sourceforge.net/projects/mingwbuilds/files/latest/download?source=files
and run it. Install to a directory such as D:/mingw32-4.8.1
.
In addition to the compiler, building Csound and its dependencies
requires some other tools. Install MSys from
http://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/msys%2B7za%2Bwget%2Bsvn%2Bgit%2Bmercurial%2Bcvs-rev13.7z/download.
This includes bison, flex, autotools and some other goodies. Edit the MSys etc/fstab
file to map the MinGW directory to /mingw
.
Options for the MinGW C compiler should be -g -O2 -fopenmp -march=nocona -mstackrealign -DNDEBUG -I/usr/local/include
.
Options for the MinGW C++ compiler should be -g -O2 -std=gnu++11 -fopenmp -march=nocona -mstackrealign -DNDEBUG -I/usr/local/include
.
Optional configurations for Windows include the following:
Optional configurations for Linux include the following:
Optional configurations for Mac OS X include the following:
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 |
---|---|
It is important that you set the environment variable
|