Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6749 Discussions

__You_must_link_with_Microsoft_OpenMP_library

lamoid
Beginner
786 Views
The IPP libs are a joy to use and have greatly improved the speed of our code. The use of Intel's OpenMP library has been a big part of that.

I recently switched from Visual Studio 2005 to visual studio 2008. Much of my code uses the intel OpenMP library, libiomp5md.lib. I had no problems at all with it in VS 2005. Now I get the fatal error

__You_must_link_with_Microsoft_OpenMP_library

in any code that explicitly invokes OpenMP. For example the following snippet from OpenCV elicits the error

// begin example
#ifdef _OPENMP
#pragma omp parallel sections num_threads(n)
#endif
{
#ifdef _OPENMP
#pragma omp section
#endif
icvPrefilter( left0, &left, state->preFilterSize,
state->preFilterCap, state->slidingSumBuf->data.ptr );
#ifdef _OPENMP
#pragma omp section
#endif
icvPrefilter( right0, &right, state->preFilterSize,
state->preFilterCap, state->slidingSumBuf->data.ptr + bufSize1*(n>1) );
}
// end example

I have followed the instructions given in the knowledge base. To that end I have included

libiomp5md.lib ippac.lib ippcc.lib ippch.lib ippcore.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 user32.lib advapi32.lib gdi32.lib quartz.lib strmbasd.lib strmiids.lib amstrmid.lib dmoguids.lib

in the linker specs and I have excluded vcomp.lib;vcomp90.lib;vcompd.lib;vcomp90d.lib;libguide.lib;libguide40.lib;libmmd.lib;libmmdd.lib

This was sufficient in VS 2005 but does not work now with 2008.

Also FYI here are the command lines for both C++ and the linker for the programs that give the error

// begin C++ command line from studio 2008
/Od
/I "C:\Program Files (x86)\Intel\IPP\6.1.1.035\ia32\include"
/I "C:\Program Files (x86)\OpenCV_1.1.1a\cv\include"
/I "C:\Program Files (x86)\OpenCV_1.1.1a\cxcore\include"
/I "C:\Program Files (x86)\OpenCV_1.1.1a\cvaux\include"
/I "C:\Program Files (x86)\OpenCV_1.1.1a\ml\include"
/I "C:\Program Files (x86)\OpenCV_1.1.1a\otherlibs\_graphics\include"
/I "C:\Program Files (x86)\OpenCV_1.1.1a\otherlibs\highgui"
/I "C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses"
/I "C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
/I "C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib"
/D "WIN32"
/D "_DEBUG"
/D "_CRTDBG_MAP_ALLOC"
/D "_OPENMP_NOFORCE_MANIFEST"
/Gm
/EHsc
/MD
/openmp
/Fo"..\_.\"
/Fd"..\_.\d.pdb"
/W4
/nologo
/c
/Wp64
/Zi
/TP
/errorReport:prompt
/Qopenmp
/Qopenmp-lib:compat
// end C++ command line from studio 2008

// begin linker command line from studio 2008
/VERBOSE
/NOLOGO
/LIBPATH:"C:\Program Files (x86)\Intel\IPP\6.1.1.035\ia32\stublib"
/LIBPATH:"C:\Program Files (x86)\Intel\IPP\6.1.1.035\ia32\lib"
/LIBPATH:"C:\Program Files (x86)\OpenCV_1.1.1a\bin"
/LIBPATH:"C:\Program Files (x86)\OpenCV_1.1.1a\lib"
/LIBPATH:"C:\Program Files (x86)\OpenCV_1.1.1a\otherlibs\_graphics\lib"
/LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses\Debug_MBCS"
/LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib\"
/LIBPATH:"C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib\x86"
/MANIFEST
/MANIFESTFILE:"..\_.\.intermediate.manifest"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/NODEFAULTLIB:"vcomp.lib"
/NODEFAULTLIB:"vcomp90.lib"
/NODEFAULTLIB:"vcompd.lib"
/NODEFAULTLIB:"vcomp90d.lib"
/NODEFAULTLIB:"libguide.lib"
/NODEFAULTLIB:"libguide40.lib"
/NODEFAULTLIB:"libmmd.lib"
/NODEFAULTLIB:"libmmdd.lib"
/DEBUG
/PDB:"d.pdb"
/SUBSYSTEM:CONSOLE
/LARGEADDRESSAWARE
/OPT:NOWIN98
/DYNAMICBASE
/NXCOMPAT
/IMPLIB:"..\_.\d.lib"
/MACHINE:X86
/ERRORREPORT:PROMPT ippac.lib ippcc.lib ippch.lib ippcore.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 libiomp5md.lib user32.lib advapi32.lib gdi32.lib quartz.lib strmbasd.lib strmiids.lib amstrmid.lib dmoguids.lib
// end linker command line from studio 2008

Thank you very much for your help!


0 Kudos
1 Reply
PaulF_IntelCorp
Employee
786 Views
I'm not clear if this will help, but the following KB article from the compiler folks:


indicates you might need to use the /Qopenmp-link:dynamic option.

These articles might also be of value:


Paul

0 Kudos
Reply