Chapter 2. Installation

Table of Contents

Installing from source
Dependencies
Obtaining the source code
Building
Environment script
Installing with MacPorts
Installing with Windows installer

It is easy to install the NDS client on Mac OS X using the MacPorts package and on Windows using the Windows installer, or from source on Linux, UNIX, or Mac OS X.

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
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
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

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
$ cd nds2-client-X.X.X

Building

Next, configure, build, and install the package. The table below lists essential command line arguments for enabling or disabling optional features.

Table 2.1. Essential command line options for ./configure

OptionPurpose
--prefix=/path/to/localInstall files into /path/to/local/bin, /path/to/local/lib, etc.
--with-sasl, --without-saslEnable or disable NDS2 authentication with Cyrus SASL
--with-gssapi, --without-gssapiEnable or disable NDS2 authentication with MIT Kerberos GSSAPI
--enable-mex-matlab, --disable-mex-matlabEnable or disable the legacy MEX MATLAB wrapper. Note that new versions of MATLAB are backwards compatible with MEX functions built for older versions of MATLAB of the same architecture. If you plan to use the legacy MEX MATLAB wrapper with multiple versions of MATLAB, you should build with your oldest version of MATLAB.
MATLABROOT=/path/to/matlabPass this argument only if you want the legacy MEX MATLAB wrapper, but ./configure fails to automatically find MATLAB. Normally, ./configure will search for the oldest working version of MATLAB in /usr/local/MATLAB, /opt/matlab, /ldcg, /Applications, or the directory corresponding to any matlab executable that is found on the PATH. If you provide the MATLABROOT option, all these locations are skipped and ./configure just checks whether MATLABROOT is a MATLAB installation with a working MEX library.
--enable-mex-octave, --disable-mex-octaveEnable or disable the legacy MEX Octave wrapper
--enable-swig-python, --disable-swig-pythonEnable or disable the SWIG bindings for Python
--enable-swig-octave, --disable-swig-octaveEnable or disable the SWIG bindings for Octave
--enable-swig-java, --disable-swig-javaEnable or disable the SWIG bindings for Java/MATLAB
--enable-swig, --disable-swigEnable or disable the SWIG bindings for all supported languages. Equivalent to --enable-swig-python --enable-swig-octave --enable-swig-java or --disable-swig-python --disable-swig-octave --disable-swig-java.

Note

Note that if you are on a Mac and you use MacPorts, you should add the following options to configure:
--without-sasl --with-gssapi=/opt/local

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 --prefix option when you call ./configure.

All of the --enable-/--disable- style arguments work as follows: if omitted, the optional feature is turned on if its dependencies can be found. If the --enable- argument is provided, then the feature is unconditionally turned on and configuration fails if its dependencies are not present. If the --disable- argument is provided, then the feature is unconditionally turned off.

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

$ ./configure --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. Assuming that you are installing into the directory /path/to/local, an example bash environment script would look like the following example.

Example 2.1. Example environments script: environment.sh

# Needed only for command line tools
export PATH=/path/to/local/bin:$PATH

# Needed only for Python bindings
export PYTHONPATH=/path/to/local/lib/python2.6/site-packages:$PYTHONPATH

# Needed only for Java/MATLAB bindings
export CLASSPATH=/path/to/local/lib/java:$CLASSPATH

# Needed only for Octave bindings
export OCTAVE_PATH=/path/to/local/share/octave:$OCTAVE_PATH

Important

You should NOT have to set the environment variable LD_LIBRARY_PATH (or, on Mac OS, DYLD_LIBRARY_PATH) at any point.
Every time you log in, execute this environment script with:
$ source environment.sh