Getting Started

This page includes instructions for installing MatrixLib binaries and running the test program included with the library. If you have purchased source code it is assumed that you will manage your own installation system, but you are welcome to contact us for assistance. See Support for more information.


MatrixLib is available as a pre-compiled binary library for Linux, Macintosh OS X, and Microsoft Windows XP. Your download will include the appropriate installer for your platform - for Linux, your distribution must support RPM installation. To install the software, simply double-click the install file and follow the instructions displayed on the screen. You will be prompted for the location you wish to install the test code included with the library - this is not the same as the location where the library and header files will be installed.

Important: MatrixLib is designed to be installed as a shared system library, so you will need administrator ("root") privileges on the target system.

Test Program

MatrixLib ships with an extensive test program which exercises every function in the MatrixLib API, serving as both a tool for verifying your installation and as an example of how each function is used. The test is divided into modules mirroring the organization of the API reference. The tests for each module are in a separate file, linked together by the main test program. The source code for the test program is provided so that you can verify your ability to build code that uses MatrixLib and also as an additional reference for using MatrixLib.

Building the test program will vary depending on your platform. If the build fails, there is a problem with your installation - this should not happen, but if it does please contact tech support with the details as soon as possible. Once the program is built, it will execute as a console application that prints a series of tests and the pass/fail result for each test. All tests should pass! If one or more tests fail, there may be a problem with numerical precision or some other tuning detail for your system. Please contact tech support as soon as possible and provide as much detail as possible about your system and the test which failed.

Linux and Mac OS X

Building the test program from the command line on these platforms requires GNU Make and GCC 3.1 or higher. This software is standard on the majority of Linux distributions and can be freely downloaded from if it is not currently on your system. Mac OS X users may need to install the Apple Developer Tools from Open a shell ("Terminal" on Mac OS X), and from the command prompt, change directories to the test code directory. In the test directory, run "make" with a target matching your platform:

On Linux:

make linux

On Mac OS X:

make macosx

This will produce an executable file "test", which you can then run by entering "./test". You should see the test output displayed in your terminal.

Mac OS X (Optional)

Mac OS X users can follow the command line instructions in the section above, or (if preferred) they can use the included Xcode project. This requires that the Apple Developer Tools for OS 10.3 or later have been installed - these tools are available free of charge from To build the test program using Xcode, double-click the project "MLTests.xcode". After the project has opened in the Xcode IDE, click the "Build and Run" button on the toolbar (also found in the "Build" drop-down menu). After the program compiles it should immediately execute as described above. Since you are not in a console, Xcode will open a new window to display the program output.

Windows XP

MatrixLib includes a VisualStudio Workspace project for the test program. You must have VisualStudio version 6.2 or later installed on your system in order to use this project. Simply open the workspace and compile and run the test project in the workspace. The installer by default tries to install in C:\MatrixLib. If you installed it in a different path then please make the following changes to the project settings of the test project in order to run successfully -
  1. Under C\C++ tab -> preprocessor -> additional include directories - change path to reflect the modified path for the header folder
  2. Under Link tab -> General -> object/library modules - change path to reflect modified path for matrixlib.lib and ws2_32.lib.

If your VC6 is not set up to recognise .cc as c++ source files, then you need to either change the registry entry of VC6 - refer to and add /TP option in project options under project settings or alternatively, simply change the .cc file extensions to .cpp


Once you have built and run the test program, you have verified your MatrixLib installation. The next step is building your own applications! If you are implementing in C++ some algorithms developed in MATLAB, you will want to read associate page in this manual for particular information on translating code from MATLAB to MatrixLib/C++. The Debugging page contains useful information concerning problem solving MatrixLib-based applications. "Optimizing" describes important concepts for production systems in which speed of execution is of particular importance. If you have questions about using MatrixLib which are not addressed in these pages or in the FAQ, you should contact tech support following the instructions on the Support page.