File: build_linux.md

package info (click to toggle)
mumble 1.5.735-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 90,008 kB
  • sloc: cpp: 556,921; ansic: 81,662; python: 3,606; sh: 659; makefile: 506; asm: 371; cs: 306; sql: 228; javascript: 143; perl: 80; xml: 13
file content (178 lines) | stat: -rw-r--r-- 5,594 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Building on Linux

These are instructions for performing a regular build using the libraries that are shipped with your distribution. For instructions to build a static
version of Mumble, checkout [this file](build_static.md).

## Dependencies

<details>
  <summary><b>Ubuntu</b></summary>
In order to install the needed dependencies on Ubuntu, you have to run the following command (but see notes below the command):
  
```bash
sudo apt install \
  build-essential \
  cmake \
  pkg-config \
  qt5-qmake \
  qtbase5-dev \
  qttools5-dev \
  qttools5-dev-tools \
  libqt5svg5-dev \
  libboost-dev \
  libssl-dev \
  libprotobuf-dev \
  protobuf-compiler \
  libprotoc-dev \
  libcap-dev \
  libxi-dev \
  libasound2-dev \
  libogg-dev \
  libsndfile1-dev \
  libopus-dev \
  libspeechd-dev \
  libavahi-compat-libdnssd-dev \
  libxcb-xinerama0 \
  libzeroc-ice-dev \
  libpoco-dev \
  g++-multilib
```

If your version of Ubuntu is giving errors with `qt5-default`, when running the above command, follow the Debian instructions below.

The dependence on `g++-multilib` only applies if you are on a 64bit system and want to cross-compile overlay support for 32bit applications as well
(which is enabled by default). If you don't do this (`-Doverlay-xcompile=OFF` when invoking cmake), you also don't have to install `g++-multilib`.

You will need `cmake` **v3.15 or later**. If the version shipped by your distribution is not recent enough, you can install a recent one via the
[official PPA](https://apt.kitware.com/) or from the [linked page](https://cmake.org/download/).
</details>

<details>
  <summary><b>Debian (Stable)</b></summary>
In order to install the needed dependencies on Debian, you may
run the following command.

```bash
sudo apt install \
  build-essential \
  cmake \
  pkg-config \
  qtbase5-dev \
  qtchooser \
  qt5-qmake \
  qtbase5-dev-tools \
  qttools5-dev \
  qttools5-dev-tools \
  libqt5svg5-dev \
  libboost-dev \
  libssl-dev \
  libprotobuf-dev \
  protobuf-compiler \
  libprotoc-dev \
  libcap-dev \
  libxi-dev \
  libasound2-dev \
  libogg-dev \
  libsndfile1-dev \
  libspeechd-dev \
  libavahi-compat-libdnssd-dev \
  libxcb-xinerama0 \
  libzeroc-ice-dev \
  libpoco-dev \
  g++-multilib
```

1. There is a problem with Opus, causing crashes on some systems. Disabling the bundled opus version when running cmake might be necessary for now:
   `cmake -Dbundled-opus=OFF ..`
2. Debian has dropped `qt5-default`, so individual packages are chosen instead. This also affects Ubuntu, as documented
   [here](https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5902890.html).)
3. _Also, see Ubuntu notes, which explain some things relevant to Debian builds._

</details>

<details>
  <summary><b>CentOS 8</b></summary>
 In order to install the needed dependencies on Cent OS 8, you have to run the following command:
  
```bash
sudo dnf -y install epel-release
sudo dnf config-manager --set-enabled PowerTools
sudo dnf group install "Development Tools"
sudo dnf install https://zeroc.com/download/ice/3.7/el8/ice-repo-3.7.el8.noarch.rpm
sudo dnf install libice-c++-devel libice3.7-c++
sudo dnf install \
qt5-devel \
qt5-qtsvg-devel  \
openssl-devel \
protobuf-devel \
libsndfile-devel \
libXi-devel \
libXext-devel \
speech-dispatcher-devel \
avahi-compat-libdns_sd-devel \
alsa-lib-devel \
libICE-devel \
libogg-devel \
boost-devel \
libcap-devel \
poco-devel \
gcc-toolset-9-gcc-c++ 
```

You will need `cmake` **v3.15 or later**. You can install a recent one from the [linked page](https://cmake.org/download/).
</details>

<details>
  <summary><b>OpenSUSE Tumbleweed</b></summary>
In order to install the needed dependencies on OpenSUSE Tumbleweed (not Leap),
you have to run the following commands:

```bash
sudo zypper install -t pattern devel_basis devel_qt5
sudo zypper install \
  libopenssl-devel \
  protobuf-devel \
  poco-devel \
  libsndfile-devel \
  libXi-devel \
  libspeechd-devel \
  avahi-compat-mDNSResponder-devel \
  alsa-devel \
  libcap-devel \
  gcc-c++-32bit
```

There is no official package for Ice on OpenSUSE Tumbleweed.
This means you need to generate the files like so:
`cmake -Dice=OFF ..`
</details>

If you are using any other distribution that is not based on one of the distros listed above, you probably have to adapt the commands to your distro manually.

## Running cmake

It is recommended to perform a so-called "out-of-source-build". In order to do so, navigate to the root of the Mumble directory and then issue the
following commands:
1. `mkdir build` (Creates a build directory)
2. `cd build` (Switches into the build directory)
3. `cmake ..` (Actually runs cmake)

This will cause cmake to create the necessary build files for you. If you want to customize your build, you can pass special flags to cmake in step 3.
For all available build options, have a look [here](cmake_options.md).

E.g. if you only want to build the server, use `cmake -Dclient=OFF ..`.


## Building

By default cmake will create Makefiles if run on Linux, so in order to build, you can simply run `make` in the build directory. If you want to
parallelize the build (to speed things up), you can use `make -j $(nproc)`.

If you want to stay independent of the type of the generated build files, you should issue `cmake --build .` (from the build directory) in order to
start the compilation. If you want to parallelize the build, use `cmake --build . -j <jobs>` where `<jobs>` is the amount of parallel jobs to be run
concurrently. A good choice usually is `<jobs> = $(nproc)`.


## FAQ

See the general [build-FAQ](faq.md).