Skip to content
Sebastian Heimann edited this page Sep 16, 2018 · 34 revisions

Kiwi Compilation and Installation Guide

The Kiwi codes have so far been compiled on Linux and Mac OS X, but it should be possible to compile them on any UNIX system, where HDF5 and FFTW3 are available.

Prerequisites

Short story: you need a Fortran 95 compiler, HDF5, FFTW and libmseed. If you are lucky, you may find all except for the libmseed through your systems package manager. E.g. on Ubuntu you could install:

   sudo apt-get install gfortran libhdf5-serial-dev libfftw3-dev

Details, if you have to install some of the packages manually

  • A Fortran 95 compiler -- Most testing has been done with gfortran, g95, and ifort. The compiler must support allocatable derived type components, which is a Fortran 2003 feature. (Most Fortran 95 compilers support this however.)

  • HDF5 -- Version <= 1.8 is required, use the provided script get_hdf5_18.sh to download and compile HDF5.

and if you want a second installation using a different compiler:

FC=ifort ./configure --enable-fortran --prefix=/somewhere/hdf5-ifort make clean make make install


* **[FFTW3](http://www.fftw.org/)** -- The packages provided through the systems package manager will usually do fine (only Fortran77 is involved), but you have to install the headers as well as the libraries, so, for example on a Debian-based Linux system, you would install the packages fftw3 and fftw3-dev. 

* **[libmseed](http://www.iris.edu/software/libraries/)** -- The simplest approach is to compile libmseed with `make gcc` and then copy all its header files (`*.h`) to `/usr/local/include` and `libmseed.a` to `/usr/local/lib`. Check, that the environment variables `$LIBRARY_PATH` and `$C_INCLUDE_PATH` contain `/usr/local/lib` and `/usr/local/include`, respectively.

* **[SAC](http://www.iris.edu/manuals/sac/SAC_Home_Main.html)** -- If you want to read and write SAC files from the Kiwi Tools, you must make the linker find the sacio library. It can be found in the lib subdirectory of where you installed SAC. For example on Linux, it is named sacio.a, but like this, -lsacio won't work. Simply rename it to libsacio.a and adjust `$LIBRARY_PATH` to make the linker happy (or edit the Makefile). Most people don't need SAC IO. If you are one of those, just link the Kiwi Tools against the dummy_sacio library which is included in the Kiwi source code.

## Getting the Kiwi Tools

The simplest way of downloading the Kiwi Tools is by using Git:

```sh
cd ~/src/   # or wherever you keep your source packages
git clone git://github.com/emolch/kiwi.git kiwi

Compiling the Kiwi core codes

  1. cd into the kiwi directory.
  2. Copy Makefile.local.example to Makefile.local. This file is included by the main Makefile.
  3. Edit Makefile.local to your needs. Check compiler settings, HDF5 library paths and install prefix.
  4. Run make. If all goes well, everything will be built.
  5. Optionally run make check. This will run the test programs again. Each test will report 'OK' if it passes.
  6. Run make install or sudo make install, whatever is apropriate for your setup.

Installing the Kiwi Python modules

# in the kiwi source directory:
cd python
sudo python setup.py install

Depending on what modules you want to be able to use, you may need some or all of the following additional packages:

If you want to use the source model viewer:

Clone this wiki locally