Compile instructions (Ubuntu 9.10) - SVN trunk

Mis à jour il y a 8 ans
This page shows old instructions for MuseScore 1.
For MuseScore 4 users, see Compile instructions (Ubuntu 9.10) - SVN trunk.

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

Setup build environment

  1. Update your repository sources.
    sudo apt-get update
  2. Install Subversion
    sudo apt-get install subversion
  3. Get MuseScore last source code
    mkdir musescore
    cd musescore
    svn co https://mscore.svn.sourceforge.net/svnroot/mscore/trunk .
    cd ..
  4. Get Qt 4.6. This is only necessary if you are running Ubuntu Karmic without any mscore PPA. Otherwise, skip the next (four) steps until "Install MuseScore dependencies" below.
    If you are running a 32-bit OS
    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

    If you are running a 64-bit OS
    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
  5. Install Qt4.6. User home is fine. Install everything
    If you are running a 32-bit OS
    ./qt-sdk-linux-x86-opensource-2010.05.1.bin
    If you are running a 64-bit OS
    ./qt-sdk-linux-x86_64-opensource-2010.05.1.bin
  6. Put qmake in the $PATH
    Append the following to ~/.bashrc
    if [ -d ~/qtsdk-2010.05/qt/bin ] ; then
    PATH=~/qtsdk-2010.05/qt/bin:"${PATH}"
    fi

    Then run
    source .bashrc
  7. As written at the end of Qt installation process, install Qt dependencies
    sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev

Install MuseScore dependencies

sudo apt-get build-dep musescore

If this magic command doesn't work, try to install the following dependencies manually:

  1. ALSA
    sudo apt-get install alsa
    sudo apt-get install libasound2-dev
  2. Libsndfile for flac, ogg, wav export
    sudo apt-get install libsndfile1
    sudo apt-get install libsndfile1-dev
  3. Portaudio (optional)
    sudo apt-get install portaudio19-dev

Build

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

Further upgrades

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

Debug with Eclipse CDT

  1. Download Eclipse CDT bundle or install the CDT on a previous eclipse install.
  2. Check out MuseScore code from SVN in Eclipse into a directory named "musescore". You'll need a source tree linked to SVN in your workspace to get updates.
  3. Edit mscore/CMakeLists.txt and change Project name to something different than "mscore" (if not, eclipse will not find the mscore binary to run)
  4. Create a musescore_build directory in the workspace and run Cmake to generate Eclipse project
    mkdir musescore_build
    cd musescore_build
    cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../musescore
  5. Open Eclipse.
    • Import project using Menu File->Import
    • Select General->Existing projects into workspace
    • Browse where your build tree is and select the root build tree directory. Keep "Copy projects into workspace" unchecked.
    • You get a fully functional eclipse project. Be patient, Eclipse will index all cpp files and build the project.
  6. To debug, right click on the project and choose Debug as -> Local C/C++ Application
  7. Go to debugger tab, share libraries tab and uncheck Load shared library symbols automatically and Stop on shared library events
  8. You should be able to debug.
  9. If you lack sound, in Preferences->I/O, you can try to check PortAudio, APi: Alsa, Device: Pulse

More information: http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

Qt Creator IDE

  • open mscore/CMakeLists.txt as your project file.
  • when QT Creator asks for command line options for cmake, use
    -G"Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../mscore