![]() |
Since Blaze is a header-only library, setting up the Blaze library on a particular system is a fairly easy two step process. In the following, this two step process is explained in detail, preceded only by a short summary of the 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.
The first step is the installation of the header files. Since Blaze only consists of header files, the ./blaze
subdirectory can be simply copied to a standard include directory (note that this requires root privileges):
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 named 'Jon', the environment variable can be set as follows:
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:
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.
The second step is the configuration and customization of the Blaze library. Many aspects of Blaze can be adapted to specific requirements, environments and architectures by customizing the header files in the ./blaze/config/
subdirectory. Since the default settings are reasonable for most systems this step can also be skipped. However, in order to achieve maximum performance a customization of at least the following configuration files is required:
./blaze/config/BLAS.h
: Via this configuration file Blaze can be enabled to use a third-party BLAS library for several basic linear algebra functions (such as for instance dense matrix multiplications). In case no BLAS library is used, all linear algebra functions use the default implementations of the Blaze library and therefore BLAS is not a requirement for the compilation process. However, please note that performance may be limited../blaze/config/CacheSize.h
: This file contains the hardware specific cache settings. Blaze uses this information to optimize its cache usage. For maximum performance it is recommended to adapt these setting to a specific target architecture../blaze/config/Thresholds.h
: This file contains all thresholds for the customization of the Blaze compute kernels. In order to tune the kernels for a specific architecture and to maximize performance it can be necessary to adjust the thresholds, especially for a parallel execution (see Shared Memory Parallelization).For an overview of other customization options and more details, please see the section Configuration Files.
Next: Getting Started