Saturday, April 16, 2011

PKG-CONFIG with INTEL IPP

Intel® Integrated Performance Primitives Performance Library is used with OPENCV.
The pkg-config is a nice tool to compile your programs, because you don't need define a lot of libraries in the Makefile.
Here I made a pkg-config file for IPP, which can be copied to your local lib directory.
In general, you can put it in "/usr/local/lib/pkgconfigs".

First create a .pc file in above directory, here we give it a name: ipp.pc, then copy following contents to the file:
"
# Package Information for pkg-config

prefix=/opt/intel
exec_prefix=${prefix}/ipp
ipp_libdir=${exec_prefix}/lib/ia32
intel_libdir=${prefix}/lib/ia32
includedir=${exec_prefix}/include

Name: INTEL_IPP
Description: Intel Integrated Performance Primitives Performance Library
Version: 3.2
Libs: -L${ipp_libdir} -lippac -lippcc -lippch -lippcore -lippcv -lippdc -lippi -lippdi -lippj -lippm -lippr -lippsc -lipps -lippvc -lippvm -L${intel_libdir} -lcxaguard -limf -lintlc -liomp5 -liompprof5 -liompstubs5 -lirc -lomp_db -lpdbx -lsvml
Cflags: -I${includedir}
"
Where we assume the ipp is installed under the folder /opt.

Here is a example which introduce how to use it in the Makefile:

PKG=`pkg-config opencv ipp --cflags --libs`
Matrix.o: Matrix.cpp Matrix.h
gcc -g -c Matrix.cpp $(PKG)

No comments: