Monday, October 22, 2012

problem of ICC (ld: cannot find -lpthread)

Problem:

I cannot compile my old project using the Intel Compiler. The error reported is

ld: cannot find -lpthread

Cause:

Playing with the pthread library is not helpful. The real problem is the "-fast" option which enables "-xHOST -O3 -ipo -no-prec-div -static" by default.

But my current OS is CentOS 6.3 which hates static library. So the last "-static" option is the cause of the problem.

Solution:

Replace the "-fast" with "-O3 -ipo -no-prec-div".

No comments: