Chapter 2. Build

[Tip]Tip

The instructions provided in this section are for Linux only. If you intend to build Hydrogen on macOS, check out the corresponding wiki page for tips or guides.

If you want to compile Hydrogen yourself, you can download the latest source files directly from our git repository with

$ git clone git://github.com/hydrogen-music/hydrogen.git
      

A certain release can be fetched with

$ git checkout tags/1.0.0
      

Compiling Hydrogen depends on the following libraries (among others):

Please install them with your distribution's package manager. If you're running a Debian-based system, you can install the libraries with:

$ apt-get install qtbase5-dev qtbase5-dev-tools           \
    qttools5-dev qttools5-dev-tools libqt5xmlpatterns5-dev  \
    libarchive-dev libsndfile1-dev libasound2-dev liblo-dev \
    libpulse-dev libcppunit-dev liblrdf-dev                 \
    liblash-compat-dev librubberband-dev libjack-jackd2-dev

Compiling with cmake can be done easily by using the build.sh script. Go to the directory where the git repository was cloned and run the build.sh script without any arguments to display the help :

$ ./build.sh
        

The help is now displayed (and is self-explanatory) :

   r[m]     => all built, temp and cache files
   c[lean]  => remove cache files
   m[ake]   => launch the build process
   mm       => launch the build process using ccache
   mt       => launch the build process with clang tidy checks enabled
   d[oc]    => build html documentation
   g[raph]  => draw a dependencies graph
   h[elp]   => show the build options
   x|exec   => execute hydrogen
   t[ests]  => execute tests
   p[kg]    => build source package
   z        => build using ccache and run from tree
        

To build Hydrogen and execute the result, run the build script with the m option

$ ./build.sh m x
        

and to install it permanently on your computer, change into the build folder and use the make command.

$ cd build
$ sudo make install
        
[Note]Note

For further details about the installation process please have a look the INSTALL.txt file (located in the top level directory once you downloaded the sources).