Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

How to create shared .so library which use MKL?

$
0
0

Hello,

I would like to create native C dynamically loaded shared library on Linux which use MKL FFT functions. The final goal - to call it from C# (mono) through P/Invoke.

When I run test example C program (not shared library) MKL works fine,

But if I pack my functions to the .so file and call it from C# (mono) through P/Invoke, then I got "DllNotFound" exeption. Without MKL my .so library works also fine.

I supposed that I have to build shared MKL library with -fPIC flag.

So, I went to /opt/intel/mkl/tools/builder and created the libmkldft.so library with dft_example_list functions by adding -fPIC to all command lines in makefile and run "make sointel64 export=dft_example_list name=libmkldft"

then copied the libmkldft.so to /opt/intel/mkl/lib/intel64/ directory and build my test library by

ld -shared -soname libfftt.so -o libfftt.so -L /opt/intel/mkl/lib/intel64/ -lmkldft Fft.o

And finally I have "System.DllNotFoundExeption" at (wrapper managed-to-native) 

If I comment MKL FFT functions in the libfftt.so then I don't have exeptions and all works fine

How to make my shared MKL library work?


Viewing all articles
Browse latest Browse all 3005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>