The developer.sh will try to download and install the required dependencies, and compile score in a way suitable for development.
This page presents how to start developing things on ossia score.
We recommend heavily to use QtCreator as IDE to do so, or at least an IDE with native support for CMake.
Required dependencies and libraries, except CMake and Ninja, can be downloaded from a pre-built SDK. This will give you exactly the library used for the official ossia score releases. This is recommended on Windows and Linux distributions older than Ubuntu 22.04.
This script will download the latest version of the SDK automatically. Otherwise:
- On Windows:
On Linux: Download the SDK and extract it in
/opt/ossia-sdk. You must also install CMake (from your distribution’s repositories).
- On macOS: Download the SDK and extract it in
/opt/ossia-sdk-x86_64. You must also install XCode (sorry) and CMake+Ninja (for instance through Homebrew).
Make sure to make a recursive clone of the project, or you will encounter build issues:
$ git clone --recursive -j16 https://github.com/ossia/score
With git bash:
$ export PATH=/c/ossia-sdk/llvm/bin:$PATH $ cmake c:/path/to/score \ -GNinja \ -DCMAKE_C_COMPILER=c:/ossia-sdk/llvm/bin/clang \ -DCMAKE_CXX_COMPILER=c:/ossia-sdk/llvm/bin/clang++ \ -DOSSIA_SDK=c:/ossia-sdk \ -DCMAKE_BUILD_TYPE=Debug \ -DSCORE_PCH=1 $ cmake --build .
Or with cmd.exe, the native command shell:
> set PATH=c:\ossia-sdk\llvm\bin;%PATH% > cmake c:\path\to\score ^ -GNinja ^ -DCMAKE_C_COMPILER=c:\ossia-sdk\llvm\bin\clang ^ -DCMAKE_CXX_COMPILER=c:\ossia-sdk\llvm\bin\clang++ ^ -DOSSIA_SDK=c:\ossia-sdk ^ -DCMAKE_BUILD_TYPE=Debug ^ -DSCORE_PCH=1 > cmake --build .
Note: on Windows, the system antivirus slows build times a lot. Be sure to exclude recursively:
- The ossia-sdk folder
- The score source folder
- The score build folder
from antivirus scans if things are slow as it seems that every file access is checked, and compilers do those a lot.
It is harder to give a single set of build instructions for Linux, as every distribution differs.
Check out the build scripts for your distros here.
For instance, for Ubuntu 20.04:
You should change the CMake invocation a bit, as the one on the CI scripts is optimized for a fast complete rebuild on the CI server, but changing a single file and rebuilding will be excruciatingly slow:
$ cmake .. \ -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=install \ -DSCORE_DYNAMIC_PLUGINS=1 \ -DCMAKE_UNITY_BUILD=1
You really want (adapted with the clang version you have):
$ cmake ~/path/to/score \ -GNinja \ -DCMAKE_C_COMPILER="clang-14" \ -DCMAKE_CXX_COMPILER="clang++-14" \ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" \ -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ -DCMAKE_BUILD_TYPE=Debug \ -DSCORE_PCH=1 \ -DSCORE_DYNAMIC_PLUGINS=1 $ cmake --build .
which will make individual changes much faster (the difference can be between waiting a couple minutes instead of a couple seconds after each rebuild).
If you have an up-to-date distribution, you can also install the mold linker which is even faster than lld, and replace
-fuse-ld=moldin the lines above.
$ xcrun cmake ~/path/to/score \ -GNinja \ -DOSSIA_SDK=/opt/ossia-sdk-x86_64 \ -DCMAKE_BUILD_TYPE=Debug \ -DSCORE_PCH=1 \ -DSCORE_DYNAMIC_PLUGINS=1 $ xcrun cmake --build .
Once you have a build folder, only the
cmake --build . command is necessary.
Ensure that you have the latest version of Qt, boost, and your C++ compiler installed.
Note : to ensure a very fast build time, it is recommended to use clang as compiler and ninja for building, on every platform.
Additionally, on Linux and Windows
lld can be used as a linker. It is quite faster than
GNU ld and
gold. On recent Linux,
mold can also be
used, which is even faster.
At the time of this writing, this means :
|Compiler||clang 14 or gcc 12 or msvc 2022|
|Qt||5.15 or Qt 6.2+|
However, to get a complete build with support for more features, more is needed :
|FFMPEG||5.x||# Required for sound playback|
|LLVM||14.x||# Required for Faust support|
|OpenSSL||1.1.x||# Required to connect to wss / https|
|Faust||Latest||# Required to load Faust plug-ins|
|suil, lilv||Latest||# Required to load LV2 plug-ins|
|PortAudio||Latest||# Required to playback sound using Coreaudio, ASIO, ALSA, Pulseaudio…|
|JACK2||Latest||# Required to playback sound using JACK|
|SDL2||Latest||# Required to have gamepad support|
|Qt||5.15+||# Required for the GFX addon|
|qtshadertools||5.15+||# Required for the GFX addon|
Or you can install them with your package manager of choice - see the packages for each platform at the end of this document.
First get a recursive clone of the repository :
$ git clone --recursive -j16 https://github.com/ossia/score
The preferred way to build when hacking on the software is with cninja:
cninja ~/path/to/score developer
Alternatively, one can build with CMake.
Pass the following options to
cmake to ensure maximal build speed: (note that the instructions later on this page may not be entirely up-to-date)
-GNinja # Makes the build much faster -DCMAKE_C_COMPILER=/path/to/clang # Makes the build faster (only needed on Linux) -DCMAKE_CXX_COMPILER=/path/to/clang++ # Makes the build faster (only needed on Linux) -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" # Makes the linking faster (only needed on Linux) -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" # Makes the linking faster (only needed on Linux) -DCMAKE_BUILD_TYPE=Debug # For having debug symbols -DSCORE_PCH=1 # Makes the build much much faster -DSCORE_DYNAMIC_PLUGINS=1 # Makes the linking faster (only on Mac / Linux ; on Windows it does not work without rebuilding every dependency)
Important: Run the
cmakecommand in a separate build folder, especially not in the source directory of score !
For instance, for generating the build files on Ubuntu, Debian or Linux Mint, that gives :
cmake /path/to/score \ -GNinja \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" \ -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ -DCMAKE_BUILD_TYPE=Debug \ -DSCORE_PCH=1 \ -DSCORE_DYNAMIC_PLUGINS=1
If you are using the SDK mentioned above, add:
If you are not using your distribution’s Qt version because it’s too old, pass the path to a recent version with, for instance,
The path must contain a
lib folder in which CMake is going to look for Qt.
Once CMake has ran successfully, do :
cmake --build .
To be safe, you should have at least 8 gigabytes free on your hard drive before starting a build.
Refer to this video : https://www.youtube.com/watch?v=LSifHFbuky0
- The latest version of Visual Studio 2022
- Take a few seconds to contemplate the easiness of building on the above Unix platforms
- Extract https://github.com/ossia/sdk/releases/download/sdk14/win-audio-sdk-msvc.zip in your
c:\so that the folders once extracted look like
x64 Native Tools Command Prompt for VS 2022:
In the command prompt, install Qt:
(Assuming your development environment is in a
cd c:\dev # Install dependencies ## Qt pip install aqtinstall aqt install --outputdir c:\Qt 5.15.3 windows desktop win64_msvc2019_64 # Build cmake ../score -DCMAKE_PREFIX_PATH="c:/Qt/5.15.3/msvc2019_64" -DOSSIA_SDK="c:/score-sdk-msvc" -DSCORE_PCH=1 -DCMAKE_INSTALL_PREFIX=installed -DCMAKE_BUILD_TYPE=Debug cmake --build . --config Debug cmake --build . --config Debug --target install # Run cd installed score.exe