Statically linking MKL library and IPP library in same project produce the link errors

Problem Description:     Statically linking MKL and IPP in the same project produce the link errors like the following:

1>ipps_l.lib(pscopyg9as_g9.obj) : error LNK2005: _g9_ownsSet_32s_G9 already defined in mkl_core.lib(pscopyg9as_20120907.obj)

1>ipps_l.lib(pscopyg9as_g9.obj) : error LNK2005: _g9_ownsSet_16u_G9 already defined in mkl_core.lib(pscopyg9as_20120907.obj)

1>ipps_l.lib(pscopyg9as_g9.obj) : error LNK2005: _g9_ownsSet_8u_G9 already defined in mkl_core.lib(pscopyg9as_20120907.obj)

1>ipps_l.lib(pscopyg9as_g9.obj) : error LNK2005: _g9_ownsZero_8u_G9 already defined in mkl_core.lib(pscopyg9as_20120907.obj)

1>ipps_l.lib(pscopyg9as_g9.obj) : error LNK2005: _g9_ownsCopy_8u_G9 already defined in mkl_core.lib(pscopyg9as_20120907.obj)

Reference Number of the issue: DPD200304564

Cause:     The cause of the problem is that MKL internally uses a few IPP functions and they added a few IPP symbols into the MKL libraries. 

Products :  Intel® Math Kernel Library (Intel® MKL), Intel® Performance Library (Intel® IPP)

Versions:    Intel® MKL 10.3, 11.0, Intel® IPP 7.0, 7.1

Operating Systems:   all supported OS's including Windows, Linux and OS X*.

Solutions :   There are several workarounds of this problem:

  • The possible workaround is to link one of libraries (IPP or MKL) with dynamic libs.
  • Using Custom dll based on the mkl functions. The tools for build MKL custom dll can be found into <MKL_ROOT>\tools\builder.
  • Changing  the order of libraries while linking: ipp's then mkl's. It should helps for Windows. As an example for win32 it should looks like: ippcore_l.lib;ippi_l.lib;ipps_l.lib; mkl_intel_c.lib;mkl_intel_thread.lib;mkl_core.lib;libiomp5md.lib;%(AdditionalDependencies)    and the similar for win64:  ipps_l.lib;ippi_l.lib;ippcore_l.lib; mkl_intel_lp64.lib;mkl_intel_thread.lib;mkl_core.lib; libiomp5md.lib

 

Resolution Status:

The problem is escalated and MKL team is working on that. The status of the issue would be updated as soon as the fix would be available into official release of MKL.

Please stay tuned.

 

 

有关编译器优化的更完整信息,请参阅优化通知