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

Linking a shared to MKL 10 on a 64-bit Linux

ermsgroup
Beginner
671 Views

Hello

I'm working on a computation application that uses somes functions located in a shared object.
I need to link this shared object to the MKL in order to uses the BLAS(and CBLAS) functions.

Machine information
---------------------
- VM running under VMWare Player for Windows
- CentOS Linux 3.9 (x86_64)
- GCC 3.2.3 20030502

Linking information
-------------------
- MKL Librairies (in this order) : libmkl_intel_ilp64.a libmkl_gnu_thread.a libmkl_core.a libiomp5.so
- Compile Flags : -fPIC

The error (at link time)
-----------------------
/usr/bin/d: .../lib/libiomp5.a(kmp_csupport.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
.../lib/libiomp5.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

What's wrong withlinking ?

Regards





0 Kudos
2 Replies
ermsgroup
Beginner
671 Views

Solved.

I don't know why butGCC used the static version of libiomp5 instead of the dynamic version.
Now the linking works !

But .... at run time, when I'm loading the shared object that is linked to MKL, the following message appears :

MKL FATAL ERROR: libmkl_def.so: cannot open file: No such file or directory

Any idea ?

P.S. : The shared object is loaded by a Java application, and as a consequence, is running under the JVM.

0 Kudos
TimP
Honored Contributor III
671 Views
Did you set the path to the MKL /lib/em64t library in LD_LIBRARY_PATH ?

I would have thought you would need all .so libraries, rather than mixing .a and .so; if you did succeed in using .a libraries, I would expect you would run into the circular dependencies which require the libraries to be searched 3 times. Remember, the ilp64 library is the one which requires 64-bit int parameters (C long or long long).

I've never seen such an old version of CentOS; you have an interesting mixture of old and new versions.
0 Kudos
Reply