mathnet / mathnet-numerics

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

I want use MKL under AOT publish,But cant #1059

Open a1821216780 opened 10 months ago

FabianNitsche commented 10 months ago

Due to a missing description of the problem, I am guessing here. That you run into the problem, that reflection is used for setting up the providers. You have to specify what should be kept during trimming by AOT.

A solution can be to add a rd.xml file to your project with the following content:

<?xml version="1.0" encoding="utf-8" ?>
<Directives>
  <Application>
    <Assembly Name="MathNet.Numerics.Providers.MKL" Dynamic="Required All"/>
  </Application>
</Directives>

Then edit your .csproj file and add

<RdXmlFile Include="rd.xml" />

to any ItemGroup

a1821216780 commented 10 months ago

Thanks!