个人工具

UbuntuHelp:Lapack

来自Ubuntu中文

跳转至: 导航, 搜索
* tested with: Ubuntu 6.06 (Dapper Drake) and Ubuntu 6.10 (Edgy Eft)

Introduction

IconsPage?action=AttachFile&do=get&target=IconHelp2.png There exists a rich variety of libraries for solving mathematical problems numerically in C++. The Netlib Repository is a good resource for information on this subject. The disadvantage of most of the libraries available there (like CLAPACK) is that they are outdated or at least not actively maintained. Because of this, the project Lapack++ has been brought to life. It bases on lapack++, which would later evolve into TNT, which however was never truly released. Therefore the developer Christian Stimming {de} {en} came to the opinion that there should be something more up-to-date. Like many other mathematical libraries, Lapack++ bases on the two Fortran libraries BLAS and LAPACK which were converted from Fortran code to C code by a wrapper called f2c. An alternative to Lapack++ is IT++. However, IT++ is licensed by the GPL. This may not be suitable for companies who do not wish to make the source code of ther projects freely available. In contrast to this Lapack++ is licensed by the LGPL and can therefore be used for non-open-source projects as well.

Installation

Dependencies

Prior to installing Lapack++, the following packages have to be installed:

  • build-essential
  • lapack3-dev
  • refblas3-dev
  • atlas3-base-dev (universe)

By this the Fortran compiler g77 will be installed, too.

Compiling

In order to install the Lapack++ library, one has to compile it from source. The sources can be downloaded from this page. IconsPage?action=AttachFile&do=get&target=IconNote.png It is recommended to have a look at the Wiki document CompilingSoftware if you are not familiar with compiling software.

  • the required download has a name of the form lapackpp-X.X.X.tar.gz (the current one as of April 2007 is lapackpp-2.5.1.tar.gz)
  • untar the file and change into the newly created subfolder lapackpp-X.X.X
  • compile and install Lapack++ with the usual commands ./configure , make and sudo make install

Usage

After a default install, the header files of the library reside in /usr/local/lapackpp and can be included in C++ programs with:

#include <lapackpp/name.h>

The library files are installed to /usr/local/lib with liblapackpp.so being the main file. A linker command may therefore look like:

gcc -L/usr/local/lib -llapackpp foo.o

IconsPage?action=AttachFile&do=get&target=warning.png Some parts of the library are still from the original lapack++ 1.0 from 1998 and they may contain bugs. Also, all the undocumented files were not tested.

Troubleshooting

If Lapack++ is installed to /usr/local (which is the default), the libraries will probably not be found:

./lapack: error while loading shared libraries: liblapackpp.so.1: cannot open shared object file: No such file or directory

This can be resolved by editing (or creating) the file /etc/ld.so.conf in an editor with root privileges. One line with the installation path of the library

/usr/local/lib

has to be added to the file. After that, the environment variables for the library path have to be reloaded by entering the following command in a terminal:

sudo ldconfig

Links

  • Lapack++ - documentation and information