Can I use > 1 instance of IPP static libs?

Can I use > 1 instance of IPP static libs?

Imagen de unclejoe

I have a DLL that statically links to almost all the IPP static libraries, including Intel OpenMP. Likewise, I also have an EXE that links against almost all IPP static libs. The EXE also links against the DLL, thus creating 2 instances of IPP.

At 1st, I get the message

"OMP abort: Initializing libiomp5mt.lib, but found libiomp5mt.lib already initialized.
This may cause performance degradation and correctness issues."

This happens when I call ippStaticInit() at the beginning of main(), which is after ippInit is called in the DLL. This doesn't make sense because there are 2 separate instances, unless they share resources in a non-thread safe way.

After setting KMP_DUPLICATE_LIB_OK=TRUE, the 64bit version of the app runs OK. But, the 32bit version crashes after calling ippMalloc in the EXE.

Any ideas?

publicaciones de 5 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de unclejoe

OK, I know why I got the crash. It hat nothing to do with having 2 instances of IPP, it was a wrongly typed function pointer (I forgot __stdcall), which only mattered for 32 bit.

Imagen de j3r3mi

Sorry fir asking this. I'm really puzzled why do you want to do this. Why don't just use the DLLs?? Just trying to learn more... hehe !!

I'm not sure if you did trying running MATLAB with IPP, there will be a conflict. I experience this some time ago while i was verifying some results using the MATLAB external engine. BR.
Imagen de matthieu.darbois

Hi,
You can link against libiom5md.lib to avoid static linking openMP. You'll have to distribute openMP DLL along with your application but no Environment variable has to be set then.

Regards,
Matthieu

Imagen de unclejoe

Right, I should be using the DLLs since I'm using IPP in sufficiently many places to negate any space savings of static linking. My philosophy up to now is, if the library isn't standard (< 70% users have it), then use the static version, which creates a chicken and egg problem. I also assumed my supervisor didn't like the extra IPP baggage.

Also, I know static linking has slightly less call overhead because you can do a direct branch instead of an indirect branch, but that's moot because the difference is probably negligible.

I also ran into the 1 IPP dll instance, 1 static instance when I gave someone a Matlab DLL port of his matlab code to test. I just removed IPP from the DLL, but I'm pretty sure it would've worked if I just set KMP_DUPLICATE_LIB_OK=TRUE

Inicie sesión para dejar un comentario.