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

OMP abort: Initializing libopmp5md.dll, but found libguide40.dll already initialized.

liorda
Beginner
1,099 Views

I'm building a dll, dynamicaly linked against IPP 6.0.1.

When trying to load my DLL from MATLAB, I get the above error and matlab crashes.

I Tried to remove libiomp5md.lib from the dependency list of the linker, but the error still occurs.

What is the problem?

Any help would be appreciated.

--Lior

0 Kudos
15 Replies
matthieu_darbois
New Contributor III
1,099 Views

Hi,

It seems that your using two versions of OpenMP implementation (libguide40 and libiomp5md).

Ipp 6 DLLs use libiomp5md for multithreading. So you have to check what's using libguide40 (for example IPP 5).

If you've got the sources of the libraries using libguide40, you should compile them for use with libiomp5md.

As an alternative, you can link your dll against IPP non threaded static libraries.

With the information you've provided, there's no way to tell more than that. If you've got more information, I'd be happy to help.

Regards

0 Kudos
Vladimir_Dudnik
Employee
1,099 Views
Starting from IPP 6.0 libiomp used in IPP DLLs. So IPP 6.0 DLL will have conflict with any applications which use libguide40. To avoid this you may link with IPP static libraries. Note, you also can build IPP custom DLL module which will contain only function your application is using.
Regards,
Vladimir

0 Kudos
liorda
Beginner
1,099 Views

Hi,

It seems that your using two versions of OpenMP implementation (libguide40 and libiomp5md).

Ipp 6 DLLs use libiomp5md for multithreading. So you have to check what's using libguide40 (for example IPP 5).

If you've got the sources of the libraries using libguide40, you should compile them for use with libiomp5md.

As an alternative, you can link your dll against IPP non threaded static libraries.

With the information you've provided, there's no way to tell more than that. If you've got more information, I'd be happy to help.

Regards

Thanks for answering. I did manage to get my DLL to work after linking it staticly. Matlab is the only suspect I can think of right now (for using the older version of openMP), since no other versions of IPP are installed, and visual studio is the only other appliction running on the machine.

How can I tell what version of openMP is being used (if any) and who is using it?

Thanks.

--Lior

0 Kudos
matthieu_darbois
New Contributor III
1,099 Views

You should load matlab with your working DLL. Then retrieve a list of all loaded DLLs (if you attach a debugger you can see all loaded modules, or simpler, with ProcessExplorer if you got it). You should then make a pass with dependency walker on each of these DLLs and the main application to see which one is loading libguide40 (ignore default MS libraries as well as ipp 6 to speed up the process).

If you're using default build of OpenCV 1.0, it uses libguide40 for multithreading.

Regards

0 Kudos
Vladimir_Dudnik
Employee
1,099 Views

It is known that Matlab use IPP internally, as far as I know in image processing toolbox, may in some others too. The version of IPP they use is either IPP 2.0 or IPP 5.3 depending on version of Matlab. So, for you to use IPP6.0 in Matlab it is necessary to link statically or to build IPP custom DLL (the example of how to create IPP custom DLL is provided in IPP sample package, see 'advanced-usagelinkage' folder in sample package)

Vladimir

0 Kudos
thorsan
Beginner
1,099 Views
Hi,

I also have problems using ipp 6.0 with Matlab 2009a. I have made my own custom dll using the sample in the ipp-samples. (Why is it using libiomp5mt and not libiomp5md? What is the difference?)

So no my code runs smoothly in matlab. But then I call the filter function of matlab before I call my function and it crashes. I am not able to tell you the error message because it is displayed in a cmd window which disappears right away.

Anyone who has any ecperience with making IPP 6.0 work with matlab? With 5.3 and it worked nicely but after the upgrade to 6.0 nothing works anymore.

Thanks,
Thor Andreas
0 Kudos
pvonkaenel
New Contributor III
1,099 Views
Quoting - thorsan
Hi,

I also have problems using ipp 6.0 with Matlab 2009a. I have made my own custom dll using the sample in the ipp-samples. (Why is it using libiomp5mt and not libiomp5md? What is the difference?)

So no my code runs smoothly in matlab. But then I call the filter function of matlab before I call my function and it crashes. I am not able to tell you the error message because it is displayed in a cmd window which disappears right away.

