# Installation¶

## Quick Start¶

Under Linux, or Mac OS X:

# Get latest development version from github and run dev scripts
git clone --depth=1 https://github.com/ralna/spral.git
cd spral
./autogen.sh

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

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 reflect 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 sufficient 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.

## Third-party libraries¶

### METIS¶

Many of our packages use the METIS graph partitioning library to find good orderings. You can obtain a copy of METIS from 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"


### BLAS¶

Many of our packages require a high performance BLAS library to efficiently 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"


## Compilers and compiler options¶

If no compiler is specified, configure will pick a default compiler to use. If configure cannot find an appropriate compiler, or you wish to specify a different compiler you can do so by setting the following variables:

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

Additionally, compiler flags can be specified using the following variables:

CFLAGS
specifies options passed to the C compiler.
FCFLAGS
specifies options passed to the Fortran compiler
NVCCFLAGS
specifies 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"


## Other options to configure¶

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

In particular, the following options may be of interest:

• --prefix=PREFIX specifies the installation path prefix (by default /usr/local/ under Linux).

## Support¶

Feeback may be sent to hsl@stfc.ac.uk or by filing an issue on our github: https://github.com/ralna/spral/issues.