Community
cancel
Showing results for 
Search instead for 
Did you mean: 
e_shahraeeni
Beginner
114 Views

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 'mkl_rci.fi'

INCLUDE 'mkl_rci.fi'

----------------^

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/mkl_rci.fi)

I even add the file 'mkl_rci.fi' 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?

Ebrahim

0 Kudos
3 Replies
mecej4
Black Belt
114 Views

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

You specified

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

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

$(MKLROOT)/include

e_shahraeeni
Beginner
114 Views

I supposed there is no difference between:
MKL = -I$(MKLROOT)/include/intel64/lp64 -I$(MKLROOT)/include
and
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

Lorri_M_Intel
Employee
114 Views

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


--Lorri
Reply