You can install the Newmat library as a precompiled Ubuntu/Debian package, or compile it from source.
To install the precompiled Newmat package run:
sudo apt-get install libnewmat10-dev
To install the Newmat library from source:
Create a directory in which you will put the source of newmat:
mkdir ~/sources/newmat/
Then download the latest version (version 11) of the Newmat library from the Newmat web page: http://www.robertnz.net/download.html
Move the downloaded file to your source folder:
mv newmat11.tar.gz ~/sources/newmat
Go to the directory /sources/
cd ~/sources/newmat
Untar and unzip the file:
tar -xzvf newmat11.tar.gz
Then go to http://people.mech.kuleuven.be/~tdelaet/Makefile.Newmat and save the file as Makefile in your newmat directory.
Also get the adapted include.h at http://people.mech.kuleuven.be/~tdelaet/include.h.newmat11 and save the file as include.h. in your newmat directory.
Build the library:
make
Finally, install the library. By default newmat gets installed in /usr/local. So change the PREFIX variable in Makefile.Newmat to /install or any other installation directory before running make install.
[sudo] make install