Fork me on GitHub


Parrot-Linear-Algebra (PLA) is a linear algebra toolkit for the Parrot Virtual Machine . PLA provides a number of matrix object types and bindings to the powerful BLAS and LAPACK libraries.

Installation Quick-Start

If you have all the prerequisites (see below) and a local checkout of the PLA source, you can build and install the library with the following commands:

parrot-nqp setup.nqp build
parrot-nqp setup.nqp test
parrot-nqp setup.nqp install

If you have the Parrot package manager Plumage installed, you can quickly and easily install PLA with this command:

parrot plumage install parrot-linear-algebra


You can download this project in either ZIP or TAR

If you have Git you can clone the current version of the development sources with this command:

git clone git://


PLA requires several prerequisites to build and run. Without the prerequistes PLA might not build, or some features might not be available.

Parrot Virtual Machine

PLA is an add-on for Parrot, so you must have a working, modern version of Parrot installed. Compatibility between versions of PLA and Parrot may be complicated, and many more combinations may exist than have ever been tested. For each supported release of Parrot1 there will usually be one recommended version of PLA to use. There may not be a recommended version of PLA for every development release of Parrot2.

PLA expects a standard installation of Parrot to run and operate.

1 Parrot supported releases are X.0, X.3, X.6, and X.9 version numbers. Supported releases come out every three months (January, April, July, October). Supported Parrot releases might not always be packaged and distributed through your favorite binary package channel.

2 Parrot development releases come out monthly, except in months when supported releases are produced. If there are no major API changes in Parrot, the version of PLA recommended for the previous supported release may still work well with the current development release of Parrot. If you absolutely need the bleeding edge for some reason, you’re probably going to have to build the software yourself.


BLAS is more of a library standard than an actual library implementation. The standard reference implementation of BLAS is written in FORTRAN, and is not particularly optimized. Some other implementations are:

PLA has been tested to work on Linux using BLAS, CBLAS, and ATLAS. There are other implementations of BLAS that may work as well, but are not tested.

Note: PLA should work with all BLAS implementations. If you find an implementation of BLAS that does not readily work with PLA, please let us know.

The PLA setup program automatically detects and links to BLAS using a series of search heuristics. It is not currently possible to manually specify a custom implementation of BLAS or a custom search path.


BLAS provides several low-level and highly-optimized routines for basic matrix operations such as matrix multiplication. LAPACK uses BLAS to implement many additional operations and algorithms. There are two primary implementations of LAPACK: The LAPACK reference library (written in FORTRAN), and CLAPACK, a computer-generated translation of the LAPACK source code to C.

Currently, PLA only links to the LAPACK library, and has no bindings to CLAPACK. The PLA setup program will automatically detect LAPACK. It is not possible to manually specify an install path for LAPACK yet.


The Kakapo library is a package of helper and extension routines and types for NQP. Kakapo is used by PLA to implement the unit test suite. You only need Kakapo to run the PLA unit tests. You do not need Kakapo to build or use PLA, though testing is always recommended.

Kakapo is under active development and not all versions might work properly with all releases of Parrot and all versions of PLA. For release 1 of PLA, you can get a special version of kakapo like this:

git clone git:// kakapo
cd kakapo
git checkout PLA-version-1

Or, if you don’t have git, you can download this particular version of Kakapo in ZIP or TAR archive formats. Once you have the archive, you can unpack it to see the source.

Once you have the Kakapo source, you can build and install it like this:

parrot-nqp setup.nqp build
parrot-nqp setup.nqp install

C Compiler

PLA’s setup program draws build information from the Parrot binary, and attempts to built itself in the same way that Parrot was built. PLA has been tested to build with both GCC and Clang compilers. Other compilers may work as well. Anything that can be used to build the Parrot executable can in theory be used to build PLA. PLA not building with any standard C compiler is a bug and should be reported.


Currently PLA is only tested and configured to run on modern desktop Linux distributions such as Ubuntu and Fedora. It may run on other distributions as well, but this is not tested. Test reports of PLA running on other systems would be much appreciated.


If you have Kakapo installed, you can run the automated test suite for PLA:

parrot-nqp setup.nqp build
parrot-nqp setup.nqp test

If you have internet access and if your version of Parrot was built with zlib support, you can also submit a smoke report to the Parrot smolder server . Smoke reports are extremely valuable in tracking bugs and for determining which platforms have good support for PLA and which platforms need more work.

If your Parrot has zlib support built-in, you can use the following command to generate and post a smoke report to the smolder server:

parrot-nqp setup.nqp smoke


PLA is released under the terms of the Artistic 2.0 license


Original versions were developed as part of the Matrixy project by Blairuk. Some parts of the test suite were provided by Austin Hastings. See the file CREDITS in the repository for updated information about contributors.