mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

I want use MKL under AOT publish,But cant

Open a1821216780 opened this issue 1 year ago • 2 comments

a1821216780 avatar Jan 16 '24 18:01 a1821216780

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

FabianNitsche avatar Jan 23 '24 13:01 FabianNitsche

Thanks!

a1821216780 avatar Jan 26 '24 08:01 a1821216780