This project has moved and is read-only. For the latest updates, please go here.

Embed Native MKL Libs to the executable(.exe)

Mar 21, 2013 at 5:00 PM
Hi.
I've been developing an app which uses Math.NET Numeric Libs with native MKL. I've added both DLLs (MathNet.Numerics.MKL.dll and libiomp5md.dll) and the app will actually run if they are selected as "Content" and "Copy Always". Although, if I try to build the solution with the libs as "Embedded Resources", the executable file will actually embed them (figured out due to its size) but the calculations simply won't perform. Is there any workaround for this?

Thanks in advance,
Nuno Gaspar
Mar 21, 2013 at 6:17 PM
Hi,

You cannot embed the two DLL's. You'll need to either copy them along with the .exe or place them somewhere in your PATH. Another option is to use an .exe packager/bundler. This will create an new exe that will contain your exe and the two DLL in a single exe.

Regards,
Marcus
Marked as answer by cdrnet on 10/3/2013 at 5:44 PM
Mar 22, 2013 at 1:13 AM
Hi Marcus.

Yes, I tried some bundlers/packagers for .Net before actually try to pack them as Embedded Resources, no success with those two files though, all of the bundlers return errors while trying to embed them. I mean, if I try to pack the other libs (i.e. OpenTK and even the "MathNet.Numerics.dll, without the "MKL" and the libiomp5md.dll) I can actually build it, the GUI and the OpenGL run perfectly, but it just freezes when it comes to the calculations part. Any other ideas?

Thank you very much once again,
Nuno Gaspar
Mar 22, 2013 at 6:36 AM
Edited Mar 22, 2013 at 11:05 AM
Hi Nuno,

Which packager did you try? Make sure it is not a .NET only one. I just tested Enigma Virtual Box and it worked fine with simple .NET command line app and the MKL DLLs.

Regards,
Marcus
Marked as answer by cdrnet on 10/3/2013 at 5:44 PM
Mar 22, 2013 at 6:43 AM
Do you have to "bundle" to app into a single .exe? or are you doing so since you cannot get the app to run with the DLLs in the same directory as the .exe?
Also, how are you deploying the app?

Thanks,
Marcus
Mar 22, 2013 at 11:00 AM
Edited Mar 22, 2013 at 11:04 AM
Good Morning Marcus.

You are right, Enigma Virtual Box actually works, thanks! I had already tried with ILMerge (from Microsoft Research), another weird repack of ILMerge supposed to correct some bugs, another called "eXe-packager" and UPX (Ultimate Packager for executables), none of them worked.
I do not have to bundle it into a single .exe, i just find it easier, and simpler to deal with. I plan on publishing it in a website which is also yet to be created, and my goal is to have it working by itself, on a clean and simple double-click pop-up. Once it includes the external lib DLLs, I guess that makes it depend only on .NET Framework, which I think that should not be a problem in a "common" pc.

EDIT: Your question about the deploying has anything to do with referencing? I was planning on mention it in the "About Box"

Thanks once again,
Nuno Gaspar
Mar 22, 2013 at 11:12 AM
Edited Mar 22, 2013 at 11:16 AM
Good Morning Marcus.

You are right, Enigma Virtual Box actually works, thanks! I had already tried with ILMerge (from Microsoft Research), another weird repack of ILMerge supposed to correct some bugs, another called "eXe-packager" and UPX (Ultimate Packager for executables), none of them worked.
I do not have to bundle it into a single .exe, i just find it easier, and simpler to deal with. I plan on publishing it in a website which is also yet to be created, and my goal is to have it working by itself, on a clean and simple double-click pop-up. Once it includes the external lib DLLs, I guess that makes it depend only on .NET Framework, which I think that should not be a problem in a "common" pc.

EDIT: Your question about the deploying has anything to do with referencing? I was planning on mention it in the "About Box"

EDIT2: Sorry for double posting. Cannot delete it!

Thanks once again,
Nuno Gaspar
Mar 22, 2013 at 11:17 AM
Edited Mar 22, 2013 at 11:17 AM
EDIT: Your question about the deploying has anything to do with referencing? I was planning on mention it in the "About Box"
No, I was just wondering how the DLLs were getting installed,