IPP Link Problem:
Link errors, like the dreaded unresolved external symbol error, keep cropping up and you cannot figure out which IPP lib files should be part of your link list when building your IPP application.
By default, the linker only includes, or extracts, those functions, or library members, that your application requests. In this case, it is perfectly acceptable to list ALL the IPP lib files in your link list. Using this approach can significantly simplify your build process bookkeeping. (Caution, a few rules do still apply.)
The IPP lib file link lists shown below should work for building your IPP application. This KB article is based on the v6.1.1 IPP library distribution, version 6.1 update 1 (v6.1.1.xxx).
The link lists below assume a Windows Visual Studio build environment. The basic idea also applies to Windows and Linux makefiles or scripted build environments. For the Linux OS and other operating system build environments you will need to change the extension of your lib filenames to match those for your environment.
- Static Link (thread-safe model):
ippacemerged.lib ippccemerged.lib ippchemerged.lib ippcvemerged.lib ippdcemerged.lib ippdiemerged.lib ippgenemerged.lib ippiemerged.lib ippjemerged.lib ippmemerged.lib ippremerged.lib ippscemerged.lib ippsemerged.lib ippsremerged.lib ippvcemerged.lib ippvmemerged.lib ippacmerged.lib ippccmerged.lib ippchmerged.lib ippcvmerged.lib ippdcmerged.lib ippdimerged.lib ippgenmerged.lib ippimerged.lib ippjmerged.lib ipprmerged.lib ippmmerged.lib ippscmerged.lib ippsmerged.lib ippsrmerged.lib ippvcmerged.lib ippvmmerged.lib ippcorel.lib
Note: These library files are located in the lib subdirectory in your IPP install directory. The “thread-safe” model means these libraries are safe to use within a multi-threaded application, even though this version of the library is not multi-threaded.
- Static Link (multi-threaded model):
ippacemerged.lib ippccemerged.lib ippchemerged.lib ippcvemerged.lib ippdcemerged.lib ippdiemerged.lib ippgenemerged.lib ippiemerged.lib ippjemerged.lib ippmemerged.lib ippremerged.lib ippscemerged.lib ippsemerged.lib ippsremerged.lib ippvcemerged.lib ippvmemerged.lib ippacmerged_t.lib ippccmerged.lib ippchmerged_t.lib ippcvmerged_t.lib ippdcmerged_t.lib ippdimerged_t.lib ippgenmerged_t.lib ippimerged_t.lib ippjmerged_t.lib ippmmerged_t.lib ipprmerged_t.lib ippscmerged_t.lib ippsmerged_t.lib ippsrmerged_t.lib ippvcmerged_t.lib ippvmmerged_t.lib ippcore_t.lib libircmt.lib svml_dispmt.lib libmmt.lib libiomp5md.lib
Note: library files in red are Intel Compiler support files and are needed if you are NOT using the Intel compiler to compile and link your application. The equivalent files on a Linux system are named libirc, libsvml, libimf, and libiomp5. these libraries are required to satisfy Intel compiler optimizations and OpenMP calls used by the IPP library, because the IPP libraries are created using the Intel compiler.
- Dynamic Link:
ippac.lib ippcc.lib ippch.lib ippcv.lib ippdc.lib ippdi.lib ippgen.lib ippi.lib ippj.lib ippm.lib ippr.lib ipps.lib ippsc.lib ippsr.lib ippvc.lib ippvm.lib ippcore.lib libiomp5md.lib
Note: libiomp5md.lib is the Intel OpenMP library file and is used by the IPP libraries to implement multi-threading. The equivalent file is named libiomp5 on a Linux system. These files are located in the stublib directory on a Windows system and in the sharedlib directory on a Linux system. You are not required to use OpenMP in your application when you include this library file, but it is required by some IPP library functions when mult-threading is enabled (the default case). To disable OpenMP threading, within the dynamic libraries, see the ippSetNumThread() function.
Note: libiomp5mt.lib and libiomp5md.lib are two different versions of the same Intel OpenMP library. The "t" version is a static link library and the "d" version is a dynamic link library. Both OpenMP libraries provide the same functionality. You are strongly encouraged to link against the dynamic version of the OpenMP library, regardless of how you link against the IPP library, in order to avoid conflicts associated with having multiple copies of the OpenMP library running on your system at the same time. One caveat is that linking against the "d" version of the OpenMP library will require that you redistribute the shared OpenMP library file (e.g., libiomp5md.dll) with your application, even if you have statically linked with the IPP library.
IPP Cryptography Library
The IPP cryptography library files are not included in the above lists, since they are not part of the standard product. If you are using the IPP cryptography library you will need to add those library files to your link list. The crypto files are named ippcp*.
About Link List Order
Thank you to my colleague Chao Yu who pointed out that the order of the link list is important for static libraries in a Linux environment, since many of the linkers used in this environment default to operating in a single-pass mode. In this case it is best to order the library files according to the following rule: *emerged.a first, followed by *merged.a and ending with ippcore.a. The lists above have been ordered to reflect that rule.
If you have problems with interdependencies between libraries causing link errors on a Linux system you may need to use the -( and -) options (or equivalent --start-group and --end-group options) with your Linux linker to force multi-pass behavior, at the expense of reduced linker performance.
Additionally, you can repeat the name of a library on the link list to resolve circular dependencies, without resorting to the -( and -) options; by listing a library file a second time after the archive that depends on that key library. The nm command can be used to list the object file names within a specific library archive so you can identify which library is needed to satisfy a missing dependency problem.
Obviously, you must also set your makefile or environment variables to point to the appropriate install directories. See the env and tools subdirectories for your IPP installation for more information or review the articles linked below.
Using Intel® IPP Threaded Static Libraries
Building a Windows* Application Using Intel® IPP
Compiling and Linking with Microsoft* Visual C++* and Intel® C++ Compiler
Error LNK2001: Unresolved External Symbol _ipp*
How to Build an Intel IPP Application
Intel® IPP - Intel® IPP Linkage Models - Quick Reference Guide
Intel® IPP- Library Dependencies by Domain
Intel® IPP - Threading / OpenMP* FAQ