New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UWP support #579

Open
FoggyFinder opened this Issue Jun 21, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@FoggyFinder
Copy link

FoggyFinder commented Jun 21, 2018

I try to use MathNet.Numerics with UWP.

Note, all code related to MathNet defined in separate netstandard2.0 library. If add MathNet directly to UWP project without netdtandard library as an additional layer it works fine.

When it builds in relise mode I got the follow warnings:

warning MCG0007: Unresolved P/Invoke method 'kernel32!LoadLibraryEx' for method 'System.IntPtr MathNet.Numerics.Providers.Common.NativeProviderLoader.WindowsLoader.LoadLibraryEx(System.String, System.IntPtr, System.UInt32)'. Calling this method would throw exception at runtime. Please make sure the P/Invoke either points to a Windows API allowed in UWP applications, or a native DLL that is part of the package. If for some reason your P/Invoke does not satisfy those requirements, please use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP APIs.
warning MCG0007: Unresolved P/Invoke method 'libdl.so!dlopen' for method 'System.IntPtr MathNet.Numerics.Providers.Common.NativeProviderLoader.UnixLoader.dlopen(System.String, System.Int32)'. Calling this method would throw exception at runtime. Please make sure the P/Invoke either points to a Windows API allowed in UWP applications, or a native DLL that is part of the package. If for some reason your P/Invoke does not satisfy those requirements, please use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP APIs.

As a result app closing immediately.

Am I missing something or right now it's impossible to use library this way?

@NilesDavis

This comment has been minimized.

Copy link

NilesDavis commented Sep 7, 2018

OK, after fixing some related errors in my code I also ran into the same problem with the exact same warnings. Is there any chance to solve this?

@NilesDavis

This comment has been minimized.

Copy link

NilesDavis commented Sep 7, 2018

@FoggyFinder did you have any success with this issue? Or did you just take the old 3.x versions?

@cdrnet

This comment has been minimized.

Copy link
Member

cdrnet commented Sep 7, 2018

The code mentioned by the warning should be never executed if you call Control.UseManaged(); before any usage of Math.NET Numerics to disable native providers entirely. With this call, does the app still close immediately? Is there any error/reason reported when it closes?

@cdrnet

This comment has been minimized.

Copy link
Member

cdrnet commented Sep 11, 2018

@SuperJMN

This comment has been minimized.

Copy link

SuperJMN commented Oct 10, 2018

I have tried to certify a Windows Universal Application using Math.NET Numerics and it has been rejected due to this:

Error Found: The supported APIs test detected the following errors

  • API c_axpy in mathnet.numerics.cuda.dll is not supported for this application type. SuppaFlight.UWP.dll calls this API.
  • API c_cholesky_factor in mathnet.numerics.cuda.dll is not supported for this application type. SuppaFlight.UWP.dll calls this API.
  • API c_cholesky_solve in mathnet.numerics.cuda.dll is not supported for this application type. SuppaFlight.UWP.dll calls this API.
  • API c_cholesky_solve_factored in mathnet.numerics.cuda.dll is not supported for this application type. SuppaFlight.UWP.dll calls this API.
  • API c_dot_product in mathnet.numerics.cuda.dll is not supported for this application type. SuppaFlight.UWP.dll calls this API.

Please, make it compatible.

@nige77

This comment has been minimized.

Copy link

nige77 commented Jan 8, 2019

This might help whoever reads this. I have been having a problem deploying an Universal Application in release mode on a Raspberry Pi. The error is that the application can't be started. It also says a DLL is missing. I have narrowed this problem down to the Math.Net library. I also see 'Unresolved P/Invoke method 'libdl.so!dlopen''. Building a new application with only the Math.Net library installed (NuGet) the problem still exists. I have gone backwards from Version 4.7 to 4.0 without any change. However at version 3.20.2 all is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment