INSTALL 6 KB
Newer Older
1 2 3 4 5 6 7
How to build MusicCollection
============================

    This file contains the steps that are needed to build MusicCollection from source.
    These steps will certainly not cover every system that exists, so additional steps
    may be necessary.

8
Prerequisites:
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
==============

    - Have boost installed >= 1.55
    - Have cmake >= 2.8.12 installed
    - Have taglib installed >= 1.9.1
    - Have Qt installed >= 5.0

Buildin on Linux:
=================

    The following steps were obtained from getting MusicCollection to work on Kubuntu
    13.10 (my home system, as well as one running within VirtualBox) and Linux Mint 16
    Cinnamon. All these systems are Debian/Ubuntu based, so you need to adjust for other
    systems.

    Install CMake
    -------------

    - Install: sudo apt-get install cmake

    Install Boost
    -------------

    - Install: sudo apt-get install libbz2-dev
    - Install: sudo apt-get install python-dev
    - wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2/download
    - mv download boost.tar.bz2
    - tar xvfj boost_1_xx_x.tar.bz2
    - check for patches and install these
    - cd boost_1_xx
    - ./bootstrap
    - ./b2 -j4 link=shared threading=multi runtime-link=shared stage
    - sudo ./b2 install

    Install taglib
    --------------

    - wget http://taglib.github.io/releases/taglib-1.9.1.tar.gz
    - tar xfvz taglib-1.9.1.tar.gz
    - cd taglib-1.9.1/
    - cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug .
    - make
    - sudo make install

    Install Qt Creator
    ------------------

    - Download the "Qt Online Installer for Linux 64-bit" from qt-project.org
    - chmod +x the run file
    - sudo ./qt...run to start installation but do not "Launch Qt Creator" at the end of
        the installation process, otherwise we get permission problems as a normal user
    - When running from VirtualBox Disable 3D acceleration in VirtualBox because the Qml
        welcome screen misbehaves
    - make the correct Qt libraries available, in my case I added the following line to
        ~/.profile
        export CMAKE_PREFIX_PATH=/opt/Qt/5.2.1/gcc_64/lib/cmake/Qt5Widgets/

    On my Jenkins server, without X, I needed to install qt5-default. This gives Qt 5.02
    versions, which suffices for now.

    Install git
    -----------

    - sudo apt-get install git

    Clone the MusicCollection source
    --------------------------------

    To clone my MusicCollection repository go to:
    https://gitorious.org/musiccollection/musiccollection
    and find out what to use.

    For example:
    git clone https://git.gitorious.org/musiccollection/musiccollection.git

    This will create a directory called musiccollection in the current directory.

    However, you cannot push changes back to the repository, so you may want to fork my
    repository, clone that and change it to your hearts content. If you then want to
    inflict your changes on me, just create a pull request, and I will have a look.

    Build MusicCollection and run unit tests
    ----------------------------------------

    The software must be built in a different directory than where the source is
    (assuming you are in the directory musiccollection):

    - cd .. 
    - mkdir buildmusiccollection
    - cd buildmusiccollection
    - cmake -DCMAKE_BUILD_TYPE=Debug ../musiccollection
    - make
    - make test

    For a release build use -DCMAKE_BUILD_TYPE=Release

    If all went well, the software is now built and the unit tests were performed without
    error.

    As a more convenient alternative, you can also build from Qt Creator:

    - Start Qt Creator
    - Click Open Project and select the file MusicCollection/CMakeLists.txt
    - Accept the suggested Build Location
    - Enter -DCMAKE_BUILD_TYPE=Debug at Arguments and check that a Desktop Generator is
        selected
    - Click Run CMake
    - Click Finish
    - The project is now opened
    - Ctrl-Shift-B to build all

    Of course, you can also use KDevelop and any other IDE that supports CMake.

    Linux trivia
    ------------

    To enable debugging (when you get the error "ptrace: operation not permitted")
    - sudo nano /etc/sysctl.d/10-ptrace.conf
    - change the line to read: kernel.yama.ptrace_scope = 0

Building on Windows
===================
131

132 133
These steps were obtained from getting MusicCollection to work on two systems, one a 64
bit Windows 7 Enterprise and one 64 bit Windows 7 Home Premium.
134 135 136

For Qt: set CMAKE_PREFIX_PATH to the path where Qt is installed, i.e. C:\Qt\5.1.1\msvc2010 on my
Windows machine.
137 138 139

On Linux:

140 141 142 143 144 145 146 147
Install TagLib:
- wget http://taglib.github.io/releases/taglib-1.9.1.tar.gz
- tar xvf taglib-1.9.1.tar.gz
- cd taglib-1.9.1/
- cmake .
- make
- sudo make install

148 149
- Create a build directory on the same level as MusicCollection: mkdir build
- cd build
150
- Configure cmake: cmake ../MusicCollection
151 152 153
- Build the software: make
- Run the software: ./musiccollection

154
- To build a debug version: cmake -DCMAKE_BUILD_TYPE=Debug ../MusicCollection
155
- After that: gdb musiccollection
156 157


158
On Windows:
159 160 161 162 163 164

- Run cmake-gui
- Enter the path to the source code, i.e. c:/prj/MusicCollection
- Enter the path to where to build the binaries, i.e.: c:/prj/msbuild
- Click 'Configure' and select Visual Studio 10 (I haven't tried any other version)
- Chances are that you see "Could NOT find Boost"
165 166 167 168 169
- One way to avoid this is to add BOOST_ROOT to the environment variables. The other is to execute
  the following steps:
  - In that case click "Add entry" and enter name = Boost_DEBUG, type = BOOL, Value = checked
  - "Add entry" name = BOOST_ROOT, type = path, Value = C:\lib\boost_1_54_0 (substitue your own path)
- For taglib either add the bin directory to the path or add a TAGLIB_ROOT environment
170 171
- Try 'Configure'again
- If Boost is now found, click Generate
172
- Now you can open MusicCollection.sln in the msbuild directory and build the software