Using Newmat11 C++ library on Linux

Newmat is a matrix library for C++ written by Robert Davies. It is a well written library to handle matrix computation. This is useful when you are writing a program in C++, but you wish to have matrix functions for quick uses like in Matlab. I used Newmat11 (version 11 beta) on both C++ and C++ .NET (managed) before without any problems. In Window, setting up can be a little tricky for someone not familiar with configuring project properties in Visual Studio. In Linux, the installation is much simpler with the use of make file. This page provides instruction to compile Newmat11 library in Linux. I use Ubuntu, but other Linux distributions should work too.

First, download the library file newmat11.tar.gz from the download page. Uncompressed the file by using the command lines:

$ mkdir newmat11
$ mv newmat11.tar.gz newmat11/
$ cd newmat11
$ tar -zxf newmat11.tar.gz

The example can be compiled without any modifications. To compile and run the example program use.

$ make -f nm_gnu.mak
$ ./example