LAMA
Linux Installation

Download

You can check out the latest version via svn by the following commmand:

svn co https://libama.svn.sourceforge.net/svnroot/libama/trunk lama

Or you can download the tar file by this link:

libama.svn.sourceforge.net/viewvc/libama/trunk/?view=tar

Build

Since we use CMake to control the software compilation and installation process, you should have an actual CMake version (2.8 or later) available on your platform. As recommended for CMake in general, you should use an own build directory and not build within the source directory.

cd lama
mkdir release
cd release
cmake -DMKL_ROOT=/opt/intel/mkl -DBOOST_ROOT=/home/boost/ -DCMAKE_BUILD_TYPE=Release ../src

By using ccmake you can set individual items that will also be discussed later on this page.

  • BOOST_ROOT home directory of your BOOST installation, /usr if you use a Linux installation
  • CMAKE_BUILD_TYPE Release, or Debug
  • CMAKE_INSTALL_PREFIX directory where LAMA should be installed later
  • CUDA_TOOLKIT_ROOT_DIR optional, directory of your CUDA installation
  • LAMA_ASSERT_LEVEL ERROR recommended, alternatively DEBUG
  • LAMA_LOG_LEVEL INFO recommended, alternatively DEBUG or more detailled TRACE
  • LAMA_USE_CUDA switch ON or OFF
  • LAMA_USE_MPI switch ON or OFF

To build LAMA just invoke make in your build directory. Parallel builds are supported and recommended.

make -j <number-of-build-processes>

Boost

LAMA uses some Boost libraries and therefore you must have an actual version (1.34 or later) installed on your machine.

Many linux installations provide an actual release of Boost and if Boost is installed, LAMA should have no problems to find it.

If for any reasons no actual Boost installation is available, you must download and install it. Please make sure that you build also the dynamic libraries. After installation you can tell cmake the location of installation by the variable BOOST_ROOT as described above or by setting an environment variable.

export BOOST_ROOT=<path-to-boost-installation>

Via ccmake you can verify that the Boost variables needed for LAMA have correct values.

  • BOOST_ROOT /home/brandes/local/boost_1_46_0
  • Boost_INCLUDE_DIR /home/brandes/local/boost_1_46_0/include
  • Boost_LIBRARY_DIRS /home/brandes/local/boost_1_46_0/lib
  • Boost_PROGRAM_OPTIONS_LIBRARY /home/brandes/local/boost_1_46_0/lib/libboost_program_options.so
  • Boost_THREAD_LIBRARY /home/brandes/local/boost_1_46_0/lib/libboost_thread.so
  • Boost_UNIT_TEST_FRAMEWORK_LIBR /home/brandes/local/boost_1_46_0/lib/libboost_unit_test_framework.so

BLAS and LAPACK

We recommend using Intel MKL libraries for BLAS, LAPACK and (optional) ScalLAPACK routines. If the environment variable MKL_ROOT is set to the corresponding installation directory, there should be no problems at all.

export MKL_ROOT=<path-to-mkl-installation>

If the MKL is not available, LAMA tries to find other BLAS or LAPACK libraries. If it fails, you will see a typical message like this:

  Could NOT find LAMA_BLAS (missing: LAMA_BLAS_LIBRARIES)

Unfortunately, the CMake modules have some problems in finding the BLAS and LAPACK libraries. Especially the module FindLAPACK.cmake has the problem that in some versions the CMAKE_FIND_LIBRARY_SUFFIXES variable was misspelled as CMAKE_FIND_LIBRRAY_SUFFIXES. Here is a solution how to specify the corresponding libraries directly:

  cmake -DBLAS_blas_LIBRARY=/usr/lib64/libblas.so.3  \
        -DLAPACK_lapack_LIBRARY=/usr/lib64/liblapack.so.3

ScaLAPACK is optional and only needed if you need to build the inverse of a distributed matrix.

MPI

If you want to use MPI, please make sure that a version of MPI (e.g. OpenMPI) is installed on your machine, and that mpirun is in your path. By this way, the FindMPI module of cmake will recognize your MPI installation.

LAMA itself uses the following MPI variables:

  • MPI_CXX_COMPILER for the MPI C++ compiler, e.g. mpicxx
  • MPI_CXX_INCLUDE_PATH for the include file, e.g. /usr/local/openmpi-1.4.3/include
  • MPI_CXX_LIBRARIES for the libraries to be linked, e.g. /usr/local/openmpi-1.4.3/lib/libmpi_cxx.so;/usr/local/openmpi-1.4.3/lib/libmpi.so;...

MPI is optional and LAMA can be built without it. But you will not be able to take advantage of distributed vectors and matrices.

CUDA

LAMA supports GPU accelearators via CUDA. This feature is optional.

If CUDA is installed on your machine, LAMA should find it if it is in one of the system directories. Otherwise you can give cmake the hint by the variable LAMA_ROOT.

API Documentation

To build LAMAs doxygen API documentation call

make doc

Documentation is available in the directory <project-root>/doc/doxygen/html, open the file index.html in your browser and the system documentation is available.

Install

To install LAMA to the configured installation path just call

make install

in your build directory.

For your convenience, we recommend to set the environment variable LAMA_ROOT to this installation directory.

export LAMA_ROOT=<installation-directory>

Running Examples

Examples can be found in the directory <project-root>/share/tutorial.

Running Test

cd test
export LAMA_LOG=config
export LAMA_UNSUPPORTED=IGNORE
lama_test 

Troubleshooting

If some software components could not be found, we recommend using ccmake where you can set variables individually.

ccmake .

In case of troubles with MPI or CUDA, please make sure that your installation works at least without these optional features.