mkl linking problem

mkl linking problem

I have a strange problem. using MKL for linear solver, I had no problem to link MKL to my code in visual studio. Now under mac when I try to compile the exact same code with make file, I get error message

Obj/mod_diffusion.o Obj/mod_time.o gas.f90 -c -module Mod/ -o Obj/gas.o

Solver/linear_solver_RCIISS.f90(13): error #5102: Cannot open include file ''



compilation aborted for gas.f90 (code 1)

The MKL include directory is defined in the make file as:

MKLROOT = /opt/intel/composer_xe_2011_sp1.9.289/mkl/

MKL = -I$(MKLROOT)/include/intel64/lp64 -I$(MKLROOT)/include -L$(MKLROOT)/lib $(MKLROOT)/lib/libmkl_blas95_lp64.a $(MKLROOT)/lib/libmkl_lapack95_lp64.a -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -openmp -lpthread -lm

and the file is there (/opt/intel/composer_xe_2011_sp1.9.289/mkl/include/

I even add the file '' directly to the project, but it gives me the same error. I used other MKL functions before the recent changes in the project and there was no problem in linking and compiling. Any clue what would be the problem?


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

I am not familiar with the Macintosh MKL setup, but I notice this discrepancy:

You specified


but the particular include file is not target-architecture specific, and is therefore located in


I supposed there is no difference between:

MKL = -I$(MKLROOT)/include/intel64/lp64 -I$(MKLROOT)/include


MKL = -I$(MKLROOT)/include -I$(MKLROOT)/include/intel64/lp64

but there is!Following your advice by using the second one, now I get new error:

Undefined symbols for architecture x86_64:

"_linear_solver_rciiss_", referenced from:

_MAIN__ in gas.o

ld: symbol(s) not found for architecture x86_64

make: *** [FRSGW3D.e] Error 1

And now, what command are you using to link the final executable?

It appears you are not including the mkl libraries.

there is a command line switch that will add the libraries for you:

ifort -mkl gas.o -o gas


Leave a Comment

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