`make --version'
or `gmake --version`
)`gcc --version'
)We strongly recommend that you use recent stable releases of the GCC, if possible. We do not actively work on supporting older versions of the GCC, and they may therefore (without prior notice) become unsupported in future releases of IT++.
Instead of using GCC, you might try to build and link the IT++ library using other C/C++/Fortran compilers. For instance, Intel C++ (icpc) and Fortran (ifc) compilers are known to work well.
To perform tests, two command line programs: sed
and diff
are required. Optionally, you might need a few additional programs, i.e. Doxygen, LaTeX, Dvips and Ghostscript, to generate the HTML documentation. The HTML documentation for each release is also available as separate packages for download, so you do not need to generate it during the installation.
In order to use all functionality provided by the IT++ library, it is recommended that you have some external libraries compiled and installed in your computer. The basic set of them is: BLAS, LAPACK and FFTW (version 3.0.0 or later).
Instead of NetLib's reference BLAS and LAPACK implementations, some optimized platform-specific libraries can be used as well, i.e.:
Except the Intel MKL, the above mentioned BLAS/LAPACK implementations require additional support libraries provided by a Fortran compiler. To use them with IT++, please make sure that you have the compatible Fortran compiler installed. For instance, if your system BLAS and LAPACK libraries were compiled and linked with GNU g77, you should have the same compiler installed on your system before starting the IT++ configuration process.
It is possible to compile and use IT++ without these external libraries, but the functionality will be reduced. Therefore, we recommend that you take some time and effort to provide these external libraries in your system. Please note that the basic set of them (FFTW, BLAS and LAPACK) is usually included in most modern Linux distributions.
itpp-<VERSION>
.tar.gz or itpp-<VERSION>
.tar.bz2, where <VERSION>
is the latest release number, e.g. 4.0.0.
% gzip -cd itpp-<VERSION>.tar.gz | tar xf - % cd itpp-<VERSION>
% bzip2 -cd itpp-<VERSION>.tar.bz2 | tar xf - % cd itpp-<VERSION>
Since version 3.9.0, the IT++ library uses autoconf, automake and libtool for preparing Makefiles and configuration script, so the compilation procedure resembles a standard, well-known GNU method, i.e.
% ./configure % make
The `configure'
command can be invoked with additional switches and options (run `./configure --help'
to get a full list of them). The most important are:
`--prefix=PREFIX'
- set top installation directory to a certain PREFIX
value. By default it is set to `/usr/local'
, so `make install'
will install appropriate files into `/usr/local/include'
, `/usr/local/lib`
, etc.`--enable-debug'
- build an extra library named `libitpp_debug
.*' using special debugging flags for compiler and linker (disabled by default)`--enable-exceptions'
- enable exceptions handling of run-time errors instead of aborting the program (disabled by default)`--disable-html-doc'
- do not generate and install the HTML documentation (enabled by default)`--disable-shared'
- do not build the shared version of the library (enabled by default for non Windows based platforms)`--disable-static'
- do not build the static version of the library (enabled by default for Windows based platforms)`--enable-<OPTION>'
switch can be replaced with its opposite switch `--disable-<OPTION>'
.`--disable-comm'
- do not build the `Communications' module`--disable-fixed'
- do not build the `Fixed-point' module`--disable-optim'
- do not build the `Numerical optimisations' module`--disable-protocol'
- do not include the `Protocols' module`--disable-signal'
- do not build the `Signal processing' module`--disable-srccode'
- do not build the `Source coding' module`configure'
script checks for a few external libraries, which might be used by the IT++ library (cf. IT++ Requirements). The detection procedure is as follows:HAVE_BLAS
is defined.HAVE_LAPACK
is defined.HAVE_FFT
id defined. Besides, one of the following: HAVE_FFT_MKL
, HAVE_FFT_ACML
or HAVE_FFTW3
is defined, respectively.
If some external libraries are installed in a non-standard location in your system, e.g. MKL in `/opt/intel/mkl/9.1'
, the `configure'
script will not detect them automatically. In such a case, you should use LDFLAGS and CPPFLAGS environment variables to define additional directories to be searched for libraries (LDFLAGS) and include files (CPPFLAGS). For instance, to configure IT++ to link to 32-bit versions of MKL 9.1 external libraries, which is installed in `/opt/intel/mkl/9.1'
directory, you should use the following commands:
% export LDFLAGS="-L/opt/intel/mkl/9.1/lib/32" % export CPPFLAGS="-I/opt/intel/mkl/9.1/include" % ./configure
Instead of CPPFLAGS, one can use `--with-fft-include=<PATH>'
configure option to set path to header files that provide FFT functionality, i.e. to `fftw3.h'
, `mkl_dft.h'
or `acml.h'
.
In the case that external libraries have non-standard names, e.g. `libblas3.a'
for BLAS, you might specify them to the configure using `--with-<LIBNAME>'
switches, where <LIBNAME>
is one of the following: `blas'
, `lapack'
or `fft'
. You might use more than one library names by quoting them, e.g.
% ./configure --with-blas="-latlas -lblas"
If there is only one library specified, you can use a simplified notation without the preceding `-l', e.g. `--with-fft=fftw3'
instead of `--with-fftw=-lfftw3'
.
Please refer to the documentation of your external libraries, to find out what are the correct library names and paths on your architecture, operating system, etc.
Since 4.0.3 release, the configure script provides a new `--with-zdotu=<method>'
option. It can be used to force the default calling convention of BLAS `zdotu_'
Fortran function. The BLAS libraries built with g77 compiler do not return the complex result of a function, but pass it via the first argument of the function. By using `--with-zdotu=void'
option, this approach can be forced (g77 compatible). On the other hand, the libraries built with a newer gfortran compiler return the complex result like a normal function does, but calling such interface from C++ is not portable, due to incompatibilities between C++ complex<double> and Fortran's COMPLEX. Therefore in such case a Fortran wrapper function `zdotusub_'
can be used (`--with-zdotu=zdotusub'
), however it requires a working Fortran compiler. By default, IT++ tries to guess the proper method based on the detected BLAS implementation. For instance, the BLAS library provided by Intel MKL works fine with the `void' method. Eventually, if no Fortran compiler is available and the `void' method can not be used, the zdotu_
BLAS function is not used at all and a relevant warning message is displayed during the configuration step.
Although it is not recommended, you can intentionally prevent detection of some external libraries. To do this you should use `--without-<LIBNAME>'
or `--with-<LIBNAME>=no'
, e.g.:
% ./configure --without-blas --without-lapack
`configure'
command. Additionally, `-DNDEBUG'
should be included in the optimised CXXFLAGS, because it turns off all conditional assertion checks. This will improve the computation performance of many IT++ functions. For example, in the case of using the Intel Pentium 4 processor one might employ the following flags:
% CXXFLAGS="-DNDEBUG -O3 -march=pentium4 -pipe" ./configure
In the case of Sun's UltraSPARC 64-bit platform and GCC compiler, the flags might be set as follows:
% export CXXFLAGS="-DNDEBUG -O3 -mcpu=v9 -m64 -pipe" % ./confiugre
If CXXFLAGS is not set in the environment, it will be initialised with the default flags, i.e. "-DNDEBUG -O3 -pipe"
.
% ./configure --with-blas="-lblas"
on a recent Gentoo Linux system with blas-atlas, lapack-atlas and fftw packages installed, one can observe something like this:
------------------------------------------------------------------------------ itpp-4.0.3 library configuration: ------------------------------------------------------------------------------ Directories: - prefix ......... : /usr/local - exec_prefix .... : ${prefix} - includedir ..... : ${prefix}/include - libdir ......... : ${exec_prefix}/lib - datarootdir .... : ${prefix}/share - docdir ......... : ${datarootdir}/doc/${PACKAGE_TARNAME} Switches: - debug .......... : no - exceptions ..... : no - html-doc ....... : yes - shared ......... : yes - static ......... : no - explicit deps .. : no - zdotu .......... : zdotusub Documentation tools: - doxygen ........ : yes - latex .......... : yes - dvips .......... : yes - ghostscript .... : yes Testing tools: - diff ........... : yes Optional modules: - comm ........... : yes - fixed .......... : yes - optim .......... : yes - protocol ....... : yes - signal ......... : yes - srccode ........ : yes External libs: - BLAS ........... : yes * MKL .......... : no * ACML ......... : no * ATLAS ........ : yes - LAPACK ......... : yes - FFT ............ : yes * MKL .......... : no * ACML ......... : no * FFTW ......... : yes Compiler/linker flags/libs/defs: - CXX ............ : g++ - F77 ............ : gfortran - CXXFLAGS ....... : -DNDEBUG -O3 -pipe - CXXFLAGS_DEBUG . : - CPPFLAGS ....... : - LDFLAGS ........ : - LIBS ........... : -lfftw3 -llapack -lblas ------------------------------------------------------------------------------ Now type 'make && make install' to build and install itpp-4.0.3 library ------------------------------------------------------------------------------
% make
IT++ should compile without any errors or warnings. If this is not the case, please report the problem on the IT++ Help forum at SourceForge. Please include information about your OS, compiler version, external libraries and their versions, etc.
% make check
As a result, you should obtain a similar report:
------------------------------------------------------------------------------ Test `array_test' PASSED. ------------------------------------------------------------------------------ Test `bessel_test' PASSED. ------------------------------------------------------------------------------ [...] ------------------------------------------------------------------------------ Test `window_test' PASSED. ------------------------------------------------------------------------------ Test `histogram_test' PASSED. ------------------------------------------------------------------------------ Test `stat_test' PASSED. ------------------------------------------------------------------------------
Check if all the executed tests PASSED. If not, please report the problem on the IT++ Help forum.
% make install
Depending on the PREFIX
settings during configuration, you might need the root (administrator) access to perform this step.
Eventually, you might invoke the following command
% make clean
to remove all files created during compilation process, or even
% make distclean
to remove all files generated by the `configure'
script.
The philosophy behind this installation is:
The source code will reside in the directories itpp-external-3.0.0 and itpp-4.0.0. The libraries will be created in the directories it++external-3.0.0 and it++4.0.0.
The installation procedure goes as follows ($HOME
can be replaced by any directory where you have write access):
$HOME
directory, and unpack them: % cd $HOME % tar jzf itpp-external-3.0.0.tar.bz2 % tar jzf itpp-4.0.0.tar.bz2
% cd $HOME/itpp-external-3.0.0 % make distclean % ./configure --prefix=$HOME/it++external-3.0.0 --disable-shared --enable-static % make && make install
% export LDFLAGS=-L$HOME/it++external-3.0.0/lib % export CPPFLAGS=-I$HOME/it++external-3.0.0/include % cd $HOME/itpp-4.0.0 % make distclean % ./configure --disable-shared --enable-static --enable-debug --prefix=$HOME/it++4.0.0 % make && make check && make install
example.cpp:
#include <itpp/itsignal.h> using namespace itpp; using namespace std; int main() { for (int i = 0; i < 10; i++) { mat X = randn(500, 500); mat Z = chol(X * X.transpose()); cout << Z(0, 0) << endl; } for (int i = 0; i < 10; i++) { cvec a = fft(randn_c(10000)); cout << a(5) << endl; } it_assert_debug(1 == 0, "Debugging is on!"); }
Also, in the same directory, create the following Makefile:
FLAGS_DEBUG = `$(HOME)/it++4.0.0/bin/itpp-config --debug --cflags` FLAGS_OPT = `$(HOME)/it++4.0.0/bin/itpp-config --cflags` LIBS_DEBUG = `$(HOME)/it++4.0.0/bin/itpp-config --debug --static --libs` LIBS_OPT = `$(HOME)/it++4.0.0/bin/itpp-config --static --libs` example: example.cpp g++ $(FLAGS_DEBUG) example.cpp -o example_debug $(LIBS_DEBUG) g++ $(FLAGS_OPT) example.cpp -o example_opt $(LIBS_OPT)
This Makefile
produces two programs: example_opt
and example_debug
. The former is optimized for performance but offers no debugging or assertions. The latter includes debugging info and is compiled with all assertions enabled (this generally gives "safe" but slow code).
Run make
and try the programs example_opt
and example_debug
. If this works the library is ready to use. (The program example_debug
should exit with an assertion error.)
% cd $HOME/itpp-external-3.0.0 % make distclean % cd $HOME/itpp-4.0.0 % make distclean
To conserve even more diskspace (remove all sources) then do
% rm -rf $HOME/itpp-external-3.0.0 % rm -rf $HOME/itpp-4.0.0
Note: the make
distclean
commands in some steps may result in an error message; just ignore this. But the command is recommended because it guarantees that you start with a clean directory, in the event you would repeat the installation procedure.
First, you need to install ACML or MKL in your system. If you decide to use ACML, please download the library built with PGI compiler for Windows, e.g. acml3.6.0-32-pgi.exe
file for 32-bit systems. Please follow the default installation steps of the ACML or MKL installer. After waiting a few dozens of seconds you should have the chosen external libraries installed on your computer. Finally, you need to set up a few environment variables, so the library and include files can be found during compilation and linking of the IT++ library. These environment variables are as follows:
INCLUDE
- specifies the path to header files, e.g. INCLUDE="C:\Program Files\AMD\acml3.6.0\pgi32\include"
for ACML 3.6.0 or INCLUDE="C:\Program Files\Intel\MKL\9.1\include"
for MKL 9.1LIB
- specifies the path to library files, e.g. LIB="C:\Program Files\AMD\acml3.6.0\pgi32\lib"
or LIB="C:\Program Files\Intel\MKL\9.1\ia32\lib"
PATH
- specifies the runtime path to DLL libraries, e.g. PATH="C:\Program Files\AMD\acml3.6.0\pgi32\lib"
or PATH="C:\Program Files\Intel\MKL\9.1\ia32\bin"
PATH
environment variable is usually already defined, so you should just append the runtime path to DLL libraries to the existing PATH
, using a semicolon as a separation character.
The next step is to compile and link the IT++ library. Assuming that you have already downloaded and unpacked the IT++ package, you should find the itpp_acml.vcproj
and itpp_mkl.vcproj
MSVC++ project files in the win32
directory. Depending on the installed external library (ACML or MKL), open one of these project files in the MSVC++ IDE environment. There are two default targets prepared for compilation and linking: Debug
and Release
. The former can be used to compile a non-optimised version of the library for debugging purposes, named itpp_debug.lib
, whereas the latter one should produce an optimised library named itpp.lib
, which is also used by test programs. Both libraries will be created in win32\lib
directory. IT++ should compile and link without any warnings or errors.
Last but not least, test programs can be compiled and linked to IT++ with MKL or ACML by using the project files included in win32\itpp_mkl_tests
or win32\itpp_acml_tests
respectively. The resulting executable test files should be created in win32\bin
directory. Currently there is no automated method for comparing the output of these test programs with the reference files (*.ref
) located in tests
directory.
To learn how to set up your own project for linking with the IT++ library and ACML or MKL, please read the following manual: Linking your own programs with IT++ using MSVC++.
Generated on Sat Apr 19 10:41:17 2008 for IT++ by Doxygen 1.5.5