`make --version'
)`gcc --version'
)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.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++.
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). To improve some vector based operations a C interface of BLAS, namely CBLAS, is also recommended.
Instead of NetLib's reference BLAS, CBLAS and LAPACK implementations, some optimized platform-specific libraries can be used as well, i.e.:
It is possible to compile and use IT++ without these libraries, but the functionality will be reduced. We therefore recommend that you take some time and effort to provide these external libraries in your system. Please note, that some of them (FFTW, BLAS and LAPACK) are usually included in the most modern Linux distributions.
itpp-<VERSION>
.tar.gz or itpp-<VERSION>
.tar.bz2, where <VERSION>
is the latest release number, e.g. 3.9.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 tools for configuration and Makefiles creation, 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 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>'
.
By default, the `configure'
script checks for a few external libraries, which might be used by the IT++ library (cf. IT++ Requirements). BLAS and LAPACK libraries require a fortran compiler for linking. Therefore, if no fortran compiler can be found, only some FFT library is searched. Otherwise, the detection procedure is as follows:
HAVE_BLAS
is defined.HAVE_CBLAS
is defined.HAVE_LAPACK
is defined.HAVE_FFT
id defined. Besides, one of the following: HAVE_FFT_MKL8
, HAVE_FFT_ACML
or HAVE_FFTW3
is defined.
If some external libraries are installed in a non-standard location in your system, e.g. MKL in `/opt/intel/mkl/8.0.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 the MKL 8.0.1 external library, which is installed in `/opt/intel/mkl/8.0.1'
directory, you should use the following commands:
% export LDFLAGS="-L/opt/intel/mkl/8.0.1/lib/32" % export CPPFLAGS="-I/opt/intel/mkl/8.0.1/include" % ./configure
In the case that external libraries have non-standard names, e.g. `libcblas-3.a'
for CBLAS, you might specify them to the configure using `--with-<LIBNAME>'
switches, where <LIBNAME>
is one of the following: `blas'
, `cblas'
, `lapack'
or `fft'
. You might use more then one library names by quoting them with doublequotes, 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'
.
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-cblas --without-lapack
It is recommended to set CXXFLAGS environment variable with some compiler- and platform-specific optimisation flags before invoking the `configure'
command. For example, in the case of using the Intel Pentium 4 processor one might employ the following flags:
% CXXFLAGS="-O3 -pipe -march=pentium4" ./configure
In the case of Sun's UltraSPARC 64-bit platform and GCC compiler, the flags might be set as follows:
% export CXXFLAGS="-O3 -pipe -mcpu=v9 -m64" % ./confiugre
If CXXFLAGS is not set in the environment, it will be initialised with the default flags, i.e. "-O3 -pipe"
.
When the configuration process is finished, a status message is displayed. For instance, after having invoked the following configuration command on a recent Gentoo Linux system:
% ./configure --with-blas="-lblas"
one can observe something like this:
------------------------------------------------------------------------------ itpp-3.10.7 library configuration: ------------------------------------------------------------------------------ Directories: - prefix ......... : /usr/local - exec_prefix .... : ${prefix} - includedir ..... : ${prefix}/include - libdir ......... : ${exec_prefix}/lib - docdir ......... : ${prefix}/share/doc/itpp-3.10.7 Switches: - debug .......... : no - exceptions ..... : no - html-doc ....... : yes - shared ......... : yes - static ......... : no Documentation tools: - doxygen ........ : yes - latex .......... : yes - dvips .......... : yes - ghostscript .... : yes Testing tools: - diff ........... : yes - sed ............ : yes External libs: - BLAS ........... : yes * MKL .......... : no * ACML ......... : no * ATLAS ........ : no - CBLAS .......... : yes - LAPACK ......... : yes - FFT ............ : yes * MKL .......... : no * ACML ......... : no * FFTW ......... : yes Compiler/linker flags/libs/defs: - CXX ............ : g++ - F77 ............ : gfortran - CXXFLAGS ....... : -DASSERT_LEVEL=1 -O3 -pipe - CXXFLAGS_DEBUG . : - CPPFLAGS ....... : - LDFLAGS ........ : - LIBS ........... : -lfftw3 -llapack -lcblas -lblas -lgfortran ------------------------------------------------------------------------------ Now type 'make && make install' to build and install itpp-3.10.7 library ------------------------------------------------------------------------------
Now, it is time for compiling and linking the IT++ library. To do so, please simply run the following command:
% make
IT++ should compile without any errors or warnings. If this is not the case, please submit a bug-report on the IT++ project page at SourceForge. Please include information about your OS, compiler version, external libraries and their versions, etc.
It is recommended that you check if your library has been compiled and linked properly and works as expected. To do so, you should execute the testing process:
% make check
As a result, you should obtain a similar report:
------------------------------------------------------------------------------ Test `array_test' PASSED. ------------------------------------------------------------------------------ Test `bessel_test' PASSED. ------------------------------------------------------------------------------ [...] ------------------------------------------------------------------------------ Test `reedsolomon_test' PASSED. ------------------------------------------------------------------------------ Test `turbo_test' PASSED. ------------------------------------------------------------------------------ Test `fix_test' PASSED. ------------------------------------------------------------------------------
Check if all the executed tests PASSED. If not, please contact us by filling a bug-report.
Finally, you should install the compiled and linked library, include files and (optionally) HTML documentation by typing:
% 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.
There is one known problem with configuration on MacOS X. Here is the error message that might occur:
checking for Fortran libraries of g77... -lcrt2.o -L/sw/lib/gcc/powerpc-apple-da rwin8.4.0/3.4.3 -L/sw/lib/gcc/powerpc-apple-darwin8.4.0/3.4.3/../../.. -lm -lfrt begin -lg2c -lSystemStubs -lSystem -lmx /usr/lib/gcc/powerpc-apple-darwin8/4.0.1 /libgcc.a checking for dummy main to link with Fortran libraries... unknown configure: error: linking to Fortran libraries from C fails See `config.log' for more details.
We have found out that this error is caused by a possible bug in an autoconf macro, which is responsible for setting FLIBS used for linking with fortran libraries. The problem is with "-lcrt2.o", which shouldn't be there.
The known solution is to set FLIBS by hand, e.g.:
% FLIBS="-L/sw/lib -lg2c" ./configure
or if it does not work, use the FLIBS detected by the autoconf omitting "-lcrt2.o":
% FLIBS="-L/sw/lib/gcc/powerpc-apple-darwin8.4.0/3.4.3 -L/sw/lib -lm -lfrtbegin -lg2c -lSystemStubs -lSystem -lmx /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/libg cc.a" % ./configure
BLAS and LAPACK support can be obtained with the vecLib
framework, but you must then use Apple's GCC compiler. Hence, only FFTW is then needed to be installed externally.
The philosophy behind this installation is:
The source code will reside in the directories itpp-external-2.3.0 and itpp-3.10.5. The libraries will be created in the directories it++external-2.3.0 and it++3.10.5.
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 xzf itpp-external-2.3.0.tar.gz % tar xzf itpp-3.10.5.tar.gz
% cd $HOME/itpp-external-2.3.0 % make distclean % ./configure --prefix=$HOME/it++external-2.3.0 --disable-shared [--enable-atlas] % make && make install
% export LDFLAGS=-L$HOME/it++external-2.3.0/lib % export CPPFLAGS=-I$HOME/it++external-2.3.0/include % cd $HOME/itpp-3.10.5 % make distclean % ./configure --disable-shared --enable-static --enable-debug --prefix=$HOME/it++3.10.5 % make && make install % make check
example.cpp:
#include <itpp/itbase.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(to_cvec(randn(10000))); cout << a(5) << endl; } it_assert0(1==0,"Debugging was on!"); }
Also, in the same directory, create the following Makefile:
FLAGS_DEBUG = `$(HOME)/it++3.10.5/bin/itpp-config --cflags-debug` FLAGS_OPT = `$(HOME)/it++3.10.5/bin/itpp-config --cflags-opt` LIBS_DEBUG = `$(HOME)/it++3.10.5/bin/itpp-config --libs-debug` LIBS_OPT = `$(HOME)/it++3.10.5/bin/itpp-config --libs-opt` 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-2.3.0 % make distclean % cd $HOME/itpp-3.10.5 % make distclean
To conserve even more diskspace (remove all sources) then do
% rm -rf $HOME/itpp-external-2.3.0 % rm -rf $HOME/itpp-3.10.5
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 decided 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. Intel's library is installed by default in the following directory: "C:\Program Files\Intel\MKL\<VERSION>"
. During the installation procedure, the installer ask if PATH, LIB and INCLUDE environment variables should be set appropriately. Check this option, since this step is required for for Windows to find the MKL dll files. The ACML is installed in "C:\Program Files\AMD\acml<VERSION>"
by default. After waiting a few dozens of seconds you should have the external libraries installed on your computer.
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 MSVC++ .NET project files itpp_acml.vcproj
and itpp_mkl.vcproj
in the win32
directory. Depending on the installed external libraries (ACML or MKL), open one of these project files in the MSVC++ .NET 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
. Both libraries are static ones and they should be created in win32/libs
directory. The current project files are configured for the MKL in version 8.1 and ACML in version 3.6.0. If you have different versions or/and you installed them in non-standard locations, please update the include paths in the relevant project files.
IT++ should compile and link without any warnings or errors. 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++ .NET.
Generated on Thu Apr 19 14:15:00 2007 for IT++ by Doxygen 1.5.1