Trouble linking

Trouble linking


I have installed MKL and I am having trouble linking with the mkl libraries. The Makefile for my compilation looks like the following:

#Makefile for 2D strong coupling project

CC =mpicc
HEADERS =includes.h params.h
MKLPATH =/opt/intel/mkl/lib/mic
MKLINCLUDE =/opt/intel/composer_xe_2011_sp1.10.319/mkl/include
LIBS = -lgsl -lgslcblas -lm -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread
CFLAGS = -I/usr/local/include/ -I${MKLINCLUDE}

2D_QSC: 2D_QSC.c pblas2D.c ${HEADERS} Makefile
    ${CC} ${OPT} -o 2D_QSC pblas2D.c 2D_QSC.c ${LDFLAGS}

      \rm *.o

the error i receive when i run make 2D_QSC is:

/usr/bin/ld: skipping incompatible /opt/intel/mkl/lib/mic/ when searching for -lmkl_scalapack_lp64

/usr/bin/ld: skipping incompatible /opt/intel/mkl/lib/mic/libmkl_scalapack_lp64.a when searching for -lmkl_scalapack_lp64

/usr/bin/ld: cannot find -lmkl_scalapack_lp64

and so on for each mkl library that I have referenced in Makefile. Any help would be greatly appreciated as this error is puzzling and have neither seen it before nor can find much info about it just by googling. Thank you.



7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Sawas,

I saw you are using the library for mic. (xeon(R)  phi coprocessor).   /opt/intel/mkl/lib/mic, so doe it mean you are building application for mic?  On the other hand, you haven't the compiler opiton -mmic.  Here is MKL user guide. for your reference.

Best Regards,


Which compiler is mpicc using?  Intel doesn't offer an mpicc for MIC.  The most likely way to use MIC under mpicc would be as an open source MPI built with icc to take advantage of MIC offload features.  In that case, the normal default MKL linking (e.g. -mkl) would take care of it, provided that you used latest 13.1 or a 14.0 compiler.  With Intel MPI, mpiicc would be the wrapper to use for that purpose.

As Ying said, you would be able to use your MKLPATH only when building with icc -mmic cross-compiler for execution on the MIC by itself.  If using Intel MPI, again, you would need mpiicc.

thanks for your answers. Just to avoid any confusion. My architecture is i5 and not Xeon. Thus, I should NOT be using the library from mic.
The reason I did so was because this is the only directory in my computer that contains scalapack and blacs that my code is utilizing.
I think that the MKLPATH should be /opt/intel/composer_xe_2013_sp1/mkl/lib/intel64 BUT that directory has neither Scalapack nor Blacs.
The question is where should these libraries (scalapack and blacs) be for intel64 (i5) architecture? And if they are not in their normal spot why is this the case since I performed a default installation?
                                                                    Best, Savvas

Hello Sawas,

Thanks for clarify. The cluster library ( scalapack and blacs) are optional install components. So you may need rerun the install script and select cluster library.

Best Regards,


P.S you may have know the link, but attach here for your reference.

MKL link advisor :

 MKL 11.0 releate notes: and related notice.

Important Notices:

•Intel MKL now provides a choice of components to install. Components necessary for PGI compiler, Compaq Visual Fortran Compiler, SP2DP interface and Cluster support (ScaLAPACK and Cluster DFT) are not installed unless explicitly selected during installation

please look at this KB article to see more details about new install options with the latest 11.1 :

Resolved! Many thanks to all of you. It was just very deceiving that scalapack and blacs were optional for intel64 while they were there for the mic-xeon version...

Leave a Comment

Please sign in to add a comment. Not a member? Join today