
Chapter 3. Installing the tools
The Güralp Systems Linux tools are managed by guralp-builder. This is a simple framework which can download, build and install all of the tools and the libraries they require. It also keeps track of dependencies between versions.
guralp-builder can be downloaded from our Web site at
http://www.guralp.com/software/tools/guralp-builder/guralp-builder-20071117.tar.bz2
The scripts require the standard Web downloading utility, wget, to fetch source code from the Güralp Systems repository.
3.1 Prerequisites
Your system must be set up for development or compilation (i.e. development tools such as gcc must be installed). The “Bourne again” shell, bash, is also required.
Several of the programs require other open-source packages. If compilation fails and complains about a missing file with a name similar to one of these, try installing the package's development version through your system's package manager tool:
libevent (http://www.monkey.org/~provos/libevent/)
gnutls (http://www.gnu.org/software/gnutls/)
There are some potential issues with different versions of gnutls so, if you are getting errors about missing gnutls functions, that may be the problem.
On the Debian 7 machine used for testing, libev was installed rather than libevent. This meant that the file called config in the top level directory of cd11-test-recv and tcpserial needed to have the line:
[ -z "${LIBEVENT_LIBS}" ] && LIBEVENT_LIBS="-levent"
changed to:
[ -z "${LIBEVENT_LIBS}" ] && LIBEVENT_LIBS="-lev"
Then the tar file in the ar directory needed to be replaced with the changed version.
3.1.1 Extra packages needed for Debian 7
lzo2
3.1.2 Extra packages needed for Ubuntu 12.04 LTS
libevent-dev for event.h
libtasn1-dev for libtasn1.h
libgnutls-dev for gnutls.h
3.2 Installation instructions
To install the tools:
Create a build directory for the tools.
Unzip and untar the file into the build directory. Two scripts, install.sh and update.sh, will be created, together with a data directory.
Edit the file data/config.example
This file contains a single variable, which sets the path prefix, PREFIX, for installed files. This can be either a standard system prefix (/usr or /usr/local), or another location of your choice. The format is
PREFIX=/path/to/installation
Files will be installed in bin/, lib/, and include/ directories beneath the PREFIX directory.
Save the file as data/config
Download the list of available packages by running the script
./update.sh
You will see a new directory, var/, created in the build directory. This directory is used to store downloaded source files.
Now run the script
./install.sh
Without any arguments, this script prints a list of the packages you can build. See the later chapters for details of each package.
To build and install a package, run
install.sh package-name
using the package name from the list output in the previous step.
The installer places archive files in a new directory, ar/, inside the build directory. These are extracted into var/ and the source files are compiled automatically.
Dependencies will also be compiled.
The compiled programs and libraries are installed under the directory specified by PREFIX. If you are using a system directory (/usr or /usr/local), run
ldconfig
to tell your system about the new libraries.
If you are using a different PREFIX directory, add the name of the lib/ directory to the environment variable LD_LIBRARY_PATH and the name of the bin/ directory to the environment variable PATH
If you are using the bash shell, you can do this with
export LD_LIBRARY_PATH="/path/to/lib:$LD_LIBRARY_PATH"
export PATH="/path/to/bin:$PATH"
See section 3.4 for more information about installing libraries.
3.3 Updating and recompiling packages
To update a package, run
./update.sh
in the build directory, then install as above. If you already have the current version, the script will do nothing.
If you need to recompile a package, remove its source directory from var/ in the build directory, then
install.sh package-name
To completely reinstall all packages, remove the ar/ and var/ directories, then update and install as above.
Note: Users with installations from before 2009-02-16 are advised to follow the complete re-installation procedure when updating after this date, because a binary-incompatible change in one of the core libraries requires most packages to be rebuilt.
3.4 Shared library management
If the tools are installed to a standard directory (i.e. /usr or, on some systems, /usr/local) then the ldconfig program must be run as root after installing or updating shared libraries.
If installed to a custom directory, there are two options. Either add the library directory (e.g. /opt/guralp/lib) to the file /etc/ld.so.conf (see the ldconfig(8) man page for details), or run a command such as:
ldconfig -n /opt/guralp/lib
In any case, the ldconfig utility must be run after installation/update before the programs will be able to find the correct shared libraries. ldconfig manages library symlinks to allow for multiple compatible and incompatible versions of a library to be installed simultaneously. Please contact Güralp support if you need further help with this issue (in particular: if you have library or “symbol not found” errors when running the tools).
3.5 Running daemons at start-up
Several of these packages are intended to be run as daemons; processes which run in the background and are independent of any users on the system. It is recommended that a package such as daemon-tools, start-stop-daemon or daemonitor is used for this purpose. (The daemonitor package can be downloaded from http://www.lwithers.me.uk/usr/src/daemonitor/.)
Integration with the operating system differs by distribution, and is beyond the scope of this document. Generally the distribution's “init scripts” are used to perform this.