source: subsurface/INSTALL @ 25d2f18

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

INSTALL: remove the detailed install instructions

It's much easier to just keep the build.sh script working and ask people
to use that instead of all the confusion with the detailed instructions.

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

  • Property mode set to 100644
File size: 10.6 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
36Build options for Subsurface
37----------------------------
38
39The following options are recognized when passed to qmake:
40
41 -config debug        Create a debug build
42 -config release      Create a release build
43                      The default depends on how Qt was built.
44 V=1                  Disable the "silent" build mode
45 LIBDCDEVEL=1         Search for libdivecomputer in ../libdivecomputer
46 LIBMARBLEDEVEL=path  Search for marble library and includes in path
47 SPECIAL_MARBLE_PREFIX=1 Use libssrfmarblewidget as library name
48                      This is needed when building with our marble branch
49 LIBGIT2DEVEL=path    Search for libgit2 library and includes in path
50 INCLUDEPATH+=xxx     Add xxx to the include paths to the compiler
51                      (pass the actual path, without -I)
52 LIBS+=xxx            Add xxx to the linker flags. -l and -L options are
53                      recognized.
54 DEFINES+=SHOW_PLOT_INFO_TABLE=1
55                      Only available in debug builds, this creates a
56                      second window that shows all elements in the
57                      plot_info structure as a table - very useful when
58                      debugging issues with the profile
59
60The INCLUDEPATH and LIBS options are useful to tell the buildsystem
61about non-standard installation paths for the dependencies (such as
62Marble). They can be repeated as often as needed, or multiple
63arguments can be passed on the same switch, separated by a space. For
64example:
65
66  qmake LIBS+="-L$HOME/marble/lib -L$HOME/libdivecomputer/lib" \
67        INCLUDEPATH+="$HOME/marble/include $HOME/libdivecomputer/include"
68
69
70Building Subsurface 4 under Linux
71---------------------------------
72
73On Fedora you need
74
75sudo yum install git gcc-c++ make autoconf automake libtool cmake \
76        libzip-devel libxml2-devel libxslt-devel libsqlite3x-devel \
77        libgit2-devel libudev-devel libusbx-devel \
78        qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtscript-devel \
79        qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel
80
81Package names are sadly different on OpenSUSE
82
83sudo zypper install git gcc-c++ make autoconf automake libtool cmake libzip-devel \
84        libxml2-devel libxslt-devel sqlite3-devel libgit2-devel libusb-1_0-devel \
85        libqt5-linguist-devel libqt5-qttools-devel libQt5WebKitWidgets-devel \
86        libqt5-qtbase-devel libQt5WebKit5-devel libqt5-qtsvg-devel \
87        libqt5-qtscript-devel libqt5-qtdeclarative-devel
88
89On Debian Jessie this seems to work
90
91sudo apt-get install git g++ make autoconf libtool cmake pkg-config \
92        libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev \
93        libusb-1.0-0-dev libgit2-dev \
94        qt5-default qt5-qmake qtchooser qttools5-dev-tools libqt5svg5-dev \
95        libqt5webkit5-dev libqt5qml5 libqt5quick5 libqt5declarative5 \
96        qtscript5-dev
97
98On PCLinuxOS you appear to need the following packages
99
100su -c "apt-get install -y autoconf automake cmake libtool gcc-c++ git \
101lib64usb1.0-devel lib64zip-devel lib64qt5webkitwidgets-devel qttools5 \
102qttranslations5 lib64qt5xml-devel lib64qt5test-devel lib64qtscript-devel \
103lib64qt5svg-devel lib64qt5concurrent-devel"
104
105In order to build Subsurface, use the supplied build script. This should
106work on most systems that have all the prerequisite packages installed...
107
108You should have Subsurface sources checked out in a sane place, something
109like this:
110
111mkdir -p ~/src
112cd ~/src
113git clone -b v4.4.1 git://subsurface-divelog.org/subsurface
114./subsurface/scripts/build.sh # <- this step will take quite a while as it
115                              #    compiles a handful of libraries before
116                              #    building Subsurface
117
118Now you can run Subsurface like this:
119
120cd ~/src/subsurface
121./subsurface
122
123
124Building Subsurface under MacOSX (using Homebrew)
125-------------------------------------------------
126
1270) You need to have XCode installed. The first time (and possibly after updating OSX)
128you need to run
129
130$ xcode-select --install
131
1321)  Install Homebrew
133
134$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
135
1362) Install needed dependencies
137
138$ brew install asciidoc libzip sqlite cmake libusb pkg-config
139
1403) Make the brew version of sqlite the default
141
142$ brew link --force sqlite
143
1444) Download Qt from http://www.qt.io/download-open-source/
145
146In the installer, chose an install folder (e.g., /home/username/Qt5), in
147"Select components" select the most recent version and be sure you also
148install the "Source Components".
149
150Build it (takes a long time)
151
152$ cd ~/Qt5/5.4/Src/
153
154$ ./configure -prefix /usr/local -opensource
155
156$ make -j4
157
158$ make install
159
1605) Install custom subsurface Marble
161
162$ cd ~/src
163$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/marble marble-source
164$ cd marble-source
165$ mkdir marble-build
166$ cd marble-build
167$ cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=TRUE \
168        -DQT5BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr/local ../../marble-source
169$ cd src/lib/marble
170$ make -j4
171$ make install
172
1735) Install Libdivecomputer
174
175$ brew install automake libtool
176$ cd ~/src
177$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/libdc libdivecomputer
178       # -> when not building a release version of Subsurface but the
179       #    latest master, it may be necessary to build against the
180       #    Subsurface-testing branch
181$ cd libdivecomputer
182$ autoreconf --install
183$ ./configure --disable-shared
184$ make -j4
185$ make install
186
187
1886) Compile Subsurface
189
190$ cd ~/src
191$ git clone git://subsurface-divelog.org/subsurface.git
192$ cd subsurface
193$ qmake SPECIAL_MARBLE_PREFIX=1 INCLUDEPATH+=/usr/local/include \
194        LIBS+=-L/usr/local/lib \
195        LIBS+='-L/usr/local/Cellar/libzip/0.11.2/lib -lzip -lz' \
196        INCLUDEPATH+=/usr/local/Cellar/libzip/0.11.2/include V=1 \
197        LIBMARBLEDEVEL=../marble-source/marble-build/
198$ make -j4
199$ make install_mac_bundle
200
201After the above is done, Subsurface will be installed to /Applications.
202
203Another option is to create a .dmg for distribution:
204
205$ qmake
206$ make
207$ make mac-create-dmg
208
209
210Cross-building Subsurface on Linux for Windows
211----------------------------------------------
212
213Subsurface builds nicely with MinGW - the official builds are done as
214cross builds under Linux (currently on Fedora 20). A shell script to do
215that (plus the .nsi file to create the installer with makensis) are
216included in the packaging/windows directory.
217
218Everywhere below the mingw64- prefix is used for the cross tools. If you
219really need a 32bit binary you need to use mingw32- as prefix and you may
220also run into issues creating an installable binary with Qt5 (i.e., you
221may have to go back to Qt4).
222
223The best way to get libdivecomputer to build appears to be
224
225$ mkdir -p ~/src
226$ cd ~/src
227$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/libdc libdivecomputer
228       # or -b Subsurface-testing to get the testing version - careful,
229       #                          careful - this gets rebased and may be broken
230       # -> when not building a release version of Subsurface but the
231       #    latest master, it may be necessary to build against the
232       #    Subsurface-testing branch
233
234$ cd libdivecomputer
235$ autoreconf --install
236$ mingw64-configure --disable-shared
237$ mingw64-make
238$ sudo mingw64-make install
239
240To compile Marble, use:
241
242$ cd ~/src
243$ git clone -b Subsurface-4.4 git://subsurface-divelog.org/marble marble-source
244       # or -b Subsurface-testing to get the testing version - careful,
245       #                          careful - this gets rebased and may be broken
246
247$ mkdir marble-build
248$ cd marble-build
249$ mingw64-cmake -DQTONLY=ON -DQT5BUILD=ON \
250        -DBUILD_MARBLE_APPS=OFF -DBUILD_MARBLE_EXAMPLES=OFF \
251        -DBUILD_MARBLE_TESTS=OFF -DBUILD_MARBLE_TOOLS=OFF \
252        -DBUILD_TESTING=OFF -DWITH_DESIGNER_PLUGIN=OFF \
253        -DBUILD_WITH_DBUS=OFF ../marble-source
254$ mingw64-make # <- this step will take quite a while... if you have more cores
255               #    try ming64-make -j8 or something like that
256$ sudo mingw64-make install
257
258
259To compile libgit2, use:
260
261$ mkdir -p ~/src/libgit2/build
262$ git clone git://github.com/libgit2/libgit2 ~/src/libgit2
263$ cd ~/src/libgit2/build
264$ mingw64-cmake ..
265$ mingw64-make
266$ sudo mingw64-make install
267
268To compile Subsurface, use:
269
270$ cd ~/src
271$ git clone git://subsurface-divelog.org/subsurface.git
272$ cd subsurface
273$ cd git checkout v4.4   # this get's you the last release
274                         # skip this step to build the latest development
275                         # version
276$ packagin/windows/mingw-make.sh Qt5 SPECIAL_MARBLE_PREFIX=1
277$ packaging/windows/mingw-make.sh install
278$ packaging/windows/mingw-make.sh installer
279
280The last step assumes that you have a link from packaging/windows/dll to
281the correct directory in your MinGW installation. On my machine that is
282/usr/i686-w64-mingw64/sys-root/mingw/bin
283Similarly, the paths used in packaging/windows/mingw-make.sh may need to
284be adjusted according to your distributions layout
285
286Also, at least one version of Qt DLLs shipping with Fedora was
287self-inconsistent at caused random crashes at startup. Unless you have
288good reasons to build your own binaries, on Windows you may be better off
289with the pre-compiled binaries we provide.
290
291
292Building Subsurface on Windows
293------------------------------
294
295This is NOT RECOMMENDED. To the best of our knowledge there is one single
296person who regularly does this. The Subsurface team does not provide support
297for Windows binary build from sources...
Note: See TracBrowser for help on using the repository browser.