Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
liorda
Total Points:
130
Status Points:
80
Green Belt
December 23, 2008 6:15 AM PST
OMP abort: Initializing libopmp5md.dll, but found libguide40.dll already initialized.

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

 

 

matthieu.darbois
Total Points:
1,025
Status Points:
525
Brown Belt
December 23, 2008 7:05 AM PST
Rate
 
#1

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



Vladimir Dudnik (Intel)
Total Points:
26,380
Status Points:
26,380
Black Belt
December 23, 2008 7:06 AM PST
Rate
 
#2
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

 



liorda
Total Points:
130
Status Points:
80
Green Belt
December 23, 2008 7:11 AM PST
Rate
 
#4 Reply to #1

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



matthieu.darbois
Total Points:
1,025
Status Points:
525
Brown Belt
December 23, 2008 7:23 AM PST
Rate
 
#5 Reply to #4

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



Vladimir Dudnik (Intel)
Total Points:
26,380
Status Points:
26,380
Black Belt
December 23, 2008 7:39 AM PST
Rate
 
#6 Reply to #4

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-usage\linkage' folder in sample package)

Vladimir



thorsan
Total Points:
320
Status Points:
270
Green Belt
June 12, 2009 8:19 AM PDT
Rate
 
#7 Reply to #6
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


pvonkaenel
Total Points:
3,580
Status Points:
3,080
Brown Belt
June 12, 2009 9:04 AM PDT
Rate
 
#8 Reply to #7
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

thorsan
Total Points:
320
Status Points:
270
Green Belt
June 12, 2009 12:14 PM PDT
Rate
 
#9 Reply to #8
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


thorsan
Total Points:
320
Status Points:
270
Green Belt
June 15, 2009 5:33 AM PDT
Rate
 
#10 Reply to #9
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.


pvonkaenel
Total Points:
3,580
Status Points:
3,080
Brown Belt
June 16, 2009 5:45 AM PDT
Rate
 
#11 Reply to #10
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


thorsan
Total Points:
320
Status Points:
270
Green Belt
June 16, 2009 5:56 AM PDT
Rate
 
#12 Reply to #11
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


matthieu.darbois
Total Points:
1,025
Status Points:
525
Brown Belt
June 16, 2009 6:29 AM PDT
Rate
 
#13 Reply to #12
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


pvonkaenel
Total Points:
3,580
Status Points:
3,080
Brown Belt
June 16, 2009 7:00 AM PDT
Rate
 
#14 Reply to #12
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 OpenMP to 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


thorsan
Total Points:
320
Status Points:
270
Green Belt
June 16, 2009 7:20 AM PDT
Rate
 
#15 Reply to #14
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


matthieu.darbois
Total Points:
1,025
Status Points:
525
Brown Belt
June 16, 2009 9:05 AM PDT
Rate
 
#16 Reply to #15
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




Intel Software Network Forums Statistics

8442 users have contributed to 31548 threads and 100377 posts to date.
In the past 24 hours, we have 10 new thread(s) 33 new posts(s), and 49 new user(s).

In the past 3 days, the most popular thread for everyone has been /fpp interferes with breakpoints/stepping through code - again The most posts were made to Help with hitting maximum record length in the compiler with debug info? The post with the most views is You could save the pre-proce

Please welcome our newest member mrnm