I am compiling a software package that uses ifort several MKL libraries. The part of the Makefile that mostly do the linking:
# Library options in general
MKL_LIBDIR = /opt/intel/mkl/lib/intel64
LIBOPT = -L$(MKL_LIBDIR)
# How to link specific libraries
LIB_BLAS = -Wl,--start-group \
-lmkl_intel_lp64 \
-lmkl_intel_thread \
-lmkl_core \
-Wl,--end-group \
-liomp5 -lpthread
LIB_LAPACK =
When i compile this, I have an error:
ld: cannot find -lpthread
make[1]: *** [dftb+] Error 1
make[1]: Leaving directory `/home/gjuhasz_p/Downloads/dftb-src/dftb+_1.2.2_src/prg_dftb/_obj_x86_64-linux-ifort'
make: *** [_obj_x86_64-linux-ifort] Error 2
I tried to add -L/directory or export LD_LIBRARY_PATH=/directory (based on what locate tells me about libpthread.so) However, ld still cannot find the library, and cannot link. I also had similar problems with other libraries, if I just comment out this linking command.
Why is this happening and how can I fix it? Thanks!