# Installation

## SPRAL Installation Instructions

The Sparse Parallel Robust Algorithm Library (SPRAL) is an open-source library for sparse linear algebra and related algorithms. It is primarily developed and maintained by the Numerical Analysis Group at STFC’s Rutherford Appleton Laboratory.

Major Version History

2014-03-19 Version 1.0.0
Initial release

### 1.1 Quick Start

Under Linux, or Mac OS X:

# Build and install library
BUILDDIR=build; mkdir $BUILDDIR; cd$BUILDDIR
../configure --with-metis="-L/path/to/metis -lmetis"
make
sudo make install # Optional

# Link against library
cd /path/to/your/code
gfortran -o myprog myobj.o -lspral -lmetis -lblas

#### Notes

• The above instructions perform an out-of-path build: we recommend you change the value of \$BUILDDIR to reﬂect the compiler used, for example BUILDDIR=build-gfortran-4.8.
• The above will build the SPRAL library and a number of driver programs. To build the example and test codes, use make check.
• Installation is not required: in many cases it will be suﬃcient to just link against the static library found in the .libs subdirectory.
• If you write a paper using software from SPRAL, please cite an appropriate paper (a list can usually be found in the method section of the user documentation). If none is listed, a citation of the library website should be used:

SPRAL: an open-source library for sparse linear algebra, Version 2014-03-20, http://www.numerical.rl.ac.uk/spral, March 2014.

### 1.2 Licence

At present, all code is covered by the 3-clause BSD licence given in the ﬁle LICENCE.

### 1.3 Third-party libraries

#### 1.3.1 METIS

Many of our packages use the METIS graph partitioning library to ﬁnd good orderings. You can obtain a copy of METIS from the following url:
http://www.cs.umn.edu/~metis
We support both version 4 and version 5 (the latter is available under the open source Apache Licence). At present, we recommend version 4 as it is faster than version 5, though this may change in the future.
If the METIS library is not available on the default link path, the --with-metis option to configure should be used to specify how to link against METIS. For example, if libmetis.a is in the directory /usr/local/metis-4.0, use:
../configure --with-metis="-L/usr/local/metis-4.0 -lmetis"

#### 1.3.2 BLAS

Many of our packages require a high performance BLAS library to eﬃciently perform dense linear algebra operations. For best performance, please use the library recommended by your computer manufacturer (normally the Intel MKL). If this is not available, use an optimized alternative, such as OpenBLAS. The reference BLAS from netlib are at least an order of magnitude slower than modern optimized BLAS, and should be avoided. If bit-compatible results are desired, a bit-compatible BLAS library must be used.

If the BLAS library is not available on the default link path, or if configure detects the wrong BLAS library, the --with-blas option to configure should be used to specify how to link against the BLAS library. For example, to link against the Intel MKL using the GNU compiler suite, use:

../configure --with-blas="-L/opt/intel/mkl/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread \
-lmkl\_core"

### 1.4 Compilers and compiler options

If no compiler is speciﬁed, configure will pick a default compiler to use. If configure cannot ﬁnd an appropriate compiler, or you wish to specify a diﬀerent compiler you can do so by setting the following variables:

CC
speciﬁes the C compiler to use.
FC
speciﬁes the Fortran 90/95/2003/2008 compiler to use.
NVCC
speciﬁes the CUDA compiler to use.

Additionally, compiler ﬂags can be speciﬁed using the following variables:

CFLAGS
speciﬁes options passed to the C compiler.
FCFLAGS
speciﬁes options passed to the Fortran compiler
NVCCFLAGS
speciﬁes options passed to the CUDA compiler.

For example, to compile with ifort -g -O3 -ip we could use:

../configure FC=ifort FCFLAGS="-g -O3 -ip"

### 1.5 Other options to configure

The configure script is generated by autoconf, and hence oﬀers many standard options that can be listed using the command configure --help.

In particular, the following options may be of interest:

--prefix=PREFIX
speciﬁes the installation path preﬁx (by default /usr/local/ under Linux).

### 1.6 Support

Feeback may be sent to hsl@stfc.ac.uk.
Bugs can be reported online via our bug tracking system:
http://ccpforge.cse.rl.ac.uk/gf/project/spral/tracker/?action=TrackerItemBrowse&tracker_id=498.
We will endeavour to ﬁx all reported bugs.