source: subsurface/INSTALL @ be6a9ac

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

Minor fixes to the INSTALL-file

  • Add needed qt5-qtlocation-devel package for Fedora install
  • Correct the call to subsurface binary after compilation]

Signed-off-by: Paul-Erik Törrönen <poltsi@…>
Signed-off-by: Dirk Hohndel <dirk@…>

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