Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7062 Discussions

Error in compiling a program written in Fortran90

yamanobe
Beginner
557 Views

Dear All,

I am Takanobu Yamanobe. Recently, I have installed the Math Kernel Library 10.0.1.014 and ifort. I made a program to compute the solution to the system of linear equations with a square matrix A and multiple right-hand sides using gesv. The program is written in Fortran90. Thus I tried to compile the program by following command:

ifort dgesv.f90 -L/opt/intel/mkl/10.0.1.014/lib/em64t/ -I/opt/intel/mkl/10.0.1.014/include/ -lmkl_lapack95 -lmkl_blas95

However, this command returns following error

/tmp/ifortGlTLhE.o(.text+0xda): In function `MAIN__':
dgesv.f90: undefined reference to `gesv_'

It is very helpful that somebody tells me the source of this error. I am using Pentium4 processor machine (Dell Precision 350) and the installed OS is Suse Linux 9.3.

Thanks in advance.

Takanobu Yamanobe

0 Kudos
4 Replies
TimP
Honored Contributor III
557 Views
You would still require, in addition, the same libraries which would be needed if you didn't use lapack95 and blas95 (ilp64 or lp64, libcore, libsequential or libthread).
0 Kudos
yamanobe
Beginner
557 Views

Thanks for your reply to my question.

Since I am a beginner of the Math Kernel Library, Imight notunderstand how to set the linking in Intel MKL 10.0 still. I am reading the User's guide and I am trying to select the options for the linking based on figure5-1 in User's guide. It seems that the adequate libraries to link is libmkl_lapack.so libmkl.so (for Lapack, dynamic case). So, I have tried the following command:

ifort dgesv.f90 -L/opt/intel/mkl/10.0.1.014/lib/em64t/ -I/opt/intel/mkl/10.0.1.014/include/ -lmkl_lapack95 -lmkl_blas95 -lmkl_lapack -lmkl_em64t

However, it returns the following errors:

ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/em64t//libmkl_lapack.so when searching for -lmkl_lapack
ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/em64t//libmkl_intel_lp64.a when searching for libmkl_intel_lp64.a
ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_lp64.a when searching for libmkl_intel_lp64.a
ld: skipping incompatible /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_lp64.a when searching for libmkl_intel_lp64.a
ld: cannot find libmkl_intel_lp64.a

What is wrong with this command? Which part should I read in User's guide to understandthe selection ofthelibraries? Since I spentmany days onthis problem, I acknowledge for any advices on these problems.

Sincerely yours

T. Yamanobe

0 Kudos
TimP
Honored Contributor III
557 Views
If you have the 32-bit linux (uname shows i386), you can't use the 64-bit libraries. Those libraries work only with 64-bit linux and the 64-bit compilers (ifort fce version).
0 Kudos
Todd_R_Intel
Employee
557 Views

Hello,

You mention you're using a Pentium 4 so you'll need to be linking libraries from the lib/32 directory instead of lib/em64t directory.

Also, to use the Fortran-95 interface you will need to build the wrapper first. Take a look at chapter 7 of the User Guide titled "Language Usage Options". It has a section with information on this interface.

Todd

0 Kudos
Reply