Performance Tools for Software Developers - OpenMP* incompatibility with GNU* Portable Threads (GNU* Pth)

The Intel® Compiler OpenMP* implementation requires preemptive scheduling to work properly. We do not support non-preemptive threading models like the supplementary GNU* Pth (currently libpthread20) package.

When you install the GNU* Pth libpthread20 package, the installation replaces glibc’s version of pthread.h and libpthread.so with their GNU* Pth’s counterparts. Then, after you compile your application with the Intel® compilers and OpenMP enabled, your application will likely crash at run time with an error message:

$ icc -openmp hello.c
ld: warning: libpthread.so.0, needed by /opt/intel/cc/10.x.xxx /lib/libguide.so, may conflict with libpthread.so.20
$ ./a.out
system error(22): __kmp_create_monitor: pthread_attr_setdetachstate: Invalid argument
OMP abort: fatal system error detected.
Aborted (core dumped)

The solution is to remove the GNU* PTh package:

$ dpkg --remove libpthread20

If it is not possible to remove this package (lack of administrative privileges, etc), do the following:

$ ln -s /usr/lib/libpthread.so.glibc ./libpthread.so
$ ln -s /usr/include/pthread.h.glibc ./libpthread.h

Then relink your program:

$ icc -I . -L . -openmp <...other options...>

Note: This incompatibility applies to the Intel® C++ and Fortran Compilers version 9.x and 10.x.

Einzelheiten zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.