1.1: About this document |
To use the Blitz++ library, you will need a compiler with near-ISO/ANSI C++ syntax support (see the following section for possible compilers). Information on what platforms are supported is available from http://oonumerics.org/blitz/platforms/. To download Blitz++, please go to the download page at http://oonumerics.org/blitz/download/.
If you need to do something that Blitz++ doesn't support, see a possible improvement, or notice an error in the documentation, please send a note to one of the Blitz++ mailing lists (described later).
1.2: Platform notes |
http://oonumerics.org/blitz/platforms/
The information in this document may be out of date.
1.2.1: KAI C++ |
Blitz++ was developed and tested using KAI C++ under AIX. It should (in theory) port to other KAI C++ platforms (Cray, SGI, HP, Sun, Linux, DEC) without difficulty. Since KAI C++ uses an EDG front end, other EDG front-ended compilers (e.g. Comeau) should be able to compile Blitz++.
1.2.2: Intel C++ |
Intel has a drop-in compiler based on the EDG front end. It used
to compile Blitz++, but since that time I've made use of some language
features it doesn't support. However, there is a new beta version
out (3.0) which may be able to compile Blitz++. Allan Stokes is
working on this.
More information:
http://developer.intel.com/design/perftool/icl24/
http://developer.intel.com/design/perftool/icl24/icl24wht.htm
1.2.3: gcc |
gcc (g++) is a free GNU C++ compiler. It compiles Blitz++ reliably,
in fact most Blitz++ development work is done with gcc may be downloaded from
http://gcc.cygnus.com/.
If you are using gcc under Solaris, SunOS, or OSF/1, please see the
README.binutils file included in the distribution.
g++
.
1.2.4: Metrowerks |
1.2.5: DECcxx |
The Digital C++ compiler is supported.
1.2.6: Cray T3E/Cray T90/Cray C90/Cray J90 |
As of Version 0.2-alpha-02 of Blitz++, Version 3.0.0.0 of the
Cray C++ compiler is supported (well, tolerated anyway).
It seems to be based on an older version of the EDG front
end, so some kludges are required. It doesn't support
partial ordering of member templates, so slicing arrays
requires the workaround described in Section 2.4.3.
Portions of the standard library are missing, such as
<limits>, <complex>, and <set>. This means you won't be
able to use complex numbers (well, not the ISO/ANSI C++
versions anyway), numeric inquiry functions, or
fast traversal orders.
These compilation flags are recommended:
For optimization, you'll want:
The ability of the Cray C++ compiler to optimize away temporary
objects is disappointing. It's not able to optimize away expression
templates overhead or comma-delimited array initializers.
-h instantiate=used
-O3 -h aggress
1.3: How to download Blitz++ |
To download the Blitz++ library, go to the Blitz++ download page, at http://oonumerics.org/blitz/download/
But please read the section on supported platforms and compilers first.
1.4: Installation and porting |
1.4.1: Installation |
Blitz++ uses GNU Autoconf, which handles rewriting Makefiles
for various platforms and compilers. It has greatly simplified
installation and porting. Many thanks for John W. Eaton
and Brendan Kehoe for their help with this.
To install blitz, unpack the blitz-VERSION.tar.gz
file (it will install into a subdirectory blitz-VERSION).
For example:
Then go into the main blitz directory, and type:
[tveldhui@n2001:~] 32: ls -l blitz*.gz
-rw-r--r-- 1 tveldhui users 480953 Jun 23 15:20 blitz-0.5.tar.gz
[tveldhui@n2001:~] 33: gunzip blitz-0.5.tar.gz
[tveldhui@n2001:~] 34: tar xvf blitz-0.5.tar
blitz-0.5/CHANGELOG
blitz-0.5/COPYING
blitz-0.5/INSTALL
blitz-0.5/Makefile.in
blitz-0.5/README
blitz-0.5/THANKS
.
.
1.4.2: The Blitz++ directory tree |
The main Blitz++ directory contains these subdirectories:
blitz/
random/
compiler/
bzconfig
script is used
to test a compiler for ISO/ANSI C++ compatability. This script creates
the blitz/config.h
header file, which may enable various kludges
to compensate for deficiencies of your compiler.
examples/
manual/
benchmarks/
testsuite/
src/
libblitz.a
lib/
libblitz.a
lives.
1.4.3: Porting Blitz++ |
If you want to try porting Blitz++ to a new compiler or platform,
I suggest the following approach:
Blitz++ follows an X-windows style convention for header files.
All headers are referred to with a prefix of "blitz/".
For example, to use the If you have root privileges, you may want to put in a symbolic
link from the standard include path (e.g.
The Blitz++ library file
It is not possible to do explicit instantiation of Blitz++
arrays. If you aren't familiar with explicit instantiation of
templates, then this fact will never bother you.
The reason is that explicit instantiation results in all members
of a class template being instantiated. This is not the case
for implicit instantiation, in which only required members are
instantiated. The then you will be rewarded with many compile errors, due to methods
such as As some consolation, explicit instantiation would not be much
help with Blitz++ arrays. The typical use for explicit instantiation
is to instantiate all the templates you need in one
compilation unit, and turn off implicit instantiation in the
others -- to avoid duplicate instantiations and reduce compile times.
This is only possible if you can predict
ahead of time what needs instantiation. Easy for simple templates,
but impossible for classes like
The Blitz++ library is licensed under both the GPL and the more permissive
"Blitz++ Artistic License". Take your pick. They are detailed in GPL
and LICENSE, respectively. The artistic license is more appropriate for
commercial use, since it lacks the "viral" properties of the GPL.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
The starting point for all bug reports, feature requests and
support questions is the Blitz++ support page, at
http://oonumerics.org/blitz/support/
Please note the search engine box on this web page which lets you search
the mailing list archives. This will often turn up answers to your
question if it has been asked before.
Blitz++ is in open development: anyone can contribute features and
code to the library. If you are interested in helping out with
coding or porting, you should start by subscribing to the This list is also the appropriate place to send suggestions for
features; just send email to Archives of this list are available from the Blitz++ web site.
1.5: Compiling with Blitz++
1.5.1: Header files Array<T,N>
class, one needs to include
<blitz/array.h>
instead of just <array.h>
.
To make this work, the main Blitz++ directory must be in
your include path. For example, if Blitz++ was installed
in /software/Blitz++
, you will need to compile with
-I /software/Blitz++
.
/usr/include/blitz/
)
to the blitz
directory of the distribution. This will
allow you to omit the -I ...
option when compiling.
1.5.2: Linking to the Blitz++ library libblitz.a
contains a few pieces of
global data. You should ensure that the "lib/" subdirectory of the
Blitz++ distribution is in your library path
(e.g. -L/usr/local/blitz-0.5/lib
) and include
-lblitz
on your command line. If you use math functions,
you should also compile with -lm
.
1.5.3: An example Makefile 1.5.4: Explicit instantiation Array<T,N>
class contains members which
are not valid for all types T
: for example, the
binary AND operation &=
is nonsensical if T=float
.
If you attempt to explicitly instantiate an array class, e.g.
template class Array<float,3>;
&=
which are nonsensical for float
.
Array
. Almost every line of code
you write using Array
will cause a different set of things to be
implicitly instantiated.
1.6: Licensing terms
1.7: Mailing lists and support
1.7.1: How to get help 1.7.2: How to subscribe to a mailing list 1.7.3: blitz-bugs 1.7.4: blitz-dev blitz-dev
mailing list.
blitz-dev@oonumerics.org
.
We can't implement it if you don't suggest it.
1.7.5: blitz-support