source: subsurface/INSTALL @ 4722df80

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

Update install file to build on Fedora 23

Updated packages required to build on Fedora

[Dirk Hohndel: dropped part already fixed earler]

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

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