Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Royi
Novice
68 Views

Crash Using OpenMP on OS X

Hello,

I have Intel Compiler 2015 Update 6 on OS X (10.10 Yosemite).

I'm compiling 2 programs each uses OpenMP (I use static linking for IPP + OpenMP).
When I run them one after the other the second program crashes (It doesn't matter which is first and which is second, at any order).

When I turn off the OpenMP (Remove -Qopenmp) all is working (Removing all OpenMP Pragma's will also make them work).

How can it be?
What makes them conflict with each other?
Just to clarify, on Windows they can run successively with no issue, so it is not some kind of a bug in the code.
Moreover, If I run any of them many times in succession all is working (Yet, there is no interaction between them what's ever).

Another question, I tried to use Dynamic Linking, yet then the program won't work (MacDependency will show libiomp5.dydl in red).
I installed Intel Redistributable (https://software.intel.com/en-us/articles/intelr-composer-redistributable-libraries-by-version) according to the version, yet it still didn't make libiomp5.dydl on the path.

How can I redistribute Intel Compiled programs which uses Intel Run Time?
I thought Intel Run Time would do the work, yet it won't (It will just put the files in the User Home Library).

Thank You.

0 Kudos
9 Replies
Royi
Novice
68 Views

Update,

I tried Dynamic Linking, got the same result.
Is there a chance the OpenMP implementation of 2015 Update 6 is faulty on OS X?

Attached is the Crash Report.

68 Views

Hello Royi,

According to the stack your both modules (TonalRangeSelector and ALCEIT) linked with openmp library statically. It looks second openmp library detects second copy, writes something to console and calls abort. Have you tried to link _both_ modules with openmp dynamically? could you attach stack for such case?

thank you,
--Vladimir

Royi
Novice
68 Views

Hi Vladimir,

I'm actually trying to make a dynamic link yet I struggle with it and can't do it.
My host program (Photoshop) uses the same OpenMP Library (libiomp5.dylib) Yet I can't make the Plug In project to look for it.

You may have a look here:

http://stackoverflow.com/questions/40318465/setting-the-search-path-for-plug-in-dylib

On a side note, how come it is not an issue on Windows yet on OS X it crashes?
Moreover, why the second one "Sees" the first one.
The first one supposedly finished its work long before (It was called form Photoshop, processed data and returned the data).

Thank You.

68 Views

I've answered on stackoverflow.

The short suggestion is to try to link with openmp library from photoshop. @rpath support was added to openmp library in 16.0 update 2 of compiler.

"Windows": There is no such problem on windows because there is no static openmp library:) if you use default link with import library there will be only one openmp library in the process. 

"It sees": you can check __kmp_do_serial_initialize routine by downloading sources from openmprtl.org site or from llvm. First library writes environment variable during initialization. Second library checks it. As you can see from the crash report both libraries are in memory. First one sleeps, second one is being initialized.

--Vladimir

Royi
Novice
68 Views

But if I set Intel Run Time Library to Dynamic I have many more DyLib to link not only libiomp5.dylib.

Those I don't have version with @executable_path/../Frameworks/ of those.

Is there a way to compile the project with Static Intel Run Time besides libiomp5.dylib?

Thank You.

68 Views

-static-intel should help here.

the link to the page for 15.0 compiler. https://software.intel.com/en-us/node/523284

--Vladimir

Royi
Novice
68 Views

Hi Vladimir,

But -static-intel makes the libiomp5.dylib static as well (This is what we used so far).

So how can I use -static-intel and still have libiomp5 linked dynamically?

Thank You.

68 Views

right, something is wrong with documentation, i'll ask to check. you should put neither -static-intel nor -shared-intel:)

my experiments show:

$ LIBRARY_PATH=.:$LIBRARY_PATH icc -qopenmp test1.cpp -Wl,-rpath,.
$ otool -l ./a.out
Load command 12
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name @rpath/libiomp5.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 5.0.0
compatibility version 5.0.0
Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name /usr/lib/libc++.1.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 120.0.0
compatibility version 1.0.0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 1213.0.0
compatibility version 1.0.0
$
$
$
$ LIBRARY_PATH=.:$LIBRARY_PATH icc -qopenmp test1.cpp -Wl,-rpath,. -shared-intel
$ otool -l ./a.out
Load command 12
          cmd LC_LOAD_DYLIB
      cmdsize 40
         name libimf.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 0.0.0
compatibility version 0.0.0
Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 40
         name libsvml.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 0.0.0
compatibility version 0.0.0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 40
         name libirng.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 0.0.0
compatibility version 0.0.0
Load command 15
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name @rpath/libiomp5.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 5.0.0
compatibility version 5.0.0
Load command 16
          cmd LC_LOAD_DYLIB
      cmdsize 48
         name /usr/lib/libc++.1.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 120.0.0
compatibility version 1.0.0
Load command 17
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 1213.0.0
compatibility version 1.0.0
Load command 18
          cmd LC_LOAD_DYLIB
      cmdsize 40
         name libintlc.dylib (offset 24)
   time stamp 2 Thu Jan  1 03:00:02 1970
      current version 1.13.0
compatibility version 1.0.0

 

Royi
Novice
68 Views

Hi Vladimir,

You're the best.
I was wrong, I thought that -static-intel is equivalent of the choice of "Static Intel Run Time" in the Xcode.
It seems it does not and when we compile that way only libiomp5.dylib is dynamically linked.

Now, what I did is copy the libiomp5.dylib of Photoshop into the bundle (Sub folder named Frameworks) and used "install_name_tool -change" to update the binary file of the bundle.

Is there a better way to do so (Or make the compiler generate the bundle with the Framework folder and libiomp5.dylib in it)?

Could you explain me what you see in your example?

But the real question here, why does it work on Windows yet generates issues in OS X?

Thank You.

 

Reply