- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I need your help about using the MKL_lapack95 library: I need to call a subroutine ("polyfit.f") which calls two functions in the MKL_lapack95 library. I am using intel fortran (composer_xe_2013_sp1.2.144) with Fedora 20. The environment should be already set up:
$ echo $LD_LIBRARY_PATH
/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/ia32:/opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/ia32:/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/ia32:/opt/intel/composer_xe_2013_sp1.2.144/mpirt/lib/ia32:/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/ia32:/opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/ia32
I compile my code with the following command:
ifort -o main main.f polyfit.f -lmkl_lapack95
it says:
/tmp/ifortq7X4uH.o: In function `polyfit_':
polyfit.f:(.text+0x5d0): undefined reference to `dgetrf_'
polyfit.f:(.text+0x68a): undefined reference to `dgetri_'
there is a file named "libmkl_lapack95.a" in the opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/ia32 directory and if I search, for example dgetrf, it returns:
$ grep -ni "dgetrf" libmkl_lapack95.a
Binary file libmkl_lapack95.a matches
Can any please tell me what's wrong here? Thank you very much!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to specify that the base MKL libraries need to be linked. The simple way of doing this is to give the IFort compiler the -mkl option.
In fact, you do not call any Lapack95 routines from your code, so there is no need to specify -lmkl_lapack95.
The code has other errors that you will have to remove. For example, function Polyfit returns an array, and that fact is not specified in the calling routine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for your prompt reply, mecej4! It solved my problem!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page