Excel DNA with ILNumerics

251 views Asked by At

I have used ILNumerics via Excel DNA in Excel successfully for some time. Now I wrote a new function which uses the linsolve function from ILNumerics (which needs the mkl_custom.dll) and I cannot build this into an XLL. My custom function works in debug which is why I assume sth in the packaging goes wrong.

Here is my dna file:

<DnaLibrary Name="Nik's Lib" RuntimeVersion="v4.0">
   <ExternalLibrary Path="MyLib2010.dll" Pack="true"/>
   <Reference  Path="ILNumerics.dll" Pack="true"/>
   <Reference  Path="mkl_custom.dll" Pack="true"/>
</DnaLibrary>

When packaging this I get the error message that path for mkl_custom.dll

path not found

This might be due to the folder structure of the dll:

enter image description here

Any pointers on how to resolve this would be appreciated.

1

There are 1 answers

4
Govert On

The Excel-DNA packing does not currently support native or mixed assemblies. So you won't be able to use the mechanism to pack the mkl library.

You might be able to store it in your C# assembly as a resource, and extract it yourself at runtime (in an AutoOpen or something, before any of the functions using it are run). If you extract it to a temp file, then call LoadLibrary yourself to load it into the process, it should work when ILNumerics needs it.