Configuration and Installation

Setting up the Blaze library on a particular system is a fairly easy two step process. Since Blaze is a template library and therefore mainly consists of header files no compilation is required. In the following, this two step process is explained in detail, preceded only by a short summary of the requirements.


Requirements


In order for Blaze to work properly, the Boost library must be installed on the system. It is recommended to use the newest Boost library available, but Blaze requires at minimum the Boost version 1.54.0. If you don't have Boost installed on your system, you can download it for free from 'http://www.boost.org'.

Additionally, for maximum performance Blaze expects you to have a BLAS library installed (Intel MKL, ACML, Atlas, Goto, ...). If you don't have a BLAS library installed on your system, Blaze will still work and will not be reduced in functionality, but performance may be limited. Thus it is strongly recommended to install a BLAS library.

Furthermore, for computing the determinant of a dense matrix and for the dense matrix inversion Blaze requires LAPACK. When either of these features is used it is necessary to link the LAPACK library to the final executable. If no LAPACK library is available the use of these features will result in a linker error.


Step 1: Configuration


Linux/MacOSX User

The first step is to adapt the Configfile in the Blaze home directory to the local configuration. Any text editor can be used for this task:

vi ./Configfile

In the Configfile, the kind of installation (debug or release), the library types (static and/or dynamic), the compiler including compiler flags, and several include paths have to be specified. Afterwards, the configure script can be run, which uses the Configfile to update and create several files:

./configure

This step can also be omitted, but results in a default configuration that does not guarantee the highest performance for all operations. For instance, without running the configure script, Blaze assumes that no BLAS library is installed on the system and cannot use BLAS functionality for instance for the matrix/matrix multiplication.

In order to further customize the Blaze library the header files in the ./blaze/config/ subdirectory can be adapted. See section Configuration Files for more details.


Windows User

Unfortunately, for Windows users there is no configure script available (yet). Therefore Windows user have to manually configure the Blaze library. Most configuration headers are located in the ./blaze/config/ subdirectory. The one exception is the BLAS.h header in the ./blaze/system/ subdirectory that contains the configuration of the BLAS functionality. Note that in case the BLAZE_BLAS_MODE symbol is set to 1, the correct BLAS header file has to be specified!


Step 2: Installation


Linux/MacOSX User

The second step is the installation of the header files. Since Blaze mainly consists of header files, the ./blaze subdirectory can be simply copied to a standard include directory (note that this requires root privileges):

cp -r ./blaze /usr/local/include

Alternatively, on Unix-based machines (which includes Linux and Mac OS X) the CPLUS_INCLUDE_PATH environment variable can be set. The specified directory will be searched after any directories specified on the command line with the option -I and before the standard default directories (such as /usr/local/include and /usr/include). Assuming a user misterX, the environment variable can be set as follows:

CPLUS_INCLUDE_PATH=/usr/home/misterX/blaze
export CPLUS_INCLUDE_PATH

Last but not least, the ./blaze subdirectory can be explicitly specified on the command line. The following example demonstrates this by means of the GNU C++ compiler:

g++ -I/usr/home/misterX/blaze -o BlazeTest BlazeTest.cpp


Windows User

Windows doesn't have a standard include directory. Therefore the Blaze header files can be copied to any other directory or simply left in the default Blaze directory. However, the chosen include directory has to be explicitly specified as include path. In Visual Studio, this is done via the project property pages, configuration properties, C/C++, General settings. Here the additional include directories can be specified. Note that there are small differences between VS2008 and VS2010: VC++ Directories.


Step 3 (Optional): Compilation


Linux/MacOSX User

Next to the math library, Blaze also contains a small number of additional (sub-)libraries. If these libraries, such as the blaze::logging functionality, are required it is necessary to create the Blaze library files. For that purpose, the configure script has created a Makefile that can be used for the compilation process:

make

Afterwards, the libblaze.so and/or libblaze.a libraries are contained in the lib subdirectory and can be copied to a standard library directory (note that this requires root privilages). However, this step can be omitted if only the Blaze math library is required.

cp ./lib/* /usr/local/lib

Alternatively, on Unix-based systems the LD_LIBRARY_PATH environment variable can be extended to also consider the Blaze lib directory:

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/home/misterX/blaze/lib
export LD_LIBRARY_PATH


Windows User

For Windows users, a comfortable compilation of the extended Blaze features is not (yet) supported.


Next: Getting Started