UbuntuHelp:Lapack
来自Ubuntu中文
* tested with: Ubuntu 6.06 (Dapper Drake) and Ubuntu 6.10 (Edgy Eft)
Introduction
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconHelp2.png%7D%7D There exists a rich variety of libraries for solving mathematical problems numerically in C++. The [Repository] is a good resource for information on this subject. The disadvantage of most of the libraries available there (like [[1]]) is that they are outdated or at least not actively maintained. Because of this, the project [[2]] has been brought to life. It bases on [[3]], which would later evolve into [[4]], which however was never truly released. Therefore the developer [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 [[5]] and [[6]] which were converted from Fortran code to C code by a wrapper called [[7]]. An alternative to Lapack++ is [[8]]. However, IT++ is licensed by the [[9]]. 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 [[10]] 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 [page]. {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png%7D%7D 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 islapackpp-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
andsudo 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
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png%7D%7D 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
- [[11]] - documentation and information