source: subsurface/INSTALL

Last change on this file was 024b61c, checked in by Dirk Hohndel <dirk@…>, 3 weeks ago

update INSTALL and Readme.ubuntu to exclude Marble

Remove Marble mentions from said files.

Signed-off-by: Lubomir I. Ivanov <neolit123@…>

  • Property mode set to 100644
File size: 9.1 KB
Line 
1Building Subsurface from Source
2===============================
3
4Subsurface uses quite a few open source libraries and frameworks to do its
5job. The most important ones include libdivecomputer, Qt, libxml2, libxslt,
6libsqlite3, libzip, libgrantlee5 and libgit2.
7
8Below are instructions for building Subsurface under some popular
9Linux distributions, for building Subsurface using Homebrew on a Mac,
10and for cross-building Subsurface for Windows. The lack of a working
11package management system for Windows makes it really painful to build
12Subsurface natively under Windows, so we don't support that at all.
13
14All of the prebuilt binaries that we provide (right now Windows, Mac,
15Ubuntu/Debian/LinuxMint, and openSUSE/Fedora) are built using our own
16custom "flavors" of libdivecomputer. You can get these from
17
18git://git.subsurface-divelog.org/libdc (in the Subsurface-branch branch)
19
20Those branches won't have a pretty history and will include ugly merges,
21but they should always allow a fast forward pull that tracks what we believe
22developers should build against.
23
24In contrast to that both repositories also have Subsurface-clean branches.
25These should allow distros to see which patches we have applied on top of
26upstream. They will receive force pushes as we rebase to newer versions of
27upstream so they are not ideal for ongoing development (but they are of
28course easy to use for distributions as they always build "from scratch",
29anyway).
30
31The rationale for this is that we have no intention of forking either of
32these two projects. We simply are adding a few patches on top of their
33latest versions and want to do so in a manner that is both easy for our
34developers who try to keep them updated frequently, and anyone packaging
35Subsurface or trying to understand what we have done relative to their
36respective upstreams.
37
38At this point Qt5 is required, Qt5.4 or newer is recommended and on the
39Mac, in order to get native Bluetooth support, Qt5.5 is necessary.
40
41Similarly, in order for our cloud storage to be fully functional you need
42libgit2 0.23 or newer.
43
44Finally, as of Subsurface 4.5 we have switched our build system to cmake.
45qmake based builds are no longer supported.
46
47Build options for Subsurface
48----------------------------
49
50The following options are recognized when passed to cmake:
51
52 -DCMAKE_BUILD_TYPE=Release     create a release build
53 -DCMAKE_BUILD_TYPE=Debug       create a debug build
54
55The Makefile that was created using cmake can be forced into a much more
56verbose mode by calling
57
58 make VERBOSE=1
59
60Many more variables are support, the easiest way to interact with them is
61to call
62
63 ccmake .
64
65in your build directory.
66
67
68Building the development version of Subsurface under Linux
69----------------------------------------------------------
70
71On Fedora you need
72
73sudo yum install git gcc-c++ make autoconf automake libtool cmake \
74        libzip-devel libxml2-devel libxslt-devel libsqlite3x-devel \
75        libudev-devel libusbx-devel libcurl-devel libssh2-devel\
76        qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtscript-devel \
77        qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel \
78        qt5-qtconnectivity-devel qt5-qtlocation-devel
79
80Note that beginning with Fedora 22, you should be using the dnf command instead
81as yum is being deprecated.
82
83Package names are sadly different on OpenSUSE
84
85sudo zypper install git gcc-c++ make autoconf automake libtool cmake libzip-devel \
86        libxml2-devel libxslt-devel sqlite3-devel libusb-1_0-devel \
87        libqt5-linguist-devel libqt5-qttools-devel libQt5WebKitWidgets-devel \
88        libqt5-qtbase-devel libQt5WebKit5-devel libqt5-qtsvg-devel \
89        libqt5-qtscript-devel libqt5-qtdeclarative-devel \
90        libqt5-qtconnectivity-devel libqt5-qtlocation-devel libcurl-devel
91
92On Debian Stretch this seems to work
93
94sudo apt-get install git g++ make autoconf automake libtool cmake pkg-config \
95        libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev \
96        libusb-1.0-0-dev libssl-dev \
97        qt5-default qt5-qmake qtchooser qttools5-dev-tools libqt5svg5-dev \
98        libqt5webkit5-dev libqt5qml5 libqt5quick5 libqt5declarative5 \
99        qtscript5-dev libssh2-1-dev libcurl4-openssl-dev qttools5-dev \
100        qtconnectivity5-dev qtlocation5-dev qtpositioning5-dev \
101        libcrypto++-dev libssl-dev qml-module-qtpositioning qml-module-qtlocation
102
103Package names for Ubuntu 16.10
104
105sudo apt-get install git g++ make autoconf automake libtool cmake pkg-config \
106        libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev \
107        libusb-1.0-0-dev libssl-dev \
108        qt5-default qt5-qmake qtchooser qttools5-dev-tools libqt5svg5-dev \
109        libqt5webkit5-dev libqt5qml5 libqt5quick5 qtdeclarative5-dev \
110        qtscript5-dev libssh2-1-dev libcurl4-openssl-dev qttools5-dev \
111        qtconnectivity5-dev qtlocation5-dev qtpositioning5-dev \
112        libcrypto++-dev libssl-dev qml-module-qtpositioning qml-module-qtlocation
113
114On PCLinuxOS you appear to need the following packages
115
116su -c "apt-get install -y autoconf automake cmake libtool gcc-c++ git \
117lib64usb1.0-devel lib64zip-devel lib64qt5webkitwidgets-devel qttools5 \
118qttranslations5 lib64qt5xml-devel lib64qt5test-devel lib64qtscript-devel \
119lib64qt5svg-devel lib64qt5concurrent-devel lib64qt5bluetooth-devel"
120
121In order to build Subsurface, use the supplied build script. This should
122work on most systems that have all the prerequisite packages installed.
123
124You should have Subsurface sources checked out in a sane place, something
125like this:
126
127mkdir -p ~/src
128cd ~/src
129git clone https://github.com/Subsurface-divelog/subsurface.git
130./subsurface/scripts/build.sh # <- this step will take quite a while as it
131                              #    compiles a handful of libraries before
132                              #    building Subsurface
133
134Now you can run Subsurface like this:
135
136cd ~/src/subsurface/build
137./subsurface
138
139
140Note: on many Linux versions (for example on Kubuntu 15.04) the user must
141belong to the dialout group.
142
143You may need to run something like
144
145sudo usermod -a -G dialout username
146
147with your correct username and log out and log in again for that to take
148effect.
149
150If you get errors like:
151
152./subsurface: error while loading shared libraries: libGrantlee_Templates.so.5: cannot open shared object file: No such file or directory
153
154You can run the following command:
155
156sudo ldconfig ~/src/install-root/lib
157
158
159Building Subsurface under MacOSX (using Homebrew)
160-------------------------------------------------
161
1620) You need to have XCode installed. The first time (and possibly after updating OSX)
163you need to run
164
165$ xcode-select --install
166
1671)  Install Homebrew
168
169$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
170
1712) Install needed dependencies
172
173$ brew install asciidoc libzip sqlite cmake libusb pkg-config automake libtool hidapi libxml2 curl openssl libssh2
174
1753) Make the brew version of sqlite the default
176
177$ brew link --force sqlite
178
1794) Download and install Qt
180
181You can build Qt from source or use the prebuilt binaries for Mac. Start
182by downloading the online installer:
183
184$ curl -L -o ~/Downloads/qt-unified-mac-x64-online.dmg \
185        http://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg
186$ open ~/Downloads/qt-unified-mac-x64-online.dmg
187
188Double click on the Qt installer shown in the Finder window.
189
190In the installer, chose an install folder (the build script we are using
191below assumes that you accept the default of /home/<your username>/Qt), in
192"Select components" select the most recent version and (if you want to
193build Qt from source) be sure you also install the "Source Components".
194To save time and disk space you can unselect Android and IOS packages
195as well as QtWebEngine, Qt3D, Qt Canvas 3D and the Qt Extras.
196
197If you want to build from source (which takes a very long time and a lot of disk)
198
199$ cd ~/Qt/5.5/Src/
200
201$ ./configure -prefix /usr/local -opensource
202
203$ make -j4
204
205$ make install
206
2075) run the build script
208
209cd ~/src
210bash subsurface/scripts/build.sh
211
212After the above is done, Subsurface.app will be available in the
213subsurface/build directory. You can run Subsurface with the command
214
215$ open subsurface/build/Subsurface.app
216
217or you can move this folder to /Applications to install Subsurface for
218every user.
219
220
221Cross-building Subsurface on Linux for Windows
222----------------------------------------------
223
224Subsurface builds nicely with MinGW - the official builds are done as
225cross builds under Linux (currently on Ubuntu 14.04). A shell script to do
226that (plus the .nsi file to create the installer with makensis) are
227included in the packaging/windows directory.
228
229Please read through the explanations and instructions in
230packaging/windows/mxe-based-build.sh if you want to build the Windows
231version on your Linux system.
232
233
234Building Subsurface on Windows
235------------------------------
236
237This is NOT RECOMMENDED. To the best of our knowledge there is one single
238person who regularly does this. The Subsurface team does not provide support
239for Windows binary build from sources natively under Windows...
240
241
242Building Subsurface for Android
243-------------------------------
244
245To compile the mobile version you will need:
246
247-Qt for Android (this can be downloaded from: http://www.qt.io/download-open-source/)
248-Android SDK
249-Android NDK
250
251In the packaging/android folder, open the build.sh file and add the paths to the SDK,
252NDK and Qt for android at the top.
253
254After that, you can run: ./subsurface/packaging/android/build.sh
255
256This will generate an apk file in ./subsurface-mobile-build-arm/bin
Note: See TracBrowser for help on using the repository browser.