Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Why not static linking libiomp5?

Petros
Novice
1,756 Views

Hi,

I'm preparing a dynamic library that I will send to some collaborators. It is loaded and used in Python. 

The library uses OpenMP for parallel computing, thus depends on libiomp5. As the collaborators don't have Intel compiler, I need to ask them to install the redistributable libraries. This makes things more complicated that just sending a .so file.

On the other hand, I've read in several places that it is not suggested to do a static linking to libiomp5.a. For example -static-intel does not affect the OpenMP library and the command to static link openmp has been deprecated.

My questions are:

  • Why isn't it suggested to do a static linking to libiomp5? I mean, everything else you can link (static-intel and MKL), why not this?
  • Could I distribute the libiomp5.so file along with my .so instead of asking them to install the redistributable? It will make things easier. Of course, I know that if they already have libiomp5 installed, it could cause problems. However, I could easily check in my python wrapper whether the library exists and if not, load the one in the distributed with my .so.
  • Same question stand for Windows (as some of my collaborators use windows). Could you mention if there are differences?

Thanks in advance!

0 Kudos
1 Reply
TimP
Honored Contributor III
1,756 Views

You may distribute libiomp5.so or dll with your application.

The reasons for eliminating the static library didn't appear to be fully explained.  Apparently, they included the number of bug reports which were due to people linking the static OpenMP when building a library and having to link again against OpenMP, resulting at best in multiple instances of OpenMP.  The alternate Intel threading support libraries are treated in a similar way with the C++ compilers.

0 Kudos
Reply