source: subsurface/INSTALL @ e46f6a5

Mtestandroid_testdcDownloadforatdotdegitMergeiosmergeKirigamiPortpictimeshiftresolutionIndependencespinnertestTomaztestingv4.5-branch
Last change on this file since e46f6a5 was e46f6a5, checked in by Dirk Hohndel <dirk@…>, 2 years ago

INSTALL file: add the required packages for QtBluetooth?

Signed-off-by: Dirk Hohndel <dirk@…>

  • Property mode set to 100644
File size: 11.1 KB
Line 
1Building Subsurface from Source
2===============================
3
4Subsurface uses a few open source libraries and frameworks to do its
5job. The most important ones include libdivecomputer, Qt, Marble
6(more precisely libmarblewidget), libxml2, libxslt, libsqlite3, libzip,
7and libgit2.
8
9Below are instructions for building Subsurface under some popular
10Linux distributions, for building Subsurface using Homebrew on a Mac,
11and for cross-building Subsurface for Windows. The lack of a working
12package management system for Windows makes it really painful to build
13Subsurface natively under Windows, so we don't support that at all.
14
15All of the prebuilt binaries that we provide (right now Windows, Mac,
16Ubuntu/Debian/LinuxMint, and openSUSE/Fedora) are built using our own
17custom "flavors" of libdivecomputer and libmarblewidget. You can get
18these from
19
20git://git.subsurface-divelog.org/marble (in the Subsurface-4.4 branch)
21git://git.subsurface-divelog.org/libdc (in the Subsurface-4.4 branch)
22
23Both of these repositories also have a Subsurface-testing branch. That
24branch is explicitly marked as NOT STABLE and will receive force pushes.
25The rationale for this is that we have no intention of forking either of
26these two projects. We simply are adding a few patches on top of their
27latest versions and so those testing branches get frequently rebased.
28
29Also, all of the prebuilt binaries are now Qt5 based and Qt5 is considered
30the stable and supported framework to use for building Subsurface. As of
31Subsurface 4.5 we are switching our build system to cmake. qmake based
32builds are no longer supported.
33
34Build options for Subsurface
35----------------------------
36
37The following options are recognized when passed to cmake:
38
39 -DCMAKE_BUILD_TYPE=Release     create a release build
40 -DCMAKE_BUILD_TYPE=Debug       create a debug build
41
42The Makefile that was created using cmake can be forced into a much more
43verbose mode by calling
44
45 make VERBOSE=1
46
47Building Subsurface 4 under Linux
48---------------------------------
49
50On Fedora you need
51
52sudo yum install git gcc-c++ make autoconf automake libtool cmake \
53        libzip-devel libxml2-devel libxslt-devel libsqlite3x-devel \
54        libgit2-devel libudev-devel libusbx-devel \
55        qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtscript-devel \
56        qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel \
57        qt5-qtconnectivity-devel
58
59Note that beginning with Fedora 22, you should be using the dnf command instead
60as yum is being deprecated.
61
62Package names are sadly different on OpenSUSE
63
64sudo zypper install git gcc-c++ make autoconf automake libtool cmake libzip-devel \
65        libxml2-devel libxslt-devel sqlite3-devel libgit2-devel libusb-1_0-devel \
66        libqt5-linguist-devel libqt5-qttools-devel libQt5WebKitWidgets-devel \
67        libqt5-qtbase-devel libQt5WebKit5-devel libqt5-qtsvg-devel \
68        libqt5-qtscript-devel libqt5-qtdeclarative-devel \
69        libqt5-qtconnectivity-devel
70
71On Debian Jessie and recent Ubuntu flavors this seems to work
72
73sudo apt-get install git g++ make autoconf libtool cmake pkg-config \
74        libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev \
75        libusb-1.0-0-dev libgit2-dev \
76        qt5-default qt5-qmake qtchooser qttools5-dev-tools libqt5svg5-dev \
77        libqt5webkit5-dev libqt5qml5 libqt5quick5 libqt5declarative5 \
78        qtscript5-dev libssh2-1-dev libcurl4-openssl-dev qttools5-dev \
79        qtconnectivity5-dev
80
81On PCLinuxOS you appear to need the following packages
82
83su -c "apt-get install -y autoconf automake cmake libtool gcc-c++ git \
84lib64usb1.0-devel lib64zip-devel lib64qt5webkitwidgets-devel qttools5 \
85qttranslations5 lib64qt5xml-devel lib64qt5test-devel lib64qtscript-devel \
86lib64qt5svg-devel lib64qt5concurrent-devel lib64qt5bluetooth-devel"
87
88In order to build Subsurface, use the supplied build script. This should
89work on most systems that have all the prerequisite packages installed.
90
91You should have Subsurface sources checked out in a sane place, something
92like this:
93
94mkdir -p ~/src
95cd ~/src
96git clone -b v4.4.2 git://subsurface-divelog.org/subsurface
97./subsurface/scripts/build.sh # <- this step will take quite a while as it
98                              #    compiles a handful of libraries before
99                              #    building Subsurface
100
101Now you can run Subsurface like this:
102
103cd ~/src
104install-root/bin/subsurface
105
106
107Note: on many Linux versions (for example on Kubuntu 15.04) the user must
108belong to the dialout group.
109
110You may need to run something like
111
112sudo usermod -a -G dialout username
113
114with your correct username and log out and log in again for that to take
115effect.
116
117If you get errors like:
118
119install-root/bin/subsurface: error while loading shared libraries: libGrantlee_Templates.so.5: cannot open shared object file: No such file or directory
120
121You can run the following command:
122
123sudo ldconfig ~/src/install-root/lib
124
125
126Building Subsurface under MacOSX (using Homebrew)
127-------------------------------------------------
128
1290) You need to have XCode installed. The first time (and possibly after updating OSX)
130you need to run
131
132$ xcode-select --install
133
1341)  Install Homebrew
135
136$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
137
1382) Install needed dependencies
139
140$ brew install asciidoc libzip sqlite cmake libusb pkg-config
141
1423) Make the brew version of sqlite the default
143
144$ brew link --force sqlite
145
1464) Download Qt from http://www.qt.io/download-open-source/
147
148In the installer, chose an install folder (e.g., /home/username/Qt5), in
149"Select components" select the most recent version and be sure you also
150install the "Source Components".
151
152Build it (takes a long time)
153
154$ cd ~/Qt5/5.4/Src/
155
156$ ./configure -prefix /usr/local -opensource
157
158$ make -j4
159
160$ make install
161
1625) Install custom subsurface Marble
163
164$ cd ~/src
165$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/marble marble-source
166$ cd marble-source
167$ mkdir marble-build
168$ cd marble-build
169$ cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE \
170        -DQT5BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr/local ../../marble-source
171$ cd src/lib/marble
172$ make -j4
173$ make install
174
1755) Install Libdivecomputer
176
177$ brew install automake libtool
178$ cd ~/src
179$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/libdc libdivecomputer
180       # -> when not building a release version of Subsurface but the
181       #    latest master, it may be necessary to build against the
182       #    Subsurface-testing branch
183$ cd libdivecomputer
184$ autoreconf --install
185$ ./configure --disable-shared
186$ make -j4
187$ make install
188
189
1906) Compile Subsurface
191
192$ cd ~/src
193$ git clone git://subsurface-divelog.org/subsurface.git
194$ cd subsurface
195$ mkdir build
196$ cd build
197$ cmake -DCMAKE_BUILD_TYPE=Release ..
198$ make -j4
199$ make install
200
201After the above is done, Subsurface.app will be available in the
202subsurface/build/staging directory. This folder can then be moved
203to /Applications install Subsurface for every user.
204
205
206
207Cross-building Subsurface on Linux for Windows
208----------------------------------------------
209
210Subsurface builds nicely with MinGW - the official builds are done as
211cross builds under Linux (currently on Fedora 20). A shell script to do
212that (plus the .nsi file to create the installer with makensis) are
213included in the packaging/windows directory.
214
215On OpenSUSE, for mingw64 packages you should add the specific
216repository from their site. After that you can run the following
217command:
218sudo zypper install mingw64-cross-libqt5-qttools mingw64-mpc-devel \
219      mingw64-filesystem mingw64-pkg-config mingw64-cross-gcc \
220      mingw64-gcc-c++ mingw64-libusb-1_0-devel \
221      mingw64-cross-libqt5-qttools mingw64-libqt5-qtwebkit \
222      mingw64-libqt5-qtwebkit-devel mingw64-cross-libqt5-qmake \
223      mingw64-libqt5-qtscript mingw64-libqt5-qtscript-devel \
224      mingw64-libqt5-qtsvg mingw64-libqt5-qtsvg-devel \
225      mingw64-libqt5-qtdeclarative mingw64-libqt5-qtdeclarative-devel \
226      mingw64-libssh2-devel mingw64-libzip-devel \
227      mingw64-sqlite-devel mingw64-win_iconv-devel \
228      mingw64-libxslt-devel mingw64-libqt5-qttools
229
230[Observation] - Sometimes on OpenSUSE platform there is a problem with
231the mingw64-libzip-devel package(the zipconf header is not installed in
232the right place) and you have to create a symbolic link using the following
233command:
234  sudo ln -s /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libzip/include/zipconf.h \
235             /usr/x86_64-w64-mingw32/sys-root/mingw/include/zipconf.h
236
237Everywhere below the mingw64- prefix is used for the cross tools. If you
238really need a 32bit binary you need to use mingw32- as prefix and you may
239also run into issues creating an installable binary with Qt5 (i.e., you
240may have to go back to Qt4).
241
242The best way to get libdivecomputer to build appears to be
243
244$ mkdir -p ~/src
245$ cd ~/src
246$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/libdc libdivecomputer
247       # or -b Subsurface-testing to get the testing version - careful,
248       #                          careful - this gets rebased and may be broken
249       # -> when not building a release version of Subsurface but the
250       #    latest master, it may be necessary to build against the
251       #    Subsurface-testing branch
252
253$ cd libdivecomputer
254$ autoreconf --install
255$ mingw64-configure --disable-shared
256$ mingw64-make
257$ sudo mingw64-make install
258
259To compile Marble, use:
260
261$ cd ~/src
262$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/marble marble-source
263       # or -b Subsurface-testing to get the testing version - careful,
264       #                          careful - this gets rebased and may be broken
265
266$ mkdir marble-build
267$ cd marble-build
268$ mingw64-cmake -DQTONLY=ON -DQT5BUILD=ON \
269        -DBUILD_MARBLE_APPS=OFF -DBUILD_MARBLE_EXAMPLES=OFF \
270        -DBUILD_MARBLE_TESTS=OFF -DBUILD_MARBLE_TOOLS=OFF \
271        -DBUILD_TESTING=OFF -DWITH_DESIGNER_PLUGIN=OFF \
272        -DBUILD_WITH_DBUS=OFF ../marble-source
273$ mingw64-make # <- this step will take quite a while... if you have more cores
274               #    try ming64-make -j8 or something like that
275$ sudo mingw64-make install
276
277
278To compile libgit2, use:
279
280$ git clone git://github.com/libgit2/libgit2 ~/src/libgit2
281$ mkdir ~/src/libgit2/build
282$ cd ~/src/libgit2
283$ git checkout v0.21.5
284$ cd build
285$ mingw64-cmake ..
286$ mingw64-make
287$ sudo mingw64-make install
288
289To compile Subsurface, use:
290
291$ cd ~/src
292$ git clone git://subsurface-divelog.org/subsurface.git
293$ cd subsurface
294$ cd git checkout v4.4.2   # this get's you the last release
295                         # skip this step to build the latest development
296                         # version
297$ packagin/windows/mingw-make.sh Qt5 SPECIAL_MARBLE_PREFIX=1
298$ packaging/windows/mingw-make.sh install
299$ packaging/windows/mingw-make.sh installer
300
301The last step assumes that you have a link from packaging/windows/dll to
302the correct directory in your MinGW installation. On my machine that is
303/usr/i686-w64-mingw64/sys-root/mingw/bin
304Similarly, the paths used in packaging/windows/mingw-make.sh may need to
305be adjusted according to your distributions layout
306
307Also, at least one version of Qt DLLs shipping with Fedora was
308self-inconsistent at caused random crashes at startup. Unless you have
309good reasons to build your own binaries, on Windows you may be better off
310with the pre-compiled binaries we provide.
311
312
313Building Subsurface on Windows
314------------------------------
315
316This is NOT RECOMMENDED. To the best of our knowledge there is one single
317person who regularly does this. The Subsurface team does not provide support
318for Windows binary build from sources...
Note: See TracBrowser for help on using the repository browser.