Installing Survex on Unix
=========================

If you are using Debian Linux or Ubuntu Linux or a distribution based
on one of these, you will find it easier to install one of the
prepackaged versions of Survex.

Otherwise you'll need to build from source.  These instructions assume you're
building from released tar archive - if you want to build from by checking out
code from the git repository then you'll need additional tools installed,
documented at: https://survex.com/cvs.html

First of all, you need to make sure you have the required libraries installed.
Where possible it's usually easier to install these using your Linux
distribution's package manager.

Note that C/C++ library packages are usually split into runtime and
development, usually with similar names but with a -dev or -devel or similar
suffix on the development one.  You'll need both installed to build Survex,
but typically installing the development package will automatically install
the corresponding runtime package too.

* The main dependency is wxWidgets 3.2 or later - if there's a suitable
  wxWidgets package for your platform, then just use that.

  Otherwise download the source code from https://wxwidgets.org/ and
  follow their build instructions.  IMPORTANT: You must enable OpenGL
  support by adding --with-opengl to the configure command line.

  The last release to support wxWidgets 3.0 was Survex 1.4.17.

* You'll also need a working C and C++ compiler (with support for C99 and
  C++11), and also the OpenGL development libraries if these aren't pulled in
  by installing wxWidgets.

* Version 7.2.0 or later of the PROJ library is needed for coordinate
  conversion functionality.

* Optionally, GDAL is used to support reading geodata files.  If not available
  this feature is disabled.

* Optionally, FFmpeg is used if available to implement Aven's movie export
  feature.  You need libavcodec >= 57, which seems to correspond to FFmpeg
  >= 3.2.

Then at a shell prompt, unpack the source code, cd into the directory, and
enter the following commands:

./configure
make
make install

By default 'make install' will try to install Survex under /usr/local,
which means you'll probably need to become root for the 'make install' stage.
If you use sudo to manage root access, then:

sudo make install

You can tell configure to install Survex elsewhere (e.g. under your home
directory) like so:

./configure --prefix=/home/olly/survex
make
make install

If your wxWidgets installation isn't picked up automatically, or you
have more than one version installed and want to select a particular
one, then you can specify this like so:

./configure WX_CONFIG=/opt/bin/wx-config

You can use both --prefix and WX_CONFIG= if necessary.
