`pkg-config'
command (see http://pkgconfig.freedesktop.org/), wheres the second one uses `itpp-config'
script. These methods are shortly described below.`pkg-config'
is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler and linker options. The syntax of the `pkg-config'
is as follows:
% pkg-config <options> <library_name>
For instance, assuming that you need to compile an IT++ based program `my_prog.cpp'
, you should use the following command:
% g++ `pkg-config --cflags itpp` -o my_prog my_prog.cpp `pkg-config --libs itpp`
For more information see the `pkg-config'
man pages.
`itpp-config`
, which is installed by default in `$prefix/bin'
(`/usr/local/bin'
) directory. It can be used to simplify compilation and linking of IT++ based programs. The usage of this script is quite similar to the usage of the `pkg-config'
command.
Assuming that you need to compile the program `my_prog.cpp'
you can now do that with the following command:
% g++ `itpp-config --cflags` -o my_prog my_prog.cpp `itpp-config --libs`
If you would like to use the same optimisation flags (CXXFLAGS), as those used for compiling the IT++ library, you might try the following command:
% g++ `itpp-config --cflags-opt` -o my_prog_opt my_prog.cpp `itpp-config --libs-opt`
Moreover, if you compiled and installed the `libitpp_debug
.*' library by using `--enable-debug'
swich to configure, you can compile and link your program with debugging options using the following command instead:
% g++ `itpp-config --cflags-debug` -o my_prog_debug my_prog.cpp `itpp-config --libs-debug`
A list of `itpp-config'
options can be obtained by typing:
% itpp-config --help
If the `itpp-config'
command is not found by your shell, you should add its location `$prefix/bin'
to the PATH environment variable, e.g.:
% export PATH=/usr/local/bin:$PATH
`LD_LIBRARY_PATH'
environment variable might be used to inform the linker of the dynamic library location, e.g.: export LD_LIBRARY_PATH=<IT++ installation prefix>/lib:$LD_LIBRARY_PATH
To link your own programs with IT++ and ACML or MKL, several things need to be correctly set up in your project:
"Tools -> Options -> Projects and Solutions -> VC++ Directories -> Include files"
. Add a path to "<IT++ source directory>"
, e.g. "C:\itpp-3.10.10"
.
"Tools -> Options -> Projects and Solutions -> VC++ Directories -> Library files"
. Add a path to "<IT++ source directory>\win32\libs"
, e.g. "C:\itpp-3.10.10\win32\libs"
.
"C:\Program Files\AMD\acml<VERSION>\pgi32\lib"
or "C:\Program Files\Intel\MKL\<VERSION>\ia32\lib"
.
"Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies"
. There you need to add itpp_debug.lib
or itpp.lib
depending on whether the Debug or Release mode are being used. Furthermore, you need to add libacml_dll.lib
or mkl_c_dll.lib
, respectively.
Multi-threaded Debug
or Multi-threaded
. This option can be set in the menu "Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library"
.
_CRT_SECURE_NO_DEPRECATE
and _CRT_NONSTDC_NO_DEPRECATE
, which disable warnings on C Standard Library and POSIX-compilant function names, might be also added in "Project -> Properties -> Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions"
. Moreover, HAVE_ACML
or HAVE_MKL
definitions should be set up, depending on the installed library.Please note that Project settings for your program must be made for both the Debug and Release modes.
Generated on Wed Apr 18 11:23:36 2007 for IT++ by Doxygen 1.5.2