Building

License: GPLv2

You can get the sources to the latest development version from our git repository or you can download Subsurface-4.6.4.tgz from our website.

Subsurface uses a few open source libraries and frameworks to do its job. The most important ones include libdivecomputer, Qt, Marble (more precisely libmarblewidget), libxml2, libxslt, libsqlite3, libzip, libgrantlee5 and libgit2.

Below are instructions for building Subsurface under some popular Linux distributions, for building Subsurface using Homebrew on a Mac, and for cross-building Subsurface for Windows. The lack of a working package management system for Windows makes it really painful to build Subsurface natively under Windows, so we don’t support that at all.

All of the prebuilt binaries that we provide (right now Windows, Mac, Ubuntu/Debian/LinuxMint, and openSUSE/Fedora) are built using our own
custom “flavors” of libdivecomputer and libmarblewidget. You can get these from the Subsurface git server as

git://git.subsurface-divelog.org/marble (in the Subsurface-branch branch)
git://git.subsurface-divelog.org/libdc (in the Subsurface-branch branch)

Subsurface requires Qt5, Qt5.4 or newer is recommended and on the Mac, in order to get native Bluetooth support, Qt5.5 is necessary.

Similarly, in order for our cloud storage to be fully functional you need libgit2 0.23 or newer.

Finally, as of Subsurface 4.5 we have switched our build system to cmake.
qmake based builds are no longer supported.

Build options for Subsurface

With cmake it’s very easy to edit the build options for Subsurface. Once you have gone through the build process explained below you can simply run

ccmake .

in the Subsurface build directory and that will show you the important options and their current settings.

The Makefile that was created using cmake can be forced into a much more verbose mode by calling

make VERBOSE=1

Building Subsurface under Linux

On Fedora you can do

sudo dnf install git gcc-c++ make autoconf automake libtool cmake 
        libzip-devel libxml2-devel libxslt-devel libsqlite3x-devel 
        libgit2-devel libudev-devel libusbx-devel libcurl-devel libssh2-devel 
        qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtscript-devel 
        qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel 
        qt5-qtconnectivity-devel qt5-qtlocation-devel

Package names are sadly different on OpenSUSE

sudo zypper install git gcc-c++ make autoconf automake libtool cmake libzip-devel 
        libxml2-devel libxslt-devel sqlite3-devel libgit2-devel libusb-1_0-devel 
        libqt5-linguist-devel libqt5-qttools-devel libQt5WebKitWidgets-devel 
        libqt5-qtbase-devel libQt5WebKit5-devel libqt5-qtsvg-devel 
        libqt5-qtscript-devel libqt5-qtdeclarative-devel 
        libqt5-qtconnectivity-devel libqt5-qtlocation-devel

On Debian, Ubuntu, and Linux Mint this seems to work (however, on recent Debian and Ubuntu you can omit the libqt5declarative5, if it is not found)

sudo apt-get install git g++ make autoconf libtool cmake pkg-config 
        libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev 
        automake libusb-1.0-0-dev libgit2-dev libssl-dev 
        qt5-default qt5-qmake qtchooser qttools5-dev-tools libqt5svg5-dev 
        libqt5webkit5-dev libqt5qml5 libqt5quick5 libqt5declarative5 
        qtscript5-dev libssh2-1-dev qttools5-dev 
        qtpositioning5-dev qtconnectivity5-dev

In order to build Subsurface, use the supplied build script. This should work on most systems that have all the prerequisite packages installed. Start by checking out the Subsurface sources in a sane place, something like this:

mkdir -p ~/src
cd ~/src
git clone  git://github.com/Subsurface-divelog/subsurface
cd subsurface
git checkout v4.6.4
cd ..
./subsurface/scripts/build.sh 

Now you can run Subsurface like this:

cd ~/src/subsurface/build
./subsurface

Building Subsurface under MacOS X

0) You need to have XCode installed. The first time (and possibly after updating OSX) you need to run

xcode-select --install

1) Install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2) Install needed dependencies

brew install automake autoconf libtool asciidoc libzip sqlite cmake libusb libssh2 pkg-config hidapi

3) Make the brew version of sqlite the default

brew link --force sqlite

4) Download Qt from http://www.qt.io/download-open-source/
In the installer, chose an install folder (e.g., /home/username/Qt), in “Select components” select the most recent version and unselect the Android and IOS packages as well as QtWebEngine, Qt3D, Qt Canvas 3D and the Qt Extras.
5) run the build script

cd ~/src
bash subsurface/scripts/build.sh

After the above is done, Subsurface.app will be available in the subsurface/build directory. You can run Subsurface with the command

open subsurface/build/Subsurface.app

or you can move this folder to /Applications to install Subsurface for every user.

Subsurface Companion App on Android

This is NOT Subsurface-mobile (which is built from the main repository above). This is an older app that is just used to track GPS locations for dive sites.

This application is available in the Google Play Store. It is also under GPLv2 and sources are at git://subsurface-divelog.org/subsurface-companion.git