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 # Link against library cd /path/to/your/code gfortran -o myprog myobj.o -lspral -lmetis -lblas
The above instructions perform an out-of-path build: we recommend you change the value of
$BUILDDIRto reflect the compiler used, for example
The above will build the SPRAL library and a number of driver programs. To build the example and test codes, use
Installation is not required: in many cases it will be sufficient to just link against the static library found in the
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.
Many of our packages use the METIS graph partitioning library to find good
orderings. You can obtain a copy of METIS from
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
../configure --with-metis="-L/usr/local/metis-4.0 -lmetis"
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
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:
- specifies the C compiler to use.
- specifies the Fortran 90/95/2003/2008 compiler to use.
- specifies the CUDA compiler to use.
Additionally, compiler flags can be specified using the following variables:
- specifies options passed to the C compiler.
- specifies options passed to the Fortran compiler
- 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
In particular, the following options may be of interest:
--prefix=PREFIXspecifies the installation path prefix (by default
Copyright (c) 2014-6, The Science and Technology Facilities Council (STFC) All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the STFC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STFC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.