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 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:, needed by /opt/intel/cc/ /lib/, may conflict with
$ ./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/ ./
$ 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.

For more complete information about compiler optimizations, see our Optimization Notice.