Anyone who has any ecperience with making IPP 6.0 work with matlab? With 5.3 and it worked nicely but after the upgrade to 6.0 nothing works anymore.

Thanks,
Thor Andreas

If a module is using libiomp5mt (the static lib version of OpenMP) and another module in the same application uses another copy of OpenMP (libiomp5mt, libiomp5md, or libguide4), the application will automatically terminate with a quick message about finding multiple OpenMP run-times in the same application. Since it sounds like multiple modules are all using OpenMP, it would be safest to switch from libiomp5mt to libiomp5md.

Peter
0 Kudos
thorsan
Beginner
1,099 Views
OK. Ill try using the libomp5md instead and see if that works.

Might it be that IPP 6.X is not compatible with Matlab?

Thanks,
Thor Andreas
0 Kudos
thorsan
Beginner
1,099 Views
Hi,

I now got it to work, in some way. I built a custom dll and using the non threaded static libraries. Then the libomp5 library is not loaded for my code and there is no crash. Trying to use the threaded versions makes Matlab crash. due to use of multiple omp libraries.

At least now it works but I cant use the multithreading capabilities of IPP, so much for quad core hyperthreading.

If anyone comes up with a solution so that one can use IPP6.0 with multithreading in Matlab, please post it here.
0 Kudos
pvonkaenel
New Contributor III
1,099 Views
Quoting - thorsan
Hi,

I now got it to work, in some way. I built a custom dll and using the non threaded static libraries. Then the libomp5 library is not loaded for my code and there is no crash. Trying to use the threaded versions makes Matlab crash. due to use of multiple omp libraries.

At least now it works but I cant use the multithreading capabilities of IPP, so much for quad core hyperthreading.

If anyone comes up with a solution so that one can use IPP6.0 with multithreading in Matlab, please post it here.

I actually stopped using the threaded IPP calls in favor of threading on my own (I think I read that only 20% of IPP is threaded). You can try using the version of OpenMP being used by Matlab and thread the IPP calls in your own loops.

Peter
0 Kudos
thorsan
Beginner
1,099 Views
Hi Peter,

Thanks for yor tip. Do you use OMP for threading? I use the Intel C++ 11.0 compiler. If I decide to use OMP with the compiler, which OMP library does it link to? Can I choose?

Thanks,
Thor Andreas
0 Kudos
matthieu_darbois
New Contributor III
1,099 Views
Quoting - thorsan
Hi Peter,

Thanks for yor tip. Do you use OMP for threading? I use the Intel C++ 11.0 compiler. If I decide to use OMP with the compiler, which OMP library does it link to? Can I choose?

Thanks,
Thor Andreas

Hi,
In Intel C++ 11.0 compiler you can choose which OMP library to use. Just open the documentation of the compiler and look for "/Qopenmp-lib". You can choose "legacy" (libguide40, used in IPP 5.3) or "compat" (default option, libiomp, used in IPP 6.0).

Regards,
Matthieu
0 Kudos
pvonkaenel
New Contributor III
1,099 Views
Quoting - thorsan
Hi Peter,

Thanks for yor tip. Do you use OMP for threading? I use the Intel C++ 11.0 compiler. If I decide to use OMP with the compiler, which OMP library does it link to? Can I choose?

Thanks,
Thor Andreas

As Matthieu mentioned, you can select which version of OpenMP is linked. As for me, I've recently switched from OpenMPto Threading Building Blocks due to some additional features like pipelining. However in your case, since Matlab is already using OpenMP, it's probably easiest to just stick with it.

Peter
0 Kudos
thorsan
Beginner
1,099 Views
Hi,

Thank you very much for your help. Ill look into these possibilities.

Is there a list over which functions in IPP that are threaded?

Thanks,
Thor Andreas
0 Kudos
matthieu_darbois
New Contributor III
1,099 Views
Quoting - thorsan
Hi,

Thank you very much for your help. Ill look into these possibilities.

Is there a list over which functions in IPP that are threaded?

Thanks,
Thor Andreas

You can find the list in the "doc" directory of IPP. The filename is ""ThreadedFunctionsList.txt".

Regards,
Matthieu
0 Kudos
Reply