Installation

The compiler

Seldon is supposed to be fully compliant with the C++ standard. Therefore, it can be compiled by GNU GCC (>=3.0; tested with version 3.2, 3.3, 3.4, 4.0, 4.1, 4.2, 4.3 and 4.4) and by the Intel C++ compiler icc (tested with icc 7.1 and 8.0). No tests were conducted with proprietary compilers under Unix, but the compliance with the C++ standard should ensure portability. Decent versions of Microsoft Visual C++ (i.e., from Visual C++ 2003) compile Seldon.

Installation

Download the source code (Seldon homepage), usually available in a compressed file, e.g. Seldon-[version].tar.bz2. Uncompress the file, i.e. under Unix: bunzip2 Seldon-[version].tar.bz2 followed by tar -xvf Seldon-[version].tar. This will create the directory Seldon-[version] in which you will find Seldon.

Installation of CBlas

If you want to use the interface with Blas, you also need to have Blas (of course) and CBlas (C interface to the Blas) installed. Seldon uses CBlas to ensure portability of the interface.

Blas is usually installed. If not, you may refer to the dedicated documentation. As for CBlas, download it at http://www.netlib.org/blas/, expand it (e.g. tar -zxvf cblas.tgz), and compile it (e.g. make all). The installation is then complete.

Tests

First compile and run test.cpp which is an example provided with Seldon (in the directory test/program). For example:

g++ -I../.. test.cpp && ./a.out

This should return:

Seldon: compilation test
Vector: 0       1       2
Vector: 0       1       2       19

In test.cpp, the first line includes Seldon through Seldon.hxx. Seldon.hxx is the only file to be included and it is located in the directory Seldon-[version] expanded from the downloaded file (see section Installation). If you compile your own code on top of Seldon, just provide the path to Seldon-[version] to the compiler, e.g.:

g++ -I/path/to/Seldon-[version] your_code.cpp && ./a.out

A second test is provided: test_Blas.cpp. If Blas and CBlas are properly installed and the library file of CBlas is located in [CBlas-library] (e.g. [CBlas-directory]/lib/LINUX/cblas_LINUX.a), the compilation line should be:

g++ -I../.. test_Blas.cpp [CBlas-library] -lblas -lg2c && ./a.out

This should return:

Seldon: compilation test with Blas
U = 1.3 1.3     1.3
V = 0   1       2
2. * U + V = 2.6     3.6     4.6

If Cblas is already installed in your system or if you installed it by using apt-get on linux or fink on mac, you may type the following compilation line:

g++ -I../.. test_Blas.cpp -lcblas -lblas -lg2c && ./a.out