Warning: This guide may be outdated. See the wiki on GitHub for up-to-date compilation instructions.
Compile instructions (All Platforms) - read this first and then see the pages below for instructions specific to your platform.
Most instructions for Linux and BSD are the same regardless of which distribution you use, but you'll need to read the distribution-specific instructions below for any aspects that are unique to your distribution (usually only the method of installing dependencies). If no page exists for your distribution then feel free to create one - use the closest matching distribution as a starting point. If the instructions for one distribution work for a different one (or only require a few minor changes) then just add a note to the top of that page rather than creating a new one.
This generic guide covers the steps to build MuseScore that are the same on all platforms. See the platform-specific guides for details that only apply to your platform.
Note to editors: Please do not duplicate information on this page in the specific guides. Where information is already given in multiple guides consider moving it to this page instead.
Install Git and follow the steps in Git Workflow to get MuseScore's code repository on your machine.
Install CMake, Qt, and the other depedencies (or you can try to compile without them and then install them as needed based on error messages you see in the terminal).
All programs must be installed to a location mentioned in your PATH
environment variable.
Once you have MuseScore's code and dependencies on your machine, the steps to compile are the same as for any CMake project. The following commands work on all platforms (Windows, macOS, Linux) and in all shells (Bash, PowerShell, CMD, etc.). Subsequent sections of this guide go into more detail about what the commands actually do.
mkdir my_build_dir # 1. Create build directory cd my_build_dir cmake .. -DCMAKE_INSTALL_PREFIX=my_install_dir # 2. Configure (Mac: add `-GXCode`) cmake --build . # 3. Build cmake --build . --target install # 4. Install (optional)
These commands are likely to fail the first time you try. Pay attention to error messages displayed in the terminal output as they give clues about how to proceed.
Note to developers: Please ensure that error messages include information about what the problem is and also how to fix it. This reduces the need for people to rely on a written tutorial.
mkdir my_build_dir cd my_build_dir
The build directory is where compiled code will go. You can name the build directory whatever you like.
Tip: You can create multiple build directories for different configurations of the project (e.g. different platforms, compilers, git branches, or build types such as Release and Debug). This saves having to do a clean build every time you switch configuration.
cmake .. -G[generator] -D[option]=[value] # configure
During the configure step, CMake reads build rules from the top-level CMakeLists.txt and uses them to generate a native build system. This is just a new set of build rules that will work with whichever operating system, processor architecture, compiler toolchains, and IDE you happen to be using.
Note: Build rules are also taken from other CMakeLists.txt
and *.cmake
files in subdirectories mentioned in the top-level file.
By default, CMake tries to guess which native tool you want to build with. If you want it to generate code for a different tool then you can tell it to do so using the -G[generator]
option at the configure stage. On macOS, only the XCode generator is currently supported, so you must use it as follows:
cmake .. -GXCode -D[option]=[value] # configure for XCode (only on macOS)
On other platforms you can use any available generator, or you can leave out the -G
option to make CMake use the default one.
The CMake manual has a list of all generators and cmake --help
will show the ones that are available on your system.
You can pass options and variables to the configure step using the -D[variable]=[value]
syntax. For example:
cmake .. -DCMAKE_INSTALL_PREFIX=my_install_dir # configure with variable
This sets the CMake variable CMAKE_INSTALL_PREFIX to the value my_install_dir
, which means that during the install step the compiled binary and accompanying resources (fonts, translations, templates, etc.) will be copied to a directory called my_install_dir
inside your build directory.
Built-in variables
CMake's online documentation has a complete list of built-in variables. Here are some of the key ones:
/usr/local
on UNIX and C:/Program Files/${PROJECT_NAME}
on Windows, but it's a good idea to use a relative path instead as this avoids the need for root/admin privileges during the install step.Debug
because Release
discards symbols necessary for debugging. Windows users might prefer RelWithDebug
as this enables optimisations that increase performance while still retaining debug symbols.PATH
).
mingw32-make.exe
.Project variables
MuseScore defines it's own options and variables mostly in the top-level CMakeLists.txt. Examples:
BUILD_64
- Enable 64 bit builds.
MSCORE_INSTALL_SUFFIX
- string to append to the name of the mscore
binary to prevent conflicts.
MSCORE_INSTALL_SUFFIX=foo
would give mscorefoo
.""
(i.e. the empty string) so binary is just called mscore
.-portable
to enable AppImage builds on Linux.Project variables are set on the command line with the -D
option in the same way as other CMake variables:
cmake .. -DBUILD_64=OFF # configure with option
If you need to call CMake with lots of options then you could create a shell script or batch file to make it easy to run the same commands again in the future. You may notice that there are some scripts in repository root folder that do this already (see the Makefiles and msvc_build.bat). These are provided as a convenience, but it is better to avoid them and write your own if you can. CMake's purpose is to abstract the build process so that it is the same on all platforms. Providing a separate script for each platform undermines this purpose and discourages developers from learning how to use CMake properly.
cmake --build . -j[CPUs]
During the build step, CMake runs the native build tool on the generated build system. This compiles the C++ code and creates the mscore
binary.
Note: You could run the native tool yourself by calling make
, xcodebuild
or MSBuild.exe
directly, but then you'd have to learn how to use that tool and all the options it takes. Fortunately, CMake provides the handy --build option that calls the native tool for you with all the right options.
CMake 3.12 and later versions have a -j[number]
option to set the number of build jobs to launch in parallel. For the shortest build time, set the number equal to the number of CPU cores available on your machine. Alternatively, you can set the environment variable CMAKE_BUILD_PARALLEL_LEVEL.
cmake --build . --target install
During the install step, CMake again run the native build tool on the generated build system, but this time it specifically tells the tool to build the install
target. The install
target copies the compiled binaries and accompanying resources to the install directory specified in the configure step.
If you attempt to install to a system folder such as /usr/local
or C:\Program Files
then you will need to run the install command as root/admin privileges. This means using sudo
on Unix or running from an Administrator prompt on Windows.
Note: CMake 3.15 and later versions have a dedicated --install
option that does the same thing, but you can still use the old syntax if you prefer.
cmake --install . # install with CMake 3.15 or later
Installing the project is optional. You can run the compiled mscore
binary without installing it first but you won't be able to load the soundfont or templates untill you install.
You'd need to recompile the project whenever the code changes, but you don't have to go through all the steps from the beginning. You can usually get away with just running the build and install steps on subsequent builds. This applies even if you edit one of the CMakeLists.txt
or *.cmake
files; the build system will detect this during the build step and then rerun the configure step automatically.
The build system CMake generates is clever enough to only recompile code files that have actually changed. This is known as an incremental build.
Occasionally it may be necessary to start again from scratch. This is known as a clean build. You have to do this if you want to use a different compiler, and you might find that it fixes other problems too.
You can use either of the following commands from within the build directory to clean it:
cmake --build . --target clean # clean (i.e. delete compiled binaries) cmake --build . --clean-first # clean and then build
Alternatively, you can simply create a new build directory and run the configure step from inside it. Make sure you delete any old build directories that you no longer need because they take up quite a lot of space.
Note: These instructions are for building MuseScore using the Microsoft Visual Studio 2019 (VS) integrated development environment with the Microsoft Visual C++ (MSVC) compiler. If you are familiar with the QtCreator IDE or want a better experience editing .ui
files, see the instructions for Qt Creator and MSVC instead.
Maintainers: This guide is currently valid for Visual Studio 2019. Please update it for future VS versions rather than creating a new one.
You will need the MuseScore source code, as well as several programs and libraries, to be able to build MuseScore with Visual Studio.
CMakeSettings.json
and replace all occurrences of Visual Studio 16 2019
with Visual Studio 15 2017
. Make sure not to commit these changes to any pull requests.These instructions are for building MuseScore with VS2019. Any edition of this version of Visual Studio should work, including the Community edition, which is full-featured and free to use for open-source projects.
Whether or not you already have Visual Studio installed, please read these instructions carefully, as you might need to install some additional components.
CMake is used for generating the Visual Studio solution and project files needed for building MuseScore.
If you're building a standard build, Visual Studio will automatically use its own internal copy of CMake, so you don't need to download it separately.
If you're building an advanced build, you will need to download and install CMake.
(For information on the difference between standard and advanced builds, see building.)
bin
subfolder to the Path
environment variable; typically, this will be %ProgramFiles%\CMake\bin
.You will need the Qt libraries, minimum version 5.15.2, to be able to build MuseScore. For the 3.x branch Qt 5.9 is sufficient (but the others work too, but as of 583c71c
, 01Dec2020, the builds don't run when build with Qt 5.15, they crash on start or when opening a pre-3.6 score... no longer the case fortunately since at least 3.6RC), for the master branch as of 484f8dc (09Oct2020) you'd need 5.15. Go for 5.15.2, the latest and last publicly available Qt 5 release (MuseScore isn't yet ready for Qt 6, or the other way round).
bin
subfolder (e.g., C:\Qt\5.12.9\msvc2019_64\bin
) to the PATH
environment variable.bin
subfolder has not been correctly added to the PATH
environment variable.C:\Qt\5.*\mingw*\bin
folder from the PATH
environment variable, if present.NOTE: as of 1220175, 04Dec2020, JACK is no longer needed nor supported in the master branch, however it is needed if you wish to build 3.6.2 or earlier.
You will need a utility that handles .7z
compressed files. 7-Zip is open-source, free, and quite powerful, but there are alternatives that will work as well.
There are several additional dependencies:
All of these are open-source projects. Although it is possible to download them individually and build them yourself to create the required libraries, it is much easier to use prebuilt libraries and include files.
dependencies.7z
.dependencies.7z
into the MuseScore checkout folder. (This will create a new dependencies
subfolder within.)NOTE: as of 1220175, 04Dec2020, LAME and PortAudio are no longer needed nor supported in the master (4.0) branch. They are still needed if you wish to build 3.6.2 or earlier versions.
Before you can build MuseScore, you need to download and install all of the prerequisites.
MuseScore can be built in three different configurations:
Release
: Runs fast with all performance optimizations enabled, but very difficult to debug.Debug
: Very easy to debug, but runs very slow because all performance optimizations have been disabled.RelWithDebInfo
: A compromise between Release
and Debug
. Runs faster than Debug
but is more difficult to debug; conversely, easier to debug than Release
but runs somewhat slower.For each of these three configurations, MuseScore can be built for either 32-bit or 64-bit Windows.
A standard build of MuseScore uses the RelWithDebInfo
configuration for 64-bit Windows. To build this, follow the procedure for a standard build.
To build MuseScore in other configurations, or for 32-bit Windows, follow the instructions for advanced builds.
Go to File > Open > Folder… and open the MuseScore checkout folder.
Visual Studio will automatically begin to generate a CMake cache, which will include the Visual Studio solution and project files.
In Visual Studio, a solution is a collection of projects, grouped together, and sharing some basic characteristics. A project corresponds to a specific output being generated (such as an executable or a library). A project can exist by itself or within a solution, and a solution can contain one or more projects. CMake creates a single solution, with a different project for each logical component of MuseScore. The MuseScore solution contains over two dozen projects.
CMake cache generation will take a while. Watch the Output window and wait for the completion message to appear: CMake generation finished.
If everything has worked as it should, Visual Studio will have created a Visual Studio solution file called mscore.sln
inside the msvc.build_x64
subfolder of the MuseScore checkout folder, along with a collection of Visual Studio project files (*.vcxproj
).
The recommended process for running/building is:
msvc.build_x64
folder and open the mscore.sln
Visual Studio solution file.The Solution Explorer window should look like this:
Note the small red “minus sign” icons to the left of each project. Those icons mean that the project files are being excluded from the Git repository. Any directories or files with this icon are excluded and will not be included in any commits that you make.
In the Solution Explorer window, select the mscore project, then go to Build > Build mscore. (Alternatively, right-click the mscore project and choose Build from the popup menu.)
Building will take a while. Visual Studio will automatically build all of the other projects that mscore depends on. Watch the Output window and wait for the completion message to appear:
========== Build: 25 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
In the Solution Explorer window, select the INSTALL project, then go to Build > Build INSTALL. (Alternatively, right-click the INSTALL project and choose Build from the popup menu.)
Watch the Output window and wait for the completion message to appear:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Note: Make sure MuseScore4.exe is not running when building INSTALL.
To generate an advanced build, use the msvc_build.bat
batch file at a Command Prompt instead of building from within Visual Studio.
msvc.build_x64
or msvc.build_x86
and msvc.install_x64
or msvc.install_x86
subfolders of the MuseScore checkout folder or run msvc_build.bat clean
bin
subfolder has been added to the PATH
environment variable.bin
subfolder of an appropriate build of Qt (e.g., 32-bit for a 32-bit build) is the one that has been added to the Path
environment variable.msvc_build.bat
batch file in a text editor (such as Notepad) to read the instructions in the comments at the beginning of the file.msvc_build.bat
batch with the options you thing to need, e.g. msvc_build.bat RelWithDebInfo 32
.Before you can run MuseScore, you must build it.
Run MuseScore4.exe
from inside the msvc.install_x64\bin
or msvc.install_x86\bin
subfolder of the MuseScore checkout folder. (Do not run the copy of MuseScore4.exe
inside the msvc.build_x64\main\RelWithDebInfo
or msvc.build_x86\main\RelWithDebInfo
subfolder of the MuseScore checkout folder.)
Before you can debug MuseScore, you must build it.
mscore.sln
solution file.From revision 5b7c72a
onwards, committed 5th January 2018, the development version of MuseScore (master) on Windows requires Qt 5.9 or newer and a C++11 capable toolchain.
From revision 0128daf
onwards, committed 1st November 2018, the development version of MuseScore (master) on Windows also builds with Qt 5.12 (and therefor in 64bit mode, since Qt 5.12.2 32bit is also possible). To build with Qt 5.9 or anything prior to Qt 5.12 (and therefore in 32bit mode only), or using MinGW 32-bit inQt 5.12.2 and later, the BUILD_64 setting needs to get switched off manually, this doesn't get detected automatically
As of 484f8dc
, 09Oct2020, Qt 5.15 (and a C++17 capable toolchain) is required for the master branch. The 3.x builds don't run when build with Qt 5.15, as of 583c71c
, 01Dec2020, it crashes on start or when opening a pre-3.6 score... Apparently and fortunately this seems to no longer happen, since at least 3.6RC, so it is again possible to build 3.x with Qt 5.15(.2).
The 2.x branches require Qt 5.4 however, as QtWebKit is needed, and that had been removed in post 5.4 versions of Qt for Windows.
To prevent any compatibility issues, it is essential to compile MuseScore with the same type and version of compiler as was used to build Qt.
N.B. The instructions on this page are only applicable to MuseScore from the above revision onwards. If you are compiling MuseScore 1.3, or an older revision of the git repo, you need to follow the older version of these instructions, as it may require different versions of Qt and GCC.
The following tools need to get installed on your computer.
Some of the files to be downloaded are compressed using 7-Zip compression. If necessary, download and install 7-Zip.
Fresh install:
Download the Qt Online Installer for Windows.
NB There are a number of Windows installers on this page - make sure it is the Online Installer you are downloading.
Run the installer and install Qt in C:\Qt
. You just need the Qt libraries for MinGW 5.3.0 and the MinGW 5.3.0 toolchain (or those for MinGW 7.3.0 resp. MinGW 8.1.0)
(optional) Add the following directories to your %PATH%
C:\Qt\Tools\mingw530_32\bin
C:\Qt\Tools\mingw530_32\lib
C:\Qt\5.9.9\mingw53_32\bin
C:\Qt\Tools\QtCreator\bin
Update to Qt 5.9.9
Launch the Qt Maintenance Tool (C:\Qt\MaintenanceTool.exe).
First this tool will need to update itself, so select the Update components option. Once you've gone through all the steps, press the Restart button.
For this 2nd pass, select the Add or remove components option. In the select components screen, your currently installed components are preselected. Make sure to add ticks for the Qt libraries for MinGW 5.3.0 and that toolchain (see image from fresh install above).
Download the latest version of windows binaries for CMake. Choose the Windows (Win32 Installer) version. You need at least version 3.0. Versions up to 3.11.3 are known to work too (3.11 may emit some warnings reg. decrecated policies though). 3.5.1 is known to cause issues if not last in PATH.
As of 29. October 2020 the master branch requires Cmake 3.4 or later, but see below and use the one the Qt Installer provides, which is quite a lot newer.
Install in the default location (probably C:\Program Files\CMake
or C:\Program Files (x86)\CMake
) and optionally put the bin
subdirectory into your PATH.
For 3.5 and later make sure it is in PATH after the 3 Qt mingw directories (see above).
The Qt Installer (see above) meanwhile does offer CMake too, and also auto-updates it at times, so might be the better choice.
Get the source code from GitHub. If you need a Git client, you can try Git for Windows or the GitHub windows client.
git clone git://github.com/musescore/MuseScore.git
If you plan to contribute to MuseScore, you can setup your own fork on GitHub and clone it instead. See the Git workflow page.
Note: Directory names with spaces in them cause the build to fail; so avoid spaces in the name of your clone directory.
(optional but recommended) In your clone directory, copy the file build/git/hooks/post-checkout
to the directory .git/hooks
in order for mscore/revision.h
to be maintained automatically by git. See build/git/hooks/README
for details. Note that the .git directory is hidden.
You must have the following in your %PATH%:
C:\Qt\Tools\mingw530_32\bin
(or wherever MinGW is installed for you)C:\Qt\Tools\mingw530_32\lib
(or wherever MinGW is installed for you)C:\Qt\5.9.9\mingw53_32\bin
(or wherever Qt is installed for you)C:\Program Files\CMake\bin
(or wherever you installed CMake)C:\Qt\Tools\QtCreator\bin
If you want to launch QtCreator from the command lineNOTE: You can add path elements to cmd shells via Computer / System Properties / Advanced System Settings / Environment Variables. However, the make process can be sensitive to the rest of the contents of your %PATH% as well. If you encounter issues like mingw32-make immediately terminating with error code 0xc00000fd, then try stripping your path down to only the above elements, plus perhaps C:\Windows
and C:\Windows\System32
. You might consider running the build from a batch file that temporarily sets your %PATH%
to just the required elements.
A good approach to doing so is to create the following batch file in the "C:\Qt" folder:
C:\Qt\qt.bat
@echo off
echo Setting up a MinGW/Qt only environment...
echo -- Set QTDIR to C:\Qt\5.9.9\mingw53_32
set QTDIR=C:\Qt\5.9.9\mingw53_32
echo -- Set PATH to %QTDIR%\bin
set PATH=%QTDIR%\bin
echo -- Adding C:\Qt\Tools\mingw530_32\bin;C:\Qt\Tools\mingw530_32\lib to PATH
set PATH=%PATH%;C:\Qt\Tools\mingw530_32\bin;C:\Qt\Tools\mingw530_32\lib
echo -- Adding %ProgramFiles%\CMake\bin
set PATH=%PATH%;%ProgramFiles%\CMake\bin
echo -- Adding to C:\Qt\Tools\QtCreator\bin
set PATH=%PATH%;C:\Qt\Tools\QtCreator\bin
echo -- Adding %SystemRoot%\System32 to PATH
set PATH=%PATH%;%SystemRoot%\System32
echo -- QMAKESPEC set to win32-g++
set QMAKESPEC=win32-g++
cd %USERPROFILE%
echo -- Set MAKEFLAGS to -j %NUMBER_OF_PRCESSORS%
set MAKEFLAGS=-j %NUMBER_OF_PROCESSORS%
rem un-rem the last line to start Qt Creator immediately
rem using /low makes sure you can still work with the PC
rem -lastsession gets you back where you left
rem start "" /low qtcreator -lastsession
Then create a shortcut to this batch file somewhere in the Programs menu. If starting QtCreator immediately, the shortcut can be set to "Start minimized".
(Note: if you don't want to launch qtcreator from a bat file, you can still set MAKEFLAGS to a hardcoded value directly inside of qtcreator by going to Projects->Build->"Build Environment" and adding a variable MAKEFLAGS with value "-j 4" for 4 or any number of compile threads.)
In addition to Qt, MuseScore depends on:
NOTE: as of 1220175, 04Dec2020, PortAudio and LAME are no longer needed nor supported in the master branch.
One way is to put most of these dependencies directly in the MinGW include path. This may be ugly, but is pretty convenient. Either follow the below instructions or take this archive, unpack lib
and i686-w64-mingw32
to C:\Qt\Tools\mingw730_32\
resp.C:\Qt\Tools\mingw530_32\
(C:\Qt\Tools\mingw491_32\
for 2.x branches) and Jack
to C:\Program Files (x86)\
(these files are used for the development builds) or install just Jack and for the rest take Qt-additions.zip and unpack it into C:\
.
As of 5d889d7 (27Apr2019) there is another and cleaner way (and one that also works for 64bit builds): use the same method as for the MSVS/VC builds, see https://musescore.org/en/handbook/developers-handbook/compilation/compi…, i.e. grab this dependencies.7z and extract the contents into the base dir. (This will create a new dependencies folder in that base dir.)
The latest source also requires libraries for Vorbis and Ogg.
1. Get the library files for libVorbis and libOgg from: http://www.xiph.org/downloads
2. Copy the directories: include\vorbis
and include\ogg
into C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include
(Copy the entire directory so that you end up with C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include\vorbis
and C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include\ogg
)
3. Get the Vorbis Tools and copy libogg.dll
, libvorbis.dll
and libvorbisfile.dll
into C:\Qt\Tools\mingw530_32\lib
(You need to decompress the .7z file using 7 Zip)
portaudio.dll
from a previous MuseScore install (bin
directory) and copy to C:\Qt\Tools\mingw530_32\lib
portaudio.h
from the current version at http://www.portaudio.com/download.html and copy to C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include
. You need to decompress the .tar.gz file using 7 Zip, as before.NOTE: as of 1220175, 04Dec2020, PortAudio is no longer needed nor supported in the master branch.
Jack
in your program files directory. The name of the program files directory can vary depending on the version and language of Windows. The environment variable %ProgramFiles%
or %ProgramFiles(x86)%
is used to find the directory. On an English version of Windows this will result in looking in C:\Program Files\Jack
or in C:\Program Files (x86)\Jack
on a Windows 64-bitinclude\sndfile.h
into C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include
bin/libsndfile-1.dll
into C:\Qt\Tools\mingw530_32\lib
C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include
directory called lame
include\lame.h
into C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include\lame
C:\Qt\Tools\mingw530_32\lib
NOTE: as of 1220175, 04Dec2020, LAME is no longer needed nor supported in the master branch.
If you wish to use the QtCreator IDE, follow the instructions in section "Qt Creator IDE", below.
Open a command line, possibly using a batch file such as qt.bat
given above.
Browse to the directory where you checked out musescore
Enter
mingw32-make -f Makefile.mingw release
or
mingw32-make -f Makefile.mingw debug
Note that the two options internally set different flags for the compiler. In debug mode the QT_DEBUG
flag is used, so conditional code controlled by #ifdef QT_DEBUG
is compiled. In release mode NDEBUG
is set. Unless you are building a release, it is suggested that you use the "debug" option, like in the section on the Qt Creator IDE (below).
Be patient ... On my Vista laptop (Intel T7550) it takes more than one hour to build. Build times on Windows can be more than twice as long as build times on Ubuntu (using the same computer). Once the compilation finishes, the MuseScore executable can be found in build.release/mscore/MuseScore.exe
or build.debug/mscore/MuseScore.exe
. So long as C:\Qt\Tools\mingw48_32\lib
is in the PATH, it should not be necessary to copy any DLLs. However, it has been found necessary to copy the complete directories iconengines
and imageformats
from %QTDIR%\plugins
to the build.release/mscore
or build.debug/mscore
directory (resulting in, for example, build.debug/mscore/iconengines
. This should be sufficient for most development work.
Note: You may need to go into the preferences, and fix the paths to have Windows-style slash characters (backslash), or you may see error messages about not being able to open files. [Is this a bug?]
If you need the language files, instrument list, templates, and the normal directory structure of a installed version of MuseScore then type:
mingw32-make -f Makefile.mingw install
or, for a debug build:
mingw32-make -f Makefile.mingw installdebug
Once install has finished look in the current directory for win32install/bin/MuseScore.exe. In this case there is no need to copy DLLs or the plugins directories, as they are already copied during the make process.
Note: These instruction are know to work up to QtCreator 3.6.1. For instructions for QtCreator 4.x see Qt Creator 4.x compile instructions instead.
Once you setup everything above, you can open Qt Creator, either by typing start qtcreator
from within a command prompt started as above, or by creating a separate batch file with start qtcreator
as the last command.
Go to File ⇒ Open File or Project....
Choose CmakeLists.txt file type and open the file CmakeLists.txt
from your source directory.
Now it will take you through a pathwizard:
MuseScore-build
, if MuseScore
is your checkout directory. Change this to choose a build directory of MuseScore/build.qtc
instead.C:\Program Files (x86)\CMake\bin
)-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=build/mingw32.mingw.cmake -DCMAKE_INSTALL_PREFIX=../win32install
Note: the -DCMAKE_TOOLCHAIN_FILE=build/mingw32.mingw.cmake
is needed the first time, but leads to a warning about being unused on subsequent times...
Note: as of 9caf157 (for the master branch) this file build/mingw32.mingw.cmake
no longer exists and so the -DCMAKE_TOOLCHAIN_FILE=build/mingw32.mingw.cmake
needs to get removed from the config.
As for the manual build, the supplementary DLLs should be found via C:\Qt\Tools\mingw530_32\lib
in the PATH, so no further setting of environment variables should be required.
Before your first build or debug session, you will need to configure the Build, Deploy, and Run steps. Click Projects at left, then Build toward the top of the screen. Under Build Steps, expand the Details button and add a checkmark next to the lrelease
target.
Then go back to the top of the screen and click Run. On this screen, you will first need to click Add Deploy Step. Select Make, then select install
under Targets. Finally, you will need to click the Add button under Run Configuration to add a custom executable, and set it to %{sourceDir}\win32install\bin\MuseScore.exe
.
To compile the debug build and start debugging go to Debug ⇒ Start debugging ⇒ Start debugging or simply click the debug icon. You have access to Qt help, completion, and debugging features!
Note that there is a bug in the Qt Creator debugger. In some cases it will crash when a QPrinter object is instantiated (http://bugreports.qt-project.org/browse/QTBUG-14048). This happens when you print (of course!).
Attachment | Size |
---|---|
Qt-additions.zip | 3.58 MB |
This page is a walkthrough for setting up MuseScore debugging with Qt Creator 4.x. It assumes you have completed all steps from Compile instructions (Windows - MinGW) - Git before starting.
start qtcreator
from within a command prompt started as above, or by creating a separate batch file with start qtcreator
as the last command.CMakeLists.txt
from your source directory. This will lead to a screen to start configuring the project.Make sure to change the build directory to be build.qtc
directly under the directory of your git clone. Please make sure the name of the build directory does not contain spaces.
In the screenshot, the project was cloned into MuseScore_git
, so this results in the following setting:
Click on Configure Project to continue.
Navigate to Projects ⇒ Build & Run ⇒ Build to adjust the following CMake settings:
../win32install
(use ..\win64install
for 64-bit builds, possible with Qt 5.12). Seems for master branch it is now one lever higher, so drop the ../
.DEBUG
(Prior to cd19c84 for master and cba1df2 for 2.2 mind the uppercasing!, later builds are fine using the default value of Debug
)Additional changes for older versions before 9caf157 (5th January 2018)
Click on Apply Configuration Changes
CMake will automatically run. You'll see a spinner over the CMake settings while it does.
Note: You might get a warning from CMake about QT_QMAKE_EXECUTABLE not being used.
Scroll a bit down to the Build Steps area. Expand the Details of that area and select the lrelease
target.
Use the button just below this list to add another Build step:
And set it to the install
target:
In the left column of the screen, click on Run to switch to the Run Settings. Where the Run configuration is set, choose to Add a Custom Executable
.
Finally, set the Executable value to %{sourceDir}\win32install\bin\MuseScore3.exe
(use win64install
for 64-bit builds and MuseScore3.exe
when building MuseScore 3, and MuseScore4.exe
when building MuseScore 4)
These are some of the problems that you may or may not face while completing the next section.
The compile time for debug build will vary from 10 minutes (8 core system) to 1 hour (single core) depending on the number of cores that your system has.
One should disable the ClangCodeModel in the top bar under Help > Plugins > C++ otherwise you may get many C++ errors/issues. These don't prevent a build but may result in missing important warnings and real errors.
After step 2, if you get an error stating that libgcc_s_seh-1.dll not found under your mingw root directory's bin, then you're most probably building a 32-bit version, then you have to disable BUILD_64 from your building process. To do so go to Projects in the left hand side. Under Build & Run, click on Build. Where you previously set CMAKE_EXECUTABLE_PATH, there will also be a checkbox for BUILD_64. Disable that and then follow the instructions in the next section.
Most likely you will be able to compile successfully.
To compile the debug build and start debugging you can do either one of the following:
If you have a multi-core/threading processor, compilation can be sped up significantly by allow Qt Creator to launch multiple parallel build processes. To achieve this, you can set -j%NUMBER_OF_PROCESSORS%
in the Tool arguments for both the Build Steps as the Deployment Steps.
On a quad-core hyperthreading processor you could go up to -j8
to maximize the processor load. It might be wise to set the number to be one lower than your maximal number of processes, allowing you to perform another program while the build is running.
If you are facing errors which mention resfile.o in description like here (see https://musescore.org/en/node/151481), the following command line hack should help you.
The issue relates to incorrectly initialized windres tool and its path. To correctly initialize the related cmake data, please do the following:
mingw32-make.exe -f Makefile.mingw debug
mingw32-make.exe -f Makefile.mingw installdebug
On that same tab, go to Manage Kits…. Select the default kit and click the Change… button for the CMake Configuration setting. In the edit popup window, add CMAKE_TOOLCHAIN_FILE:STRING=build/mingw32.mingw.cmake
or CMAKE_TOOLCHAIN_FILE:FILEPATH=build/mingw32.mingw.cmake
as a new line and OK out of both popup windows.
Note: as of 9caf157 (for the master branch) this CMAKE_TOOLCHAIN_FILE:FILEPATH=build/mingw32.mingw.cmake
is no longer valid and needs to get removed from the config.
This page is instructions for how to use the MSVC compiler inside the Qt Creator IDE. This is useful to take advantage of Qt-specific features, like visual editing of UI files in Qt Creator's Design mode.
If you don't mind having multiple IDEs, the easiet way to get what you need to to follow the Prerequisites section of the guide for Visual Studio and then return here when done.
Microsoft makes their build tools available separately to the Visual Studio IDE, so if you are using Qt Creator as your IDE then in theory it should be possible to compile MuseScore without also installing Visual Studio. Unfortunately this doesn't seem to be working at the moment, so the best thing to do is to follow the instructructions above to install with Visual Studio.
If you really want to try without Visual Studio (e.g. if short on disk space) then you can try installing just the C++ build tools. This has worked in the past, but fails with linker errors when last tried (November 2020). It's possible this could be fixed by using the right combination of include statements in MuseScore's header files, or by choosing the right combination of options in Microsoft's build tools installation wizard.
To install only the C++ build tools:
Run the installer you downloaded, and when you get the the Workloads screen, ensure the C++ build tools option is checked. That's the only thing you need.
You can optionally look under the Individual components tab, where you should see the following items checked:
It's possible that you don't need all of those components, but installing them does no harm (assuming you have enough space on your drive).
The Windows 10 SDK offered with the Build Tools installer does not include debugging tools by default. To get the CDB debugger for Windows, you need to modify the SDK installation to include it.
Select Change and click Next. You should see this screen:
Select the Debugging Tools for Windows option and click Change.
If you already have Qt installed then you can simply run the Maintenance Tool that came with it (the tool is in C:\Qt or wherever you installed Qt). If you don't have Qt already installed, you need to download the Qt Online Installer for Windows and run that instead.
Ensure the following components are checked within the Maintenance Tool / Online Installer:
If you want to be able to debug within Qt Creator (recommended), also check:
Click Next to install these components.
Download dependencies.7z and extract the contents into the base directory. (This will create a new dependencies folder in that base directory.)
Also install Jack.
It's a good idea to make sure you can compile from the command line before you try to set up an IDE.
The following batch script has the commands need to set up the build environment and compile MuseScore. Modify the paths as neccesary for your machine, then save the file as msvc_build.bat
inside your MuseScore code repostory.
REM Add Qt to PATH
SET "PATH=C:\Qt\5.12.9\msvc2017_64\bin;%PATH%"
REM Set up build environment (next line optional, but uncomment it if compiler is not found)
REM CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
REM Tell MSVC to use all processor cores
SET "CFLAGS= /MP%NUMBER_OF_PROCESSORS%"
SET "CXXFLAGS= /MP%NUMBER_OF_PROCESSORS%"
REM Create build directory
IF not exist "my_build_dir\" MKDIR "my_build_dir"
CD my_build_dir
REM Configure, build and install MuseScore
cmake .. -DCMAKE_BUILD_TYPE=RELWITHDEBINFO -DCMAKE_INSTALL_PREFIX=my_install_dir
cmake --build . -j %NUMBER_OF_PROCESSORS%
cmake --build . --target install
ECHO "Executable location: my_build_dir\my_install_dir\bin\MuseScore4.exe"
Add the script's filename to .git/info/exclude
to prevent it from being checked-in to the repository.
To run the script:
cd
(change directory) followed by a space and the path to your MuseScore code repository
cd C:\Users\[username]\MuseScore
cd
commandmsvc_build.bat
and press Enter to run it.The following shortcuts make command prompt much easier to use:
Clicking the CMD icon in the top left corner of the window brings up a menu with useful options, including Edit and Properties. You might want to go into Properties and enable "Use Ctrl+Shift+C/V as Copy/Paste". These are the standard copy and paste shortcuts available in most Command Prompt / Terminal applications on Windows and Linux.
Note: there are two other primary build modes, debug
and release
. Debug
is not currently supported for MSVC due to linking errors.
IDEs are convenient for experienced users, but they introduce another layer of complexity. If something goes wrong then you might not know whether the issue is with the IDE or the compiler.
To retain control over the compile process, you could choose to ignore Qt Creator's IDE features and just use it as a text editor for MuseScore's .cpp, .h and .ui files. Simply keep your Command Prompt open in a separate window, and press Up and Enter every time you want to recompile.
To set up a basic project where Qt Creator is only used as a text editor:
*.ui
to the list of types shown*
to the list of types hidden (hides everything else)libmscore
, mscore
and mtest
You can debug inside Qt Creator even if the program wasn't built in Qt Creator.
To set this up within your Qt Creator project:
Now when you want to debug, go to the Debug menu > Start debugging > Start debugging without deployment.
If you try to debug and see the message "Unable to create a debugging engine", make sure that you installed the Debugging Tools inside the Windows SDK and installed CDB Debugger Support in Qt Creator as explained earlier. If it still doesn't work then go to the Projects tab in the left panel, click "Manage Kits" and make sure the correct debugger is selected for you chosen kit.
To avoid having to open CMD, you can tell Qt Creator to run your mybuild.bat
script for you every time you press a compile button with Qt Creator itself. This gives you the best of both worlds: you get the convenience of an IDE but still have the flexibility and reliability of a separate build script.
To get Qt Creator to use your build script:
Now when you want to build, simply press the big green triangle with the bug in the bottom left of the screen. When you want to delete the build files and start again, go to the Build menu and choose "Clean Project".
MuseScore uses the CMake build system. The "proper" way to set up a CMake project in Qt Creator is as follows:
Qt Creator will spend a few minutes "configuring" the project, but once that's done everything is set up all ready for you to click "build". There's no need to go messing around with build and debug configurations, as Qt Creator does this automatically. At least, that's the theory...
In practice, the automatic method is vulnerable to changes in the CMake files, and it tends to break fairly often without reason. This forces you to run the configuration again, which takes a few minutes in Qt Creator (and other IDEs) but only takes a couple of seconds on the command line.
Ultimately, the most reliable way to compile is to copy whatever is done inside the build scripts used for MuseScore's CI tests. Build scripts will always use a command line method rather than an IDE.
This guide is for compiling MuseScore from the source code for testing and/or contributing purposes. If you just want to test (and not contribute code changes) then you may find using a pre-compiled Development Build easier than compiling.
You shouldn't use this method to install MuseScore for everyday score editing. Instead, get the latest official release from the Downloads page. (Of course, if there's no package for your distribution then you have no choice but to compile.)
MuseScore uses Git for version control. Use these commands to get MuseScore's source code for building and testing purposes. (If you want to make changes to the code then substitute the clone URL for the URL of your own fork of MuseScore on Github, and also read Git Workflow.)
git clone git://github.com/musescore/MuseScore.git cd MuseScore
Note: the "git clone" command will put the code in a new folder called "MuseScore", so we use "cd" to enter the MuseScore directory. All subsequent commands in this guide should be run from the "MuseScore" directory.
# Fetch only the files required by (for example) the v2.0.2 tag: # Note: Simply remove "--depth 1" if your git doesn't have that argument. git clone --depth 1 git://github.com/musescore/MuseScore.git --branch v2.0.2 cd MuseScore
This is useful if you were forced to compile MuseScore because no package was available for your distribution, or if you are building a package. Tags are more stable than development branches so their use is recommended in this situation.
Please refer to the README.md in the git repository to get relevant information!
Firstly, you should update the revision number that will be displayed in MuseScore's Help → About dialog. This is useful for tracking issues so this step should be done by everyone, including package maintainers. Simply do:
make revision
If you don't already have a copy of MuseScore installed on your machine then you can compile the usual way:
# This causes conflicts if multiple versions are present and therefore is NOT RECOMMENDED make sudo make install
This creates an executable file /usr/local/bin/mscore
which can be run by typing mscore
in the terminal.
However, if you do have (or plan to have) another version of MuseScore installed (e.g. via your distribution's package manager) then you'll probably want to be able to distinguish between them, so do this instead:
# Use SUFFIX and LABEL if multiple versions are installed to distinguish between them make SUFFIX="-self" LABEL="Self Build" sudo make SUFFIX="-self" LABEL="Self Build" install
NOTE:make install
is required, even for development. Because when runtime, built executable (CMAKE_BINARY_DIR/mscore/mscore
) needs some installed files, for example, soundfonts, which is located at `/usr/local/share/mscore-VERSION/sound/`. Running the built executable withoutmake install
will cause crash.
This creates an executable file /usr/local/bin/mscore-self
which can be run by typing mscore-self
in the terminal. Alternatively, you can click on the relevant icon from your desktop launcher:
The label "Self Build" allows you to distinguish your compiled version from any other versions you might have installed (e.g. official releases or nightly builds). You can set SUFFIX and LABEL to anything you want (but no spaces in SUFFIX).
You can stop reading here if you want. The following section is not required. However, it may give you some tips about custom installation or optional post-installation tasks.
Note: it is no longer necessary to use PREFIX to avoid $PATH
conflicts when installing multiple versions (you can use SUFFIX and LABEL instead). Of course, you might have other reasons for using PREFIX.
If you want to install MuseScore elsewhere (not in the default location /usr/local
), you can specify the path as follows:
make revision make PREFIX=$HOME/software make PREFIX=$HOME/software install
In this example, a local installation (only for the current user; no root privileges needed) is done. The resulting executable file is bin/mscore
, located in the folder specified during build. For the above example, this gives $HOME/software/bin/mscore
.
Note: for more info about the development process with git
, see Git Workflow
.
The source code previously downloaded with git
can be updated locally. Only new commits will be retrieved:
cd MuseScore git pull
Note about the first command: the folder MuseScore
is the one created by git
and where you performed the compilation.
After updating you will need to compile again using:
# Remember to change SUFFIX and LABEL here if you set them to something else previously make revision make SUFFIX="-self" LABEL="Self Build" sudo make SUFFIX="-self" LABEL="Self Build" install
'make' is clever and it will only get the compiler to compile the new files; unchanged files and files where no dependency has changed will not be recompiled, so it should be much faster than the initial compile. However, sometimes errors occur during compilation and it will be necessary to start again from scratch. To do this you must delete all of the intermediate object files (of which there are many!) that are created in the source code folder during compilation. Fortunately, there is a simple command to do this for you:
make clean
The next time you try to compile the code, it will start anew.
Note: before using make clean
you should read the notes for "Uninstalling MuseScore" (immediately below).
There is a Makefile target to uninstall, so removing MuseScore is effortless:
sudo make uninstall
Obviously you must run this from within the MuseScore
source code folder (created by git
) where you performed the compilation.
Note:
make uninstall
before you run make clean
because it is not possible to do so afterwards.make uninstall
or make clean
it is not necessary to specify any variables (PREFIX, SUFFIX, etc.) even if you specified them during compilation.make uninstall
was unavailable or broken on the latest development branch. In such cases, your last resort is to use a more arbitrary and dirty way to uninstall:xargs rm < install_manifest.txt
MuseScore is a sophisticated program made up of millions of lines of code split among thousands of files. Although it is possible to edit the code in any text editor and build from the command line, there are specialised tools to make the challenge of coding and spotting errors in such a huge project much easier to manage:
These are some of the problems that you may or may not face while completing the next section.
1. The compile time for debug build will vary from 10 minutes (8 core system) to 1 hour (single core) depending on the number of cores that your system has.
2. One should disable the ClangCodeModel in the top bar under Help > Plugins > C++ otherwise you may get many C++ errors/issues. These don't prevent a build but may result in missing important warnings and real errors.
If you have a multi-core/threading processor, compilation can be sped up significantly by allow Qt Creator to launch multiple parallel build processes. To achieve this, you can set -j$(shell getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1) in the Tool arguments for both the Build Steps as the Deployment Steps. You can also manually set the number of threads, e.g. -j8.
On a quad-core hyperthreading processor you could go up to `-j8` to maximize the processor load. It might be wise to set the number to be one lower than your maximal number of processes, allowing you to perform another program while the build is running.
This is the normal way (but not necessarily the best way) to configure Qt Creator for a CMake project. The advantage of this method is that Qt Creator does most of the setup and configuration for you. The disadvantage is that the CMake configuration can break from time-to-time when MuseScore's CMakeLists.txt are changed. This method also makes it more difficult to compile MuseScore from the Terminal should you need to do so.
To install MuseScore so all features will be available (e.g. SoundFonts and templates) do the following:
In "Build settings" set the Cmake setting CMAKE_INSTALL_PREFIX to install. Remember to click "Apply Configuration Changes".
In "Run settings" add a deploy step where target is install (cmake --build . --target install). Then add a "Custom Executable" run configuration with executable set to %{buildDir}/install/bin/mscore (if that does not work, try %{sourceDir}/install/bin/mscore).
This method bypasses Qt Creator's built-in handling of CMake and simply specifies some Terminal commands to build and run MuseScore. This makes it easier to build MuseScore outside of Qt Creator and ensures that you always use an up-to-date CMake configuration.
*.ui
to the list of file types to be shown, and *
to the list of types to be hidden (hides everything else) and then apply the filter.libmscore
, mscore
and mtest
and then click "Next".Build directory: ~/src/MuseScore (or wherever the code is located) Build steps: make revision make installdebug PREFIX=install SUFFIX=-qt LABEL="Qt Creator Build" UPDATE_CACHE=FALSE Clean steps: make uninstalldebug make clean Build environment: Use System Environment
Executable: build.debug/install/bin/mscore-qt (this file won't exist until you run the build for the first time) Working directory: %{buildDir}
Using the Makefile means that you always use the same build configuration as Travis. If the CMake options are changed by a PR then your configuration is updated automatically when you fetch and merge the changes from upstream.
mkdir musescore_build
cd musescore_build
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../MuseScore
More information: http://www.cmake.org/Wiki/Eclipse_CDT4_Generator
This page contains only the compilation instructions that are specific to Ubuntu 12.04 LTS.
Tested working on: Ubuntu 12.04 LTS Desktop and Server editions.
GCC 4.8 or higher is needed. On Ubuntu 12.10 and higher, it's the default compiler. On Ubuntu 12.04, you will need to install it.
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install g++-4.8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
Download and install Qt 5.3 from http://qt-project.org/downloads
Add Qt bin directory in your $PATH.
For 32-bit:
echo "PATH=~/Qt5.3.2/5.3.2/gcc/bin:$PATH" >> ~/.bashrc source ~/.bashrc
or for 64-bit:
echo "PATH=~/Qt5.3.2/5.3.2/gcc_64/bin:$PATH" >> ~/.bashrc source ~/.bashrc
sudo apt-get install git cmake sudo apt-get install alsa libsndfile1 sudo apt-get install libasound2-dev portaudio19-dev libsndfile1-dev zlib1g-dev libfreetype6-dev sudo apt-get install lame libmp3lame-dev sudo apt-get install libssl-dev
In Ubuntu 13.04 you need to install these additional libraries:
sudo apt-get install libdrm-dev libgl1-mesa-dev
Note: In some cases, libgl1-mesa-dev(and/or libegl1-mesa-dev) needs to be installed in Ubuntu 12.04 desktop edition too. Install this library if you get the following error while making:
Failed to find "GL" in "".
sudo apt-get install libpulse-dev sudo apt-get install doxygen
Now follow the generic instructions for compiling on Linux.
This page is deprecated and kept for reference. The current development of MuseScore is done on Git and the SVN repo is abandoned. You can find instructions to build the most up to date version in the developer handbook
The following steps explains how to build and install MuseScore trunk on Ubuntu 9.10 Karmic Koala.
These instructions have been tested on a clean Ubuntu server distrib.
Qt 4.7 PPA: deb http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu lucid main
sudo apt-get update
sudo apt-get install subversion
mkdir musescore
cd musescore
svn co https://mscore.svn.sourceforge.net/svnroot/mscore/trunk .
cd ..
wget http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86-opensource-2010.05.1.bin
chmod a+x qt-sdk-linux-x86-opensource-2010.05.1.bin
wget http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86_64-opensource-2010.05.1.bin
chmod a+x qt-sdk-linux-x86_64-opensource-2010.05.1.bin
./qt-sdk-linux-x86-opensource-2010.05.1.bin
./qt-sdk-linux-x86_64-opensource-2010.05.1.bin
if [ -d ~/qtsdk-2010.05/qt/bin ] ; then
PATH=~/qtsdk-2010.05/qt/bin:"${PATH}"
fi
source .bashrc
sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev
sudo apt-get build-dep musescore
If this magic command doesn't work, try to install the following dependencies manually:
sudo apt-get install alsa
sudo apt-get install libasound2-dev
sudo apt-get install libsndfile1
sudo apt-get install libsndfile1-dev
sudo apt-get install portaudio19-dev
Type the following to compile and install MuseScore. It will take quite some time to compile. On a 1.7Ghz CPU, it takes more than an hour.cd musescore
make revision
make release
sudo make install
Are easier... Use the update subcommand of svn and don't forget make revision
to have the right revision number in the about box.
If the build environment didn't change (Qt version etc...), type the following
svn update
make revision
sudo make install
If you want to build from scratch : cd musescore
svn update
make clean
make revision
make release
sudo make install
mkdir musescore_build
cd musescore_build
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../musescore
More information: http://www.cmake.org/Wiki/Eclipse_CDT4_Generator
Hier zijn de vereiste stappen voor het compileren van 0.9.3 op Ubuntu 8.04 Hardy:
Installeer eerst de vereiste afhankelijkheden (als u die reeds hebt)
sudo apt-get build-dep mscore
Download de .tar.bz source from Sourceforge, uncompress, compileer en install :
bunzip2 mscore-0.9.3.tar.bz2
tar xf mscore-0.9.3.tar
cd mscore-0.9.3
[De "make revision" stap hieronder is optioneel, Het revisienummer kunt u vinden in het scherm >>>Help>>> Over Musescore]
make revision
make
[ga een kopje koffie drinken tot hij klaar is...]
sudo make install
This page contains only the compilation instructions that are specific to Ubuntu and related Debian-based distributions.
Tested working on: Ubuntu 16.04 LTS, 18.04 LTS, and 20.04 LTS
It should also work with the various Ubuntu flavours, including Ubuntu MATE, Ubuntu Studio, Kubuntu and Xubuntu, etc.
It should work on derivatives such as Linux Mint, and it may also work on the corresponding Debian and Debian-derived distributions like Raspian.
Recent distributions have up-to-date versions of most of the necessary packages in the default repositories.
sudo apt-get install git cmake g++
sudo apt-get install libasound2-dev portaudio19-dev libmp3lame-dev libsndfile1-dev libportmidi-dev
sudo apt-get install libssl-dev libpulse-dev libfreetype6-dev libfreetype6
If you get an error message like this while compiling:
Failed to find "GL" in "".
Then try installing these additional libraries:
sudo apt-get install libdrm-dev libgl1-mesa-dev libegl1-mesa-dev
MuseScore uses Qt to achieve a consistent look and feel across different platforms (Mac, Windows & Linux). Qt is updated more frequently than any other dependency. Having an out-of-date version of Qt is the most common cause of problems as far reaching as strange window behavior, keyboard shortcuts not working, or the code failing to compile outright.
If your repository has Qt version 5.15 (or 5.9 for 3.x), or later, you can get Qt from your repository:
sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools qtwebengine5-dev \
qtscript5-dev libqt5xmlpatterns5-dev libqt5svg5-dev libqt5webkit5-dev \
qtbase5-private-dev libqt5x11extras5-dev qtdeclarative5-dev qtquickcontrols2-5-dev
Might need these too:
sudo apt-get install qml-module-qtquick-controls2 qml-module-qtquick-window2 qml-module-qtquick2 qml-module-qtgraphicaleffects qml-module-qtqml-models2 libqt5quicktemplates2-dev qtquickcontrols2-5-dev libqt5x11extras5 libqt5x11extras5-dev libqt5networkauth5 libqt5networkauth5-dev qtbase5-private-dev
If musescore compiles but you get a warning message while compiling about QuickTemplates2, you may get an empty Palette in Musescore. If so, check to see if "/usr/lib/x86_64-linux-gnu/cmake/Qt5QuickTemplates2" exists. If not, try copying:
/usr/lib/x86_64-linux-gnu/cmake/Qt5QuickControls2/Qt5QuickControls2Config.cmake
/usr/lib/x86_64-linux-gnu/cmake/Qt5QuickControls2/Qt5QuickControls2ConfigVersion.cmake
to
/usr/lib/x86_64-linux-gnu/cmake/Qt5QuickTemplates2/Qt5QuickTemplates2Config.cmake
/usr/lib/x86_64-linux-gnu/cmake/Qt5QuickTemplates2/Qt5QuickTemplates2ConfigVersion.cmake
And replace all mentions of "QuickControls2" with "QuickTemplates2".
If your repository does not have 5.15 (5.9), or later then follow these steps to install it:
(Note that having two different versions of Qt installed can cause difficulties. If you installed using "apt-get install" above, then you may want to remove that before following these steps.)
sudo chmod +x qt-unified-linux-x64-2.0.3-online.run
sudo ./qt-unified-linux-x64-2.0.3-online.run
echo 'export PATH=/opt/Qt/5.8/gcc_64/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
You can check the Qt installation and version by typing "qmake -version
" in a terminal.
If you experience any problems with MuseScore, first check you have the latest copy of the MuseScore source code, and then check you have the latest copy of Qt. Only once you have confirmed this (and done the same for the other dependencies) should you consider creating a bug report in the issue tracker.
Now follow the Compile instructions (Linux & BSD) - Git.
The remaining steps on this page are optional. Read them if you experience problems or wish to completely uninstall MuseScore and it's dependencies.
Remember all the packages installed previously in order to compile MuseScore? Actually, even more were installed because each installed package has its own dependencies. If you don't want them anymore, here's how to remove them.
When you proceed with the installation, apt-get
outputs in the terminal the complete list of packages that are to be installed. If you copy this list, the packages can be easily removed later with this command:
sudo apt-get remove --purge LIST
If you did not copy this output and still want to remove all the packages, it's a little more complicated but still feasible. For each command entered, for example:
sudo apt-get install git cmake g++
an entry is added in the following log file: /var/log/apt/history.log
. Open it with a text editor and find the relevant entry. Example:
Start-Date: START DATE OF INSTALLATION
Commandline: apt-get install git cmake g++
Install: libstdc++-4.9-dev:amd64 (4.9.1-15ubuntu1, automatic), libc-dev-bin:amd64 (2.19-10ubuntu1, automatic), g++:amd64 (4.9.1-4ubuntu2), g++-4.9:amd64 (4.9.1-15ubuntu1, automatic), liberror-perl:amd64 (0.17-1.1, automatic), git-man:amd64 (2.1.0-1, automatic), git:amd64 (2.1.0-1), cmake:amd64 (2.8.12.2-0ubuntu5), cmake-data:amd64 (2.8.12.2-0ubuntu5, automatic), linux-libc-dev:amd64 (3.16.0-16.22, automatic), libc6-dev:amd64 (2.19-10ubuntu1, automatic)
Upgrade: MAY BE THERE BUT IT'S NOT RELEVANT
End-Date: END DATE OF INSTALLATION
Text that must be copied follows the key Install:
libstdc++-4.9-dev:amd64 (4.9.1-15ubuntu1, automatic), libc-dev-bin:amd64 (2.19-10ubuntu1, automatic), g++:amd64 (4.9.1-4ubuntu2), g++-4.9:amd64 (4.9.1-15ubuntu1, automatic), liberror-perl:amd64 (0.17-1.1, automatic), git-man:amd64 (2.1.0-1, automatic), git:amd64 (2.1.0-1), cmake:amd64 (2.8.12.2-0ubuntu5), cmake-data:amd64 (2.8.12.2-0ubuntu5, automatic), linux-libc-dev:amd64 (3.16.0-16.22, automatic), libc6-dev:amd64 (2.19-10ubuntu1, automatic)
To remove these packages:
sudo apt-get remove --purge $(echo "TEXT COPIED ABOVE" | sed -r 's/\s\([^\)]+\),?//g')
IMPORTANT: by doing so, you may remove some Qt packages needed to run MuseScore. The following command should ensure that you have all that is required:
sudo apt-get install libqt5core5a libqt5gui5 libqt5network5 libqt5xml5 libqt5xmlpatterns5 \
libqt5svg5 libqt5printsupport5 libqt5webkit5
lrelease
When we invoke make
, a call to the executable lrelease
is done during the process. However, it's not the command /usr/bin/lrelease
from the package qtchooser
but the one from qttools5-dev-tools
. That's why the package qttools5-dev-tools
is added in the list of dependencies to install. If it was not installed, the following error would occur during the make
invocation:
make[4]: Entering directory '/path/to/MuseScore/build.release'
/bin/sh: 1: /usr/lib/x86_64-linux-gnu/qt5/bin/lrelease: not found
CMakeFiles/lrelease.dir/build.make:49: recipe for target 'CMakeFiles/lrelease' failed
make[4]: *** [CMakeFiles/lrelease] Error 127
make[4]: Leaving directory '/path/to/MuseScore/build.release'
and the following during the make install
invocation:
CMake Error at share/locale/cmake_install.cmake:36 (FILE):
file INSTALL cannot find
"/path/to/MuseScore/share/locale/mscore_af.qm".
Call Stack (most recent call first):
share/cmake_install.cmake:43 (INCLUDE)
cmake_install.cmake:45 (INCLUDE)
Makefile:62: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/path/to/MuseScore/build.release'
Makefile:92: recipe for target 'install' failed
make: *** [install] Error 2
This page contains only the compilation instructions that are specific to openSUSE distributions.
sudo zypper install -y git gcc7 gcc-c++ make cmake
sudo zypper install -y alsa-devel libpulse-devel libjack-devel portaudio-devel libQt5Core-devel \
libQt5Gui-devel libQt5Network-devel libQt5Test-devel libQt5QuickControls2-devel \
libQt5Xml-devel libqt5-qtsvg-devel libQt5Sql-devel libQt5Widgets-devel \
libQt5PrintSupport-devel libQt5Concurrent-devel libQt5OpenGL-devel libqt5-linguist-devel \
libQt5Help5 libqt5-qttools-devel libqt5-qtwebengine-devel libmp3lame-devel \
libsndfile-devel portmidi-devel libvorbis-devel
qmake
On openSUSE, the tool qmake
is refering to the Qt4 version of this tool. However, since MuseScore is using Qt5, the tool qmake-qt5
should be used!
This can be done by editing the file build/FindQt5.cmake
and change line 38
find_program(QT_QMAKE_EXECUTABLE qmake)
into
find_program(QT_QMAKE_EXECUTABLE qmake-qt5)
An alternative is to create a script qmake
in you path with the contents:
#!/bin/bash --noprofile exec qmake-qt5 ${*}
Now follow the generic instructions for compiling on Linux.
These instructions are tested on
* openSUSE 15.1
* openSUSE Tumbleweed as per September 9th, 2019
Please note openSUSE Tumbleweed is a rolling release with the most recent release of the used packages. At this moment (September 12th, 2019) the installed version of Qt5 is Qt5 5.13.1. This version causes several compile warnings but the resulting executable runs.
To use the recommended version of Qt5, installed the required Qt packages from another source, e.g. the openSUSE download site.
This page contains only the compilation instructions that are specific to Fedora and related RPM-based distributions.
Tested working on: Fedora 21 and 22
Install dependencies:
# Note: Use "yum" instead of "dnf" on older systems. sudo dnf install -y gcc gcc-c++ qt-devel pulseaudio-libs-devel alsa-lib-devel jack-audio-connection-kit-devel qt5-qtbase-devel qt5-qttools-libs-designercomponents qt5-qttools-devel portaudio-devel poppler-qt5-devel qt5-qtdeclarative-devel qt5-qtscript-devel qtermwidget-qt5-devel qt5-qtwebkit-devel qt5-qtxmlpatterns-devel qt5-qtquick1-devel qt5-qtsvg-devel qt5-qttools-devel qt5-qttools-static lame-devel libsndfile-devel freetype-devel texlive-scheme-basic qt5-qtwebengine qt5-qtwebengine-devel libvorbis-devel
Tested working on Fedora 28 :
sudo dnf install -y gcc gcc-c++ qt-devel pulseaudio-libs-devel alsa-lib-devel jack-audio-connection-kit-devel qt5-qtbase-devel qt5-qttools-libs-designercomponents qt5-qttools-devel portaudio-devel poppler-qt5-devel qt5-qtdeclarative-devel qt5-qtscript-devel qtermwidget-qt5-devel qt5-qtwebkit-devel qt5-qtxmlpatterns-devel qt5-qtsvg-devel qt5-qttools-devel qt5-qttools-static lame-devel libsndfile-devel freetype-devel texlive-scheme-basic qt5-qtwebengine qt5-qtwebengine-devel libvorbis-devel portmidi-devel qt5-qtnetworkauth qt5-qtnetworkauth-devel qt5-qtquickcontrols2 qt5-qtquickcontrols2-devel qt5-qtx11extras qt5-qtx11extras-devel qt5-qtbase-private-devel
Now follow the generic instructions for compiling on Linux.
Fedora 20 is deprecated and this page kept for reference only. You can find instructions to build the most up to date version in the developer handbook
Add the rpmfusion.org nonfree repository to yum, then:
sudo yum install qt5-qtwebkit-devel.x86_64 qt5-qtxmlpatterns-devel.x86_64 qt5-qtsvg-devel.x86_64 alsa-lib-devel.x86_64 jack-audio-connection-kit-devel.x86_64 portaudio-devel.x86_64 pulseaudio-libs-devel.x86_64 libsndfile-devel.x86_64 libvorbis-devel.x86_64 qt5-qttools-devel.x86_64 cmake.x86_64 cmake-gui lame-devel.x86_64
Or build lame from source and remove lame-devel from the yum install.
Change to the extracted or git cloned source directory, then:
Run:
sudo pacman -S --needed alsa-lib freetype2 libpulse libsndfile libvorbisfile.so portaudio portmidi qt5-base qt5-declarative qt5-quickcontrols qt5-quickcontrols2 qt5-graphicaleffects qt5-networkauth qt5-svg qt5-tools qt5-webengine qt5-xmlpatterns zlib lame cmake doxygen git qt5-script texlive-core make gcc jack pkgconfig
By now, you have the packages you need. You'll be able to continue for Linux/BSD compiling process at Compile instructions (Linux and BSD) - Git
(Tested on Manjaro Linux 21.1.3 (x86_64), with kernel labeled as "5.13.15-1-MANJARO". September 19, 2021)
Use these instructions to compile MuseScore master branch with QtCreator and Qt 5.15 (the minimum supported Qt version) on macOS 10.13+.
See the Versions Reference page for which macOS versions are supported by Qt 5.15.
Install Xcode developer tools
xcode-select --install
Download and install Qt for open source with Qt online installer
Select at least two modules: macOS and QtWebEngine
Install the dependencies. If you are new to macOS development or do not have a preference, we suggest Homebrew,
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" $ brew install libogg libsndfile libvorbis pkg-config portaudio jack lame cmake git
If you prefer MacPorts, choose the DMG of your OS and install MacPorts.
Open a terminal and enter the following (in your home):
$ sudo port install git libsndfile pkgconfig lame portaudio jack cmake
Clone the project from GitHub
git clone <your_fork_url>
Open the QtCreator and select File -> Open File or Project then choose file CMakeLists.txt
Configure project
switch to Projects mode and change CMake configuration:
Run CMake
Use these instructions to compile MuseScore master branch with Xcode and Qt 5.12 on macOS 10.12+. See the Versions Reference page for which macOS versions are supported by Qt 5.12.
As of 484f8dc
, 09Oct2020, Qt 5.15 (and a C++17 capable toolchain) is required for the master branch. This excludes macOS 10.12 (and lower). The 3.x branch will stay in Qt 5.9 though.
Install the latest version of Xcode from the Mac App Store.
Launch Xcode and accept the licence.
In Xcode, go to Preferences -> Download and install the Command line Tools. With Xcode 5, you might need to run xcode-select --install
instead.
Install the dependencies. If you are new to macOS development or do not have a preference, we suggest Homebrew,
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew install libogg libsndfile libvorbis pkg-config portaudio jack lame cmake git uncrustify
If you prefer MacPorts, choose the DMG of your OS and install MacPorts.
Open a terminal and enter the following (in your home):
$ sudo port install git libsndfile pkgconfig lame portaudio jack cmake qt513
Install Qt. It's possible to do this via Homebrew or MacPorts, but the recommened way is to use the Qt Online Installer (open source version, not commercial), which is available from the link at the bottom of this page. Open the DMG and double-click the installer (no need to drag to your Applications folder). You'll have to sign-in / create a Qt account and agree to terms (probably as "an individual not working for any company" unless a company is paying you to work on MuseScore). When asked, do a Custom Installation. Under Qt 5.15.2 (i.e. the latest non-Qt 6 version), make sure the components labelled macOS and Qt WebEngine are selected. Also, at the bottom of the window, under Developer and Designer Tools, make sure that CMake and Ninja are selected.
Add Qt's binary folder to your PATH environment variable. To do this, open the hidden text file ~/.bash_profile
(if that file exists), or alternatively use ~/.profile
. If neither file exists then create ~/.profile
. Append the following line to the file you just opened:
export PATH="${PATH}:${HOME}/Qt/<QT_VERSION>/clang_64/bin"
Make sure you substitute <QT_VERSION>
for the actual version you installed. E.g. for Qt 5.15.2:
export PATH="${PATH}:${HOME}/Qt/5.15.2/clang_64/bin"
You must update the version number in this file every time you update Qt itself via the MaintainanceTool.
$ cd ~ $ git clone git://github.com/musescore/MuseScore.git
If you plan to contribute to MuseScore, you can setup your own fork on GitHub and clone it instead. See the Git Workflow page.
$ cd MuseScore
$ make -f Makefile.osx revision
$ make -f Makefile.osx release
$ make -f Makefile.osx install
$ make -f Makefile.osx package
If you are a developer, look at the xcode
target in the makefile. It generates a xcodeproj file. You can open this xcodeproj file and use the Apple IDE for tasks such as modifying, debugging and compiling MuseScore code.
Run
$ make -f Makefile.osx xcode
Then open the xcodeproj bundle in Xcode
$ open build.xcode/mscore.xcodeproj
In Xcode, run the ALL_BUILD
scheme. It will compile all the files. Then run the install
scheme. It will install the required files (fonts, images etc...) for runtime. Debug by running the mscore
scheme.
You may get this error message on the Xcode Console when you try to run the mscore
scheme:
This application failed to start because it could not find or load the Qt platform plugin "cocoa".
This mean MuseScore can't find the Qt plugins. You need to edit the mscore
scheme to set the environment variable QT_PLUGIN_PATH to point to your Qt plugins directory. The default value for Qt 5.12 is:
QT_PLUGIN_PATH=~/Qt/5.12.9/clang_64/plugins
The actual value you need to set depends on your Qt version (which you can find with qmake -v
) and where you installed it earlier on. You may also need to expand the tilde (~) to it's full value /Users/<username>
to point to your home directory.
If MuseScore doesn't start for any other reason then try reverting to factory settings, but make sure you revert the compiled mscore
debug build rather than the official version if you have it installed.
In Xcode 5+, you might need to uncheck “Allow debugging when using document Versions Browser” in Product-->Edit Scheme .. -->Run mscore.app. Otherwise --NSDocumentRevisionsDebugMode YES gets passed to MuseScore, and it doesn't know how to handle it.
In Xcode > 5, you'll find the menu item elsewhere. Product-->Scheme->Edit Scheme..
Select Run (on the left hand side), and select Options along the top of the form.
Then you'll find "Allow debugging when using document Versions Browser" in the form. Uncheck the checkbox.
The preferred way to contribute is via a Pull Request on GitHub. Patches are also welcome on the Developer Mailing List, or on the Issue Tracker.
# may no longer be relevant as this is for 10.7. Please review and remove this comment or the paragraph
Dependencies built with Homebrew will not run on older versions of macOS. Here is a zip file with the dependencies as "bottles" built on Mac OS X 10.7. They can be installed with
brew install {file}.tar.¹
Here are the steps to create an universal binary from MuseScore SVN trunk.
Please note that some steps might not be required but I document them because it works on my system by following them.
These instructions have been tested on Mac Intel with Mac OS X 10.5.8.
The whole build process takes 1 hour and 30 minutes on a Macbook 2GHz. Downloading and installing all the tools and dependencies can take one hour more but it's just a one time process.
The result of the build process is a DMG file ready to be distribute and suitable for PPC and Intel on Mac OS X Tiger and Leopard.
mkdir musescore cd musescore svn co https://mscore.svn.sourceforge.net/svnroot/mscore/trunk mscore
universal_target 10.4 universal_sysroot /Developer/SDKs/MacOSX10.4u.sdk
sudo port install pkgconfig sudo port install portaudio sudo port install libsndfile +universal sudo port install lame
sudo cp /usr/local/lib/pkgconfig/jack.pc /opt/local/lib/pkgconfig/
cd ~/musescore/mscore
make revision
make -f MakeFile.osx release
if you are a developer, take a look to the release target in the makefile. You'll see that it generates a xcodeproj file and calls xcodebuilder to build it as a command line. Of course, you can open this xcodeproj file and enjoy the Apple IDE to modify MuseScore code, correct bugs, compile, debug etc... Patches are welcome on the dev mailing list.
make -f MakeFile.osx install
make -f MakeFile.osx package
Happy building!
Use these instructions to compile MuseScore master branch on MacOS 10.10+ (see http://doc.qt.io/qt-5/supported-platforms.html).
For macOS 10.12+, please go to Compile Instructions for Xcode and Qt 5.12 on macOS 10.12+.
From revision 5b7c72a
onwards, committed 9 March 2017, the development version of MuseScore (master) requires Qt 5.9 or newer and a C++11 capable toolchain.
As of 484f8dc
, 09Oct2020, Qt 5.15 (and a C++17 capable toolchain) is required for the master branch, this does exclude macOS 10.10, 10.11 and 10.12.
the 3.x branch though stays on Qt 5.9, see above.
The 2.x branches require Qt 5.4 however.
Although MuseScore 3.x can be built with Qt 5.12, and is, on other platforms, it is currently (November 2019) a business requirement that it support MacOS 10.10 and 10.11 (which were still called OS X at that time). Qt 5.12 does not support these earlier releases, and, thus, MuseScore 3.x for MacOS is released with Qt 5.9; therefore, you should build and test with that Qt release as long as this business requirement persists. Code intentionally or unintentionally depending on Qt features and even fixes since 5.9 will not work in the release.
xcode-select --install
instead.$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew install libogg libsndfile libvorbis pkg-config portaudio jack lame cmake git
$ sudo port install git libsndfile pkgconfig lame portaudio jack cmake
~/.profile
(or alternatively ~/.bash_profile
if you already have it)export PATH=$PATH:~/Qt/5.9.8/clang_64/bin
source ~/.profile
git clone git://github.com/musescore/MuseScore.git
If you plan to contribute to MuseScore, you can setup your own fork on GitHub and clone it instead. See the Git Workflow page.
cd MuseScore
make -f Makefile.osx revision
make -f Makefile.osx release
make -f Makefile.osx install
make -f Makefile.osx package
If you are a developer, look at the xcode
target in the makefile. It generates a xcodeproj file. You can open this xcodeproj file and use the Apple IDE for tasks such as modifying, debugging and compiling MuseScore code.
Runmake -f Makefile.osx xcode
Then open the xcodeproj bundle in Xcodeopen build.xcode/mscore.xcodeproj
In Xcode, run the ALL_BUILD
scheme. It will compile all the files. Then run the install
scheme. It will install the required files (fonts, images etc...) for runtime. Debug by running the mscore
scheme.
You may get this error message on the Xcode Console when you try to run the mscore
scheme:
This application failed to start because it could not find or load the Qt platform plugin "cocoa".
This mean MuseScore can't find the Qt plugins. You need to edit the mscore
scheme to set the environment variable QT_PLUGIN_PATH to point to your Qt plugins directory. The default value for Qt 5.9 is:
QT_PLUGIN_PATH=
~/Qt/5.9/clang_64/plugins
The actual value you need to set depends on your Qt version and where you installed it earlier on. You may also need to expand the tilde (~) to it's full value /Users/<username>
to point to your home directory.
If MuseScore doesn't start for any other reason then try reverting to factory settings, but make sure you revert the compiled mscore
debug build rather than the official version if you have it installed.
In Xcode 5+, you might need to uncheck “Allow debugging when using document Versions Browser” in Product > Edit Scheme... > Run mscore.app. Otherwise --NSDocumentRevisionsDebugMode YES
gets passed to MuseScore, and it doesn't know how to handle it.
In Xcode > 5, you'll find the menu item elsewhere: Product > Scheme > Edit Scheme...
Select Run (on the left hand side), and select Options along the top of the form.
Then you'll find "Allow debugging when using document Versions Browser" in the form. Uncheck the checkbox.
The preferred way to contribute is via a Pull Request on GitHub. Patches are also taken on the Issue Tracker.
Dependencies built with Homebrew will not run on older versions of macOS. Here is a zip file with the dependencies as "bottles" built on Mac OS X 10.7 (since February 2020 bottles built on MacOS 10.10 are used as binaries built on systems older than MacOS 10.9 don't pass Apple's notarization). They can be installed with brew install {file}.tar.gz
Attachment | Size |
---|---|
bottles_MuseScore-2.0.zip | 2.79 MB |
bottles-MuseScore-3.0.zip | 2.91 MB |
bottles-MuseScore-3.0-yosemite.zip | 2.94 MB |
Use these instructions to compile MuseScore master branch on macOS 10.10+ (see http://doc.qt.io/qt-5/supported-platforms.html).
From revision 5b7c72a
onwards, committed 9 March 2017, the development version of MuseScore (master) requires Qt 5.9 or newer and a C++11 capable toolchain.
The 2.x branches require Qt 5.4 however.
Although MuseScore 3.x can be built with Qt 5.12, it is currently (November 2019) a business requirement that it supports macOS 10.10 and 10.11. Qt 5.12 does not support these earlier releases, and, thus, MuseScore 3.x for macOS is released with Qt 5.9; therefore, you should build and test with that Qt release as long as this business requirement persists. Code intentionally or unintentionally depending on Qt features and even fixes since 5.9 will not work in the release.
xcode-select --install
instead.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install libogg libsndfile libvorbis pkg-config portaudio jack lame cmake git
sudo port install git libsndfile pkgconfig lame portaudio jack cmake
~/.profile
(or alternatively ~/.bash_profile
if you already have it)export PATH=$PATH:~/Qt/5.9.9/clang_64/bin
source ~/.profile
source ~/.bash_profile
git clone git://github.com/musescore/MuseScore.git
git remote add mattmcclinch https://github.com/mattmcclinch/MuseScore.git
git fetch mattmcclinch xcode8
git cherry-pick mattmcclinch/xcode8
If you plan to contribute to MuseScore, you can setup your own fork on GitHub and clone it instead. See the Git Workflow page.
cd MuseScore
make -f Makefile.osx revision
make -f Makefile.osx release
make -f Makefile.osx install
make -f Makefile.osx package
If you are a developer, look at the xcode
target in the makefile. It generates a xcodeproj file. You can open this xcodeproj file and use the Apple IDE for tasks such as modifying, debugging and compiling MuseScore code. Run
make -f Makefile.osx xcode
Then open the xcodeproj bundle in Xcode
open build.xcode/mscore.xcodeproj
In Xcode, run the ALL_BUILD
scheme. It will compile all the files. Then run the install
scheme. It will install the required files (fonts, images etc...) for runtime. Debug by running the mscore
scheme.
You may get this error message on the Xcode Console when you try to run the mscore
scheme:
This application failed to start because it could not find or load the Qt platform plugin "cocoa".
This mean MuseScore can't find the Qt plugins. You need to edit the mscore
scheme to set the environment variable QT_PLUGIN_PATH to point to your Qt plugins directory. The default value for Qt 5.9 is:
QT_PLUGIN_PATH=~/Qt/5.9.9/clang_64/plugins
The actual value you need to set depends on your Qt version and where you installed it earlier on. You may also need to expand the tilde (~) to it's full value /Users/
to point to your home directory. If MuseScore doesn't start for any other reason then try reverting to factory settings, but make sure you revert the compiled mscore
debug build rather than the official version if you have it installed.
In Xcode 5+, you might need to uncheck “Allow debugging when using document Versions Browser” in Product→Edit Scheme...→Run mscore.app. Otherwise --NSDocumentRevisionsDebugMode YES gets passed to MuseScore, and it doesn't know how to handle it. In Xcode > 5, you'll find the menu item elsewhere. Product→Scheme→Edit Scheme... Select Run (on the left hand side), and select Options along the top of the form. Then you'll find "Allow debugging when using document Versions Browser" in the form. Uncheck the checkbox.
The preferred way to contribute is via a Pull Request on GitHub. Patches are also welcome on on the Issue Tracker.
Dependencies built with Homebrew will not run on older versions of macOS. Here is a zip file with the dependencies as "bottles" built on Mac OS X 10.7. They can be installed with brew install {file}.tar.gz
Starting from the 3.0.3 version, MuseScore has a built-in crash reporter based on Google Breakpad and libcrashreporter-qt that is able to handle crashes and gives a possibility for a user to send crash reports to the pre-defined URL. Below are the instructions on how to use or disable this crash reporting facility.
By default, the crash reporter facility is disabled on master
branch and is enabled for release branches on Windows. If you would like to change it, it can be done by changing BUILD_CRASH_REPORTER
CMake variable. The following options are available for this:
1) If you use CMake directly, just add -DBUILD_CRASH_REPORTER=ON
(or OFF
) option:
cmake -DBUILD_CRASH_REPORTER=ON ..
2) If you use the supplied Makefile or msvc_build.bat script, add that option to that script to the cmake
command invocations.
3) You can also edit CMakeCache.txt in the build.debug or build.release directory and change the BUILD_CRASH_REPORTER
value, either manually or with cmake-gui. After editing it the following builds should use the value defined in CMakeCache.txt.
libcrashreporter-qt
is stored in the MuseScore git repository as a submodule. If you cloned the source code from the repository you may need to pull that submodule. Use the following command to do it:
git submodule update --init --recursive
By default, the crash reporter sends crash reports to http://127.0.0.1:1127/post
which may be useful while debugging it with a local copy of something like mini-breakpad-server. In order to change it edit the CRASH_REPORT_URL
CMake variable as described above.
In order for crash reports to be more useful you should extract debugging symbols for the binaries using dump_syms
tool from Breakpad. Please refer to the Breakpad documentation for more details on how to do it. In brief, the process is approximately as follows:
1) Ensure that your compiler generates debugging information (e.g. add the appropriate compiler flags or use the appropriate build types like Debug or RelWithDebInfo).
2) Run dump_syms on the compiled binary (or on the separate debugging symbols file if available):
dump_syms build.release/mscore/mscore > mscore.sym
or
dump_syms.exe mscore\RelWithDebInfo\MuseScore3.pdb > MuseScore3.sym
3) Upload it to a server that is supposed to collect the reports.