Installing from source

Dependencies

Before you begin installing from source, you should make sure that you have the following dependencies installed.
  • Sqlite: required only for the SWIG bindings.
  • SWIG: required only for building from source.
  • Python: required only for Python interface.
  • Octave: required only for Octave interface.
  • Java: required only for MATLAB/Java interface.
  • Either Cyrus SASL or MIT Kerberos: required only for connecting to Kerberos-protected NDS protocol version 2 servers.
If you are on Mac OS X and have the MacPorts package manager installed, then you can install all of the dependencies for building from source with all language interfaces enabled by using the port command:
$ sudo port install swig-java swig-octave swig-python pkgconfig kerberos5 sqlite3 cmake
On Debian, install the dependencies using apt-get:
$ apt-get install swig libsqlite3-dev octave octave-headers default-jdk python libsasl2-dev krb5-user libsasl2-modules-gssapi-mit cmake
And on Red Hat or Scientific Linux, install the dependencies using yum:
$ yum install swig sqlite-devel octave octave-devel java-1.6.0-openjdk-devel cyrus-sasl-devel cmake

Obtaining the source code

First, download a source release tarball, unarchive it, and change directories into the downloaded source folder, using the following commands, where X.X.X is the version of nds2-client that you want:
$ wget http://www.lsc-group.phys.uwm.edu/daswg/download/software/source/nds2-client-X.X.X.tar.gz
$ tar -xzf nds2-client-X.X.X.tar.gz
$ mkdir nds2-client-X.X.X-build
$ cd nds2-client-X.X.X-build

Building

Next, configure, build, and install the package. This is done with the cmake tool.The table below lists essential command line arguments for enabling or disabling optional features.

Table 2.1. Essential command line options for cmake

OptionPurpose
-DCMAKE_INSTALL_PREFIX=/path/to/localInstall files into /path/to/local/bin, /path/to/local/lib, etc.
-DPROG_MATLAB_=/path/to/matlabUse this to make sure the build finds a matlab installation.

Note

Note that if you are on a Mac and you use MacPorts, you should add the following options to cmake:

By default, files will be installed into /usr/bin, /usr/lib, /usr/share, etc. If you would like to install into another location, such as your home directory, you should provide the -DCMAKE_INSTALL_PREFIX option when you call cmake.

For example, to enable all available features, and install into the directory /path/to/local, run the following commands:

$ cmake ../nds2-client-X.X.X -DCMAKE_INSTALL_PREFIX=/path/to/local
$ make
$ make install

Environment script

If you are going to install the NDS client in your own home directory, then you will need to set some environment variables every time that you log in. The client installs a script to help setup environment variables for the specific install of the nds2-client. Assuming that you are installing into the directory /path/to/local, run the following command.

Example 2.1. Example environments script

$ source /path/to/local/etc/nds2-client-user-env.sh