# Installation

The following sections contain detailed instructions for obtaining, compiling, and installing &kst; along with any optional libraries or packages. If you use a package management system, you may use it to install &kst; instead.

## Obtaining &kst;

&kst; is part of the kdeextragear-2 module of &kde;. You can also download the latest version separately from the &kst; website . If you wish to download &kst; from CVS, it is available via anonymous CVS for &kde; or via the &kde; WebCVS repository.

## Installing &kst; from Source

The following sections detail how to compile and install &kst; from source code.

### Requirements

&kst; v1.2.0 requires the &kde; 3.1 libraries and &Qt; 3.1. Almost all major &Linux; distributions have packages for &kde; and &Qt;. Since &Qt; is a dependency of &kde;, having the required version of &kde; should be sufficient. It is recommended that you refer to your particular distribution's documentation for &kde; library installation. Note that the entire &kde; desktop environment is not required—in most cases, look for packages called `kdebase-*` and `kdelibs-*`. Alternatively, more information is available on the &kde; website.

### Optional Libraries and Packages

The following libraries and packages are optional, but provide full plugin and data source functionality in &kst; if installed. The installation instructions assume you have root access on your system.

You may already have some or all of these libraries and packages installed, in which case there is no need to reinstall them. Also, check first to see if pre-compiled binaries for the libraries and packages exist in your distribution's package management system, as it may be easier to install the binary packages.

#### &GNU; Scientific Library (GSL)

The &GNU; Scientific Library provides a variety of mathematical operations for the built-in &kst; plugins. Having GSL installed enables a variety of plugins such as linear and non-linear fitting, correlation, and interpolation plugins. The library can be found at ftp://ftp.gnu.org/gnu/gsl/. Alternatively, you can find GSL under `/gnu/gsl` on the mirrors listed at http://www.gnu.org/prep/ftp.html.

Download `gsl-`version`.tar.gz`, where `version` is the greatest version number found in the directory.

Then unzip and untar the file:

    tar -zxvf gsl-version.tar.gz

replacing `version` with the version number of the downloaded file.

Read the `INSTALL` file in the resultant directory for detailed installation instructions. For most systems, the following will work:

    cd gsl-version
    ./configure
    make
    make install

#### CFITSIO

The CFITSIO library provides support for reading and writing to the FITS (Flexible Image Transport System) data format. The libary can be found at ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/. You only need to install the library if you anticipate reading or writing to the FITS file format.

Download `cfitsio`version`.tar.gz`, where `version` is the greatest version number found the directory.

Then unzip and untar the file:

    tar -zxvf cfitsioversion.tar.gz

replacing `version` with the version number of the downloaded file.

Read the `README` file in the resultant directory for installation instructions. For most systems, the following will work:

    cd cfitsio
    ./configure --prefix=/usr
    make
    make install

You may need to change the directory specified for the `--prefix` option, but the most common directory is `/usr`

### Compiling and Installing

Once all of the prerequisites have been met on your system you can compile and install &kst;. It is assumed that you have already downloaded the &kst; source package. If not, please see Obtaining &kst;.

The simplest way to install &kst; is:

    tar -zxvf kst-version.tar.gz
    cd kst-version
    ./configure --prefix=`kde-config --prefix`
    make
    make install

replacing `version` with the version of &kst; you have.

Note that `kde-config --prefix` is surrounded by backquotes. It is very important that the `kde-config` utility returns the correct path (most likely `/usr`), otherwise &kst; will not install properly. You can double-check by running it directly:

    kde-config --prefix

Ensure that a non-null path is displayed.

You can read through the messages displayed by the `configure` script—if it reports any missing libraries (such as GSL) that should not be missing, please go back and ensure that the libraries and header files have been correctly installed in the appropriate locations.