Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using mono aot / aot-full compilation: nothing appears to happen?

Tags:

c#

.net

mono

aot

I've got a C# project that I need compiled to a native binary. I've read here:

http://www.mono-project.com/AOT

That Mono can precompile an assembly to one of two options:

  1. --aot : A precompiled image (essentially the same as Ngen as it looks to me)
  2. --aot=full: A fully compiled to native binary instance of the original .exe

I am fairly sure I'm understanding those right, but could be wrong about the --aot=full option.

However, when I run:

 mono.exe --aot=full --verbose program.exe  

I get no output, the last modified date on the executable remains the same, and no files are generated. I've also tried just as a test:

 mono.exe --aot --verbose program.exe 

I get the same result; no output, no image file or files in general, nothing.

Am I missing something here?

like image 607
applepi Avatar asked Nov 07 '11 16:11

applepi


2 Answers

You should probably make a bug report. AOT info is normally displayed even without --verbose. With --verbose you should get a LOT of prints. Another possibility is that you have broken Mono installation.

Nevertheless if you want to produce native executable binary, you should use mkbundle rather than AOT.

like image 191
Argbart Avatar answered Sep 23 '22 04:09

Argbart


You don't want --aot, you want mkbundle.

--aot tells mono to precompile some code rather than use the jit compiler, it does not give you a fully machine-code binary. For this you need mkbundle.

like image 42
IanNorton Avatar answered Sep 20 '22 04:09

IanNorton