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.
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