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

Problem with MKL 10 update 3 and newer versions

jpeinado
Beginner
3,775 Views
Hi:

I am working in a program using LINUX (64 bits) and MATLAB R2010b, CUDA and CULA (environments to use GPUs) and MKL.

Before, when working with MKL 10 update 2, all worked well. Now, when working with last version of MKL, I have a runtime error....It seems a MKL problem:

*** libmkl_mc3.so *** failed with error : /opt/intel/composerxe-2011.1.107/mkl/lib/intel64/libmkl_mc3.so: undefined symbol: i_free
*** libmkl_def.so *** failed with error : /opt/intel/composerxe-2011.1.107/mkl/lib/intel64/libmkl_def.so: undefined symbol: i_free
MKL FATAL ERROR: Cannot load neither libmkl_mc3.so nor libmkl_def.so



I read some about this (I think it is a similar problem) here: http://software.intel.com/en-us/forums/showthread.php?t=60460

but I don't understand what must I do to solve the problem. Now, I include the following libraries:

-lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -liomp5

What must I change? Couuld you give me a line telling me the libraries to include?

Thank you very much

jpeinado
0 Kudos
31 Replies
AndrewC
New Contributor III
1,219 Views
Just put in the mex C++ file...before the call to idamax_

extern "C" int idamax_(int n, double *x,int incx);
0 Kudos
AndrewC
New Contributor III
1,219 Views
And on your link line
replace libMyBlas.so by
-L. -lMyblas
0 Kudos
jpeinado
Beginner
1,219 Views

Hi:

I did but using extern "C" int idamax_(int *n, double *x,int *incx);

Anyway

dgeidreplpa_cu.o: In function `mexFunction':

tmpxft_00006849_000000001_dgeidreplpa_cu.cudafe1.cpp:(.text+0x142e): undefined reference to `idamax_'

tmpxft_00006849_00000000-1_dgeidreplpa_cu.cudafe1.cpp:(.text+0x150d): undefined reference to `idamax_'

collect2: ld returned 1 exit status

mex: link of ' "dgeidreplpa_cu.mexa64"' failed.

dgeidreplpa_cu.o: In function `mexFunction':tmpxft_00006849_00000000-1_dgeidreplpa_cu.cudafe1.cpp:(.text+0x142e): undefined reference to `idamax_'tmpxft_00006849_00000000-1_dgeidreplpa_cu.cudafe1.cpp:(.text+0x150d): undefined reference to `idamax_'collect2: ld returned 1 exit status

mex: link of ' "dgeidreplpa_cu.mexa64"' failed.

It seems that the linker dont see the routines contained in libMyblas.so but I don't know why

Thanks

jpeinado

0 Kudos
jpeinado
Beginner
1,219 Views

Hi again:

I am sure that the problem is that routines contained in libMyblas.so (MKL) generated following your instructions are not found. I will try to explain this.

To test what is happening, I did the following:

- I downloaded the "idamax.f" file from the Netlib repository

- I compiled it and converted in a shared library.

- Then I compiled and linked all, using that shared library

This worked OK.

Anyway I would like to use the MKL. I have one doubt...When I have libMyblas.so (MKL), where are the original libraries? May I use any path to tell where are that libraries? Could this be the problem?

Thank you very much

jpeinado

0 Kudos
AndrewC
New Contributor III
1,219 Views
Oops, I made as mistake in what I told you earlier... the command to create the custom DLL should be
make libintel64 export=my_blas_list name=libMyblas
If you create it that way, you should be good to go. The critical parameter islibintel64 which means "make a library including all the functions"
0 Kudos
TimP
Honored Contributor III
1,219 Views

When you install the MKL which comes with recent Intel compilers, if you accept the installation path which you chose for the compilers, sourceing the compilervars script will set up LD_LIBRARY_PATH for MKL dynamic libraries. You could also set LD_LIBRARY_PATH specifically to where you installed MKL. If you chose the default,

find /opt/intel -name libmkl_core.so

should show you where such libraries are. There should also be an mklvars script in your MKL installation, regardless of whether you installed a compiler.

0 Kudos
jpeinado
Beginner
1,219 Views

Hi Again:

OK.

Thank you very much....I will test it on Monday :-) Tomorrow, the University is closed....

Thank you very much for your answer

About the paths...I think (I must test it) they are correctly installed

Anyway, thank you very much

jpeinado


0 Kudos
jpeinado
Beginner
1,219 Views
Hi vasci_intel:

1) I redid the library as you told me and also generated my_blas_list (adding idamax without "_") and it worked OK...Than you very much!!!

2) I studied the make libintel64 command and the exact command is

make libintel64 export=my_blas_list interface=ilp64 name=my_blas
Creates my_blas.so for processors using the Intel 64 architecture.
Function list is taken from the file my_blas_list.
The parallel Intel MKL supporting ilp64 programming is used to build my_blas.so.


The question is, Must I use interface=ilp64 ? What is this?


3) Is there any list to use the functions without "_" with and without adding them manually?



Thank you very much for your help

jpeinado





0 Kudos
jpeinado
Beginner
1,219 Views
Hi again:
Anyone can answer to my questions:
Must I use interface=ilp64 ? What is this?


Is there any list to use the functions without "_" with and without adding them manually?



Thank you very much for your help
jpeinado
0 Kudos
AndrewC
New Contributor III
1,219 Views
Hi,

The short answer is "read the documentation" - there is a lot of information in the MKL docs folder. You should be reading that before posting to these forum.

Quick answer: ILP64 is the MKL interface using 64-bit "integers" not the default "32-bit" int type. Needed when working with huge datasets. You should not need to use it.

You do not, and never needed to add "_" manually as long as you linked against the correct library.

include "mkl_blas.h" in you C++ header file, link against the library, and you are done.

Again, please read the docs. People will not answer pleas for help if it does not appear you have made an effort to help yourself.






0 Kudos
jpeinado
Beginner
1,219 Views

Hi again:

Thank you very much for your answer.

But the problem is that INTEL changed something in MKL update 3 and newer. Before, I linked with MKL and MATLAB without problems. Yes, I know, it is a strange thing.....

In fact, you can see (several posts before) that you advised me about adding the "_". Later you told me redoing the library (first and incorrect way, and later a correct way).

Later to use the call idamax, to add (at last line) idamax with ( and later without the _). This is because the blas_list file (used to rebuild libraries) have all the calls with "_". I asked about the same file (blas_list) without the "_"

I apologize you for giving to much work to you (you helped to me much redoing the libraries), but you must understand that before INTEL make some changes, all worked OK.....

I am not sure if the documentation talks about this method of rebuilding the libraries, when someone have problems. I am sure that I solved my problem due to your great help

Again, thank you very much

jpeinado


0 Kudos
Reply