mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.51k stars 899 forks source link

I can't get native linux MKL provider to work with MathNet v5 #946

Open atlemann opened 2 years ago

atlemann commented 2 years ago

The release notes says something about making it better for x-plat, but I'm unable to make native providers work in linux at all. Is anyone else able to?

Should it be possible to include both MathNet.Numerics.MKL.Linux-x64 and MathNet.Numerics.MKL.Win-x64 in my application now so I can run it on both platforms?

petterton commented 1 year ago

I have the same problem. When trying to call LinearAlgebraControl.UseNativeMKL() on Linux I get System.NotSupportedException: Native Provider Probing failed to resolve creator. Did you make this work @atlemann?

atlemann commented 1 year ago

No, unfortunately not. The actual application has been running mostly in a Windows environment due to other reasons, although I develop on Linux. I didn't have time to test too much so I just gave up. But we want the app to run on linux as well, so I'll have to look into it again some time. It's a bit annoying how it works in MathNet, since AFAIK you cannot have both linux and windows native libs available, since the files have the same name. At least before MathNet v5.

We're building our own custom native Intel.MKL to get some other functions and we pack both windows and linux artifacts in the same NuGet package. If you call your artifacts "MyCoolLib.dll" and "libMyCoolLib.so", you can use DllImport("MyCoolLib") and .NET will find the correct file for each platform itself. Last time I checked it seemed MathNet was using a very complicated way of finding these libs.