| June 18, 2009 9:00 AM PDT | |
Intel® Integrated Performance Primitives (Intel® IPP)
Intel® IPP linkage models - quick reference guide
- Overview
- Dynamic linkage
- Custom dynamic linkage
- Single processor static linkage
- Static linkage with dispatching
- Quick comparison of the four linkage models
Please notes: the IPP directory structure and library name changed in 7.0 and later. You may change the directory or library name correspondingly. See the article New Directory Structure and Library Naming in IPP and IPP 7.0 - Selecting the Intel(R) IPP Libraries Needed by Your Application ![]()
The Intel® IPP is organized by three types of library files:
|
These libraries offer various linkage models for different needs. The following are the four linkage models supported by the Intel® IPP:
- Dynamic linkage
- Custom dynamic linkage
- Single processor static linkage
- Static linkage with dispatching
Steps to quickly demonstrate each linkage model are listed below. This code is used to illustrate the different linkage models:
#include "ipp.h" |
- Add ipp.h which will include the “include” files of all IPP domains,
- Use the normal IPP function names when calling IPP functions,
- Link corresponding domain import libraries. For example, if you use the ippsCopy_8u function, link against ipps.lib from directory \stublib.
- Make sure that run-time libraries, for example ipps.dll, are on the executable search path at run time. Run the ippenv.bat from directory \tools\env to ensure this application built with the Intel IPP dynamic libraries will load the appropriate processor-specific DLL.
- Copy the function names of all Intel® IPP functions used from the Intel® IPP files into the file export.def. For our code example the content of this file is:
EXPORTS
ippsCopy_8u - Write a DLL initialization function called DllMain in mydll.c, and call the function ippStaticInit inside of DllMain to initialize the dispatching mechanism
- Compile mydll.c as a dynamic link library and link it against ippsemerged.lib , ippsmerged.lib and ippcorel.lib . The import library mydll.lib will be generated automatically.
//=========== mydll.c====================== |
There is another way to create a custom DLL that allows more customization. You can define CPU specific code for your targeted processor. For example "w7" code is for Intel® Pentium® 4 processor. Please refer the latest updated customdll samples from Intel IPP samples directory:
\ipp-samples\advanced-usage\linkage\customdll
- Include ipp.h in your code,
- Before calling any Intel IPP functions, initialize the static dispatcher using either the function ippStaticInit() or ippStaticInitCPU()declared in ippcore.h
- Use the normal IPP function names to call IPP functions,
- Link corresponding e-merged libraries followed by merged libraries, and then ippcorel.lib. For example, if the function ippsCopy_8u() is used, the linked libraries are ippsemerged.lib, ippsmerged.lib, and ippcorel.lib.
- Include ipp.h , after the header ipp_w7.h (In case of Pentium® 4).
- Add the file ippsmerged.lib to your project and its source tree.
- Include ipp_w7.h for Intel Pentium 4 processor, this inclusion must be before the other Intel IPP header files.
- Add the file ippcorel.lib to your project and its source tree.
- Call Intel IPP functions normally from your application.
See also Static linking to Intel® IPP Functions for One Processor in
C:\ProgramFiles\Intel\IPP\6.0.x.xxx\ia32\tools\staticlib\readme.htm
|
For more information about the above linkage models, please refer to the Intel® IPP white paper:
Choosing the best Intel® IPP Linkage Models for Your Applications.
Windows* XP Professional x64 Edition, Windows Server* 2003 Standard x64 Edition, Windows Server* 2003 Enterprise x64 Edition, Mac OS*, Windows* XP 64-Bit Edition, Windows* XP Professional, Windows* XP Home Edition, Red Hat* Linux 8.0, Red Hat* Linux Advanced Server 2.x, Windows Server* 2003, Red Hat* Linux 9.0, Red Hat* Enterprise Linux 3.0, SUSE* Linux* 8.2, Windows Server* 2003 Standard Edition, Red Hat* Linux Advanced Server 3.x, Windows* XP 64-Bit Edition Version 2003
In this example, our target system processor is an Intel Pentium 4 processor:
This article applies to: Intel® Integrated Performance Primitives Knowledge Base
For more complete information about compiler optimizations, see our Optimization Notice.



Sergey Kostrov
27,159