The link line provided by MKL link line advisor(https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor) for linking static sequential libraries is:
-Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_core.a $(MKLROOT)/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm
My question is, why -lpthread library required to link a sequential library?
Thank you for the post. Right, it seem the -lpthread are not needed by sequential linkage. I will check it with internal owner and fix the problem if possible.
I get feedback from our team, as quite often users who use sequential linking of MKL exploit own threading in their applications. To be thread safe in that case MKL has to use TLS functionality of lpthread. Thus we require lphtread even for sequential linking. So it seems better to keep it there. and user can remove manually if it is not needed